File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
src/main/java/com/rabbitmq/client/amqp Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,15 @@ public interface ConsumerBuilder {
7474 */
7575 StreamOptions stream ();
7676
77+ /**
78+ * Set a listener to customize the subscription before the consumer is created (or recovered).
79+ *
80+ * <p>This callback is available for stream consumers.
81+ *
82+ * @param subscriptionListener subscription listener
83+ * @return this builder instance
84+ * @see SubscriptionListener
85+ */
7786 ConsumerBuilder subscriptionListener (SubscriptionListener subscriptionListener );
7887
7988 /**
@@ -167,12 +176,36 @@ enum StreamOffsetSpecification {
167176 NEXT
168177 }
169178
179+ /**
180+ * Callback to modify a consumer subscription before the link creation.
181+ *
182+ * <p>This allows looking up the last processed offset for a stream consumer and attaching to this
183+ * offset.
184+ */
170185 interface SubscriptionListener {
171186
187+ /**
188+ * Pre-subscription callback.
189+ *
190+ * <p>It is called before the link is created but also every time it recovers, e.g. after a
191+ * connection failure.
192+ *
193+ * @param context subscription context
194+ */
172195 void preSubscribe (Context context );
173196
197+ /** Subscription context. */
174198 interface Context {
175199
200+ /**
201+ * Stream options, to set the offset to start consuming from.
202+ *
203+ * <p>Only the {@link StreamOptions} are accessible, the {@link StreamOptions#builder()}
204+ * method returns <code>null</code>
205+ *
206+ * @return the stream options
207+ * @see StreamOptions
208+ */
176209 ConsumerBuilder .StreamOptions streamOptions ();
177210 }
178211 }
You can’t perform that action at this time.
0 commit comments