@@ -22,10 +22,18 @@ public interface SyncReader {
22
22
void initAndWait ();
23
23
24
24
/**
25
- * Receive a {@link Message}. Blocks until a Message is received.
25
+ * Return identifier of read session.
26
+ * @return current read session identifier or null if session has not started yet
27
+ */
28
+ @ Nullable
29
+ String getSessionId ();
30
+
31
+ /**
32
+ * Receive a {@link Message}.Blocks until a Message is received.
26
33
*
27
34
* @param settings settings for receiving a Message
28
35
* @return returns a {@link Message}, or null if the specified timeout time elapses before a message is available
36
+ * @throws java.lang.InterruptedException if current thread was interrupted
29
37
*/
30
38
Message receive (ReceiveSettings settings ) throws InterruptedException ;
31
39
@@ -35,6 +43,7 @@ public interface SyncReader {
35
43
* @param timeout timeout to wait a Message with
36
44
* @param unit TimeUnit for timeout
37
45
* @return returns a {@link Message}, or null if the specified waiting time elapses before a message is available
46
+ * @throws java.lang.InterruptedException if current thread was interrupted
38
47
*/
39
48
@ Nullable
40
49
default Message receive (long timeout , TimeUnit unit ) throws InterruptedException {
@@ -47,6 +56,7 @@ default Message receive(long timeout, TimeUnit unit) throws InterruptedException
47
56
* Receive a {@link Message}. Blocks until a Message is received.
48
57
*
49
58
* @return {@link Message}
59
+ * @throws java.lang.InterruptedException if current thread was interrupted
50
60
*/
51
61
default Message receive () throws InterruptedException {
52
62
return receive (ReceiveSettings .newBuilder ().build ());
0 commit comments