1414package io .nats .client ;
1515
1616import io .nats .client .api .ConsumerInfo ;
17+ import io .nats .client .support .PullStatus ;
1718
1819import java .io .IOException ;
1920import java .time .Duration ;
@@ -27,9 +28,8 @@ public interface JetStreamSubscription extends Subscription {
2728
2829 /**
2930 * Initiate pull with the specified batch size.
30- *
3131 * ! Pull subscriptions only. Push subscription will throw IllegalStateException
32- * ! Primitive API for Advanced use only. Prefer Fetch or Iterate
32+ * ! Primitive API for ADVANCED use only, officially not supported . Prefer fetch, iterate or reader.
3333 *
3434 * @param batchSize the size of the batch
3535 * @throws IllegalStateException if not a pull subscription.
@@ -38,11 +38,8 @@ public interface JetStreamSubscription extends Subscription {
3838
3939 /**
4040 * Initiate pull with the specified request options
41- *
4241 * ! Pull subscriptions only. Push subscription will throw IllegalStateException
43- * ! Primitive API for Advanced use only. Prefer Fetch or Iterate
44- *
45- * IMPORTANT! PullRequestOptions ARE CURRENTLY EXPERIMENTAL AND SUBJECT TO CHANGE.
42+ * ! Primitive API for ADVANCED use only, officially not supported. Prefer fetch, iterate or reader.
4643 *
4744 * @param pullRequestOptions the options object
4845 * @throws IllegalStateException if not a pull subscription.
@@ -53,7 +50,7 @@ public interface JetStreamSubscription extends Subscription {
5350 * Initiate pull in noWait mode with the specified batch size.
5451 *
5552 * ! Pull subscriptions only. Push subscription will throw IllegalStateException
56- * ! Primitive API for Advanced use only. Prefer Fetch or Iterate
53+ * ! Primitive API for ADVANCED use only, officially not supported . Prefer fetch, iterate or reader.
5754 *
5855 * @param batchSize the size of the batch
5956 * @throws IllegalStateException if not a pull subscription.
@@ -62,9 +59,8 @@ public interface JetStreamSubscription extends Subscription {
6259
6360 /**
6461 * Initiate pull in noWait mode with the specified batch size.
65- *
6662 * ! Pull subscriptions only. Push subscription will throw IllegalStateException
67- * ! Primitive API for Advanced use only. Prefer Fetch or Iterate
63+ * ! Primitive API for ADVANCED use only, officially not supported . Prefer fetch, iterate or reader.
6864 *
6965 * @param batchSize the size of the batch
7066 * @param expiresIn how long from now this request should be expired from the server wait list
@@ -74,9 +70,8 @@ public interface JetStreamSubscription extends Subscription {
7470
7571 /**
7672 * Initiate pull in noWait mode with the specified batch size.
77- *
7873 * ! Pull subscriptions only. Push subscription will throw IllegalStateException
79- * ! Primitive API for Advanced use only. Prefer Fetch or Iterate
74+ * ! Primitive API for ADVANCED use only, officially not supported . Prefer fetch, iterate or reader.
8075 *
8176 * @param batchSize the size of the batch
8277 * @param expiresInMillis how long from now this request should be expired from the server wait list, in milliseconds
@@ -89,13 +84,12 @@ public interface JetStreamSubscription extends Subscription {
8984 * <p>
9085 * <code>sub.nextMessage(timeout)</code> can return a:
9186 * <ul>
92- * <li>regular message
87+ * <li>regular JetStream message
9388 * <li>null
9489 * </ul>
9590 * <p>
96- *
9791 * ! Pull subscriptions only. Push subscription will throw IllegalStateException
98- * ! Primitive API for Advanced use only. Prefer Fetch or Iterate
92+ * ! Primitive API for ADVANCED use only, officially not supported . Prefer fetch, iterate or reader.
9993 *
10094 * @param batchSize the size of the batch
10195 * @param expiresIn how long from now this request should be expired from the server wait list
@@ -109,13 +103,12 @@ public interface JetStreamSubscription extends Subscription {
109103 * <p>
110104 * <code>sub.nextMessage(timeout)</code> can return a:
111105 * <ul>
112- * <li>regular message
106+ * <li>regular JetStream message
113107 * <li>null
114108 * </ul>
115109 * <p>
116- *
117110 * ! Pull subscriptions only. Push subscription will throw IllegalStateException
118- * ! Primitive API for Advanced use only. Prefer Fetch or Iterate
111+ * ! Primitive API for ADVANCED use only, officially not supported . Prefer fetch, iterate or reader.
119112 *
120113 * @param batchSize the size of the batch
121114 * @param expiresInMillis how long from now this request should be expired from the server wait list, in milliseconds
@@ -128,7 +121,6 @@ public interface JetStreamSubscription extends Subscription {
128121 * This uses <code>pullExpiresIn</code> under the covers, and manages all responses
129122 * from <code>sub.nextMessage(...)</code> to only return regular JetStream messages.
130123 * This can only be used when the subscription is pull based.
131- *
132124 * ! Pull subscriptions only. Push subscription will throw IllegalStateException
133125 *
134126 * @param batchSize the size of the batch
@@ -144,7 +136,6 @@ public interface JetStreamSubscription extends Subscription {
144136 * This uses <code>pullExpiresIn</code> under the covers, and manages all responses
145137 * from <code>sub.nextMessage(...)</code> to only return regular JetStream messages.
146138 * This can only be used when the subscription is pull based.
147- *
148139 * ! Pull subscriptions only. Push subscription will throw IllegalStateException
149140 *
150141 * @param batchSize the size of the batch
@@ -161,7 +152,6 @@ public interface JetStreamSubscription extends Subscription {
161152 * receive the first message within the max wait period. It will stop if the batch is
162153 * fulfilled or if there are fewer than batch size messages. 408 Status messages
163154 * are ignored and will not count toward the fulfilled batch size.
164- *
165155 * ! Pull subscriptions only. Push subscription will throw IllegalStateException
166156 *
167157 * @param batchSize the size of the batch
@@ -178,7 +168,6 @@ public interface JetStreamSubscription extends Subscription {
178168 * receive the first message within the max wait period. It will stop if the batch is
179169 * fulfilled or if there are fewer than batch size messages. 408 Status messages
180170 * are ignored and will not count toward the fulfilled batch size.
181- *
182171 * ! Pull subscriptions only. Push subscription will throw IllegalStateException
183172 *
184173 * @param batchSize the size of the batch
@@ -193,11 +182,8 @@ public interface JetStreamSubscription extends Subscription {
193182 * Prepares a reader. A reader looks like a push sync subscription,
194183 * meaning it is just an endless stream of messages to ask for by nextMessage,
195184 * but uses pull under the covers.
196- *
197185 * ! Pull subscriptions only. Push subscription will throw IllegalStateException
198186 *
199- * THIS API IS CONSIDERED EXPERIMENTAL AND SUBJECT TO CHANGE
200- *
201187 * @param batchSize the size of the batch
202188 * @param repullAt the point in the current batch to tell the server to start the next batch
203189 *
@@ -214,4 +200,11 @@ public interface JetStreamSubscription extends Subscription {
214200 * @throws JetStreamApiException the request had an error related to the data
215201 */
216202 ConsumerInfo getConsumerInfo () throws IOException , JetStreamApiException ;
217- }
203+
204+ /**
205+ * Get the current status of pull requests for this subscription
206+ * ! Pull subscriptions only. Push subscription will throw IllegalStateException
207+ * @return the PullStatus object
208+ */
209+ PullStatus getPullStatus ();
210+ }
0 commit comments