Skip to content

Commit 20e62c5

Browse files
authored
Deprecate public constructor in ImmutableReactiveMessageConsumerSpec (#222)
This commit deprecates the current public constructor with all fields in favor of a package-protected variant. The constructor was initially added to support Jackson serde but it did not need to be public. Resolves #221
1 parent c2a4469 commit 20e62c5

File tree

1 file changed

+163
-0
lines changed

1 file changed

+163
-0
lines changed

pulsar-client-reactive-api/src/main/java/org/apache/pulsar/reactive/client/api/ImmutableReactiveMessageConsumerSpec.java

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,170 @@ public ImmutableReactiveMessageConsumerSpec(ReactiveMessageConsumerSpec consumer
191191
this.expireTimeOfIncompleteChunkedMessage = consumerSpec.getExpireTimeOfIncompleteChunkedMessage();
192192
}
193193

194+
/**
195+
* Constructs an instance with the specified parameters.
196+
* @param topicNames the topics to subscribe to
197+
* @param topicsPattern the topics pattern of the topics to subscribe to
198+
* @param topicsPatternSubscriptionMode the type of topics to subscribe to when using
199+
* a topic pattern - Persistent, Non-Persistent, or both
200+
* @param topicsPatternAutoDiscoveryPeriod the topics auto discovery period when using
201+
* a topic pattern
202+
* @param subscriptionName the subscription name
203+
* @param subscriptionMode the subscription mode
204+
* @param subscriptionType the subscription type
205+
* @param subscriptionInitialPosition the subscription initial position
206+
* @param keySharedPolicy the policy used for {@link SubscriptionType#Key_Shared}
207+
* subscriptions
208+
* @param replicateSubscriptionState whether the subscription shall be replicated
209+
* @param subscriptionProperties the properties for the subscription
210+
* @param consumerName the consumer name
211+
* @param properties the consumer properties
212+
* @param priorityLevel the priority level for the consumer to which a broker gives
213+
* more priority while dispatching messages
214+
* @param readCompacted whether to read messages from the compacted topic rather than
215+
* reading the full message backlog of the topic
216+
* @param batchIndexAckEnabled whether batch index acknowledgement is enabled
217+
* @param ackTimeout the timeout duration for unacknowledged messages
218+
* @param ackTimeoutTickTime the tick time of the ack-timeout redelivery
219+
* @param acknowledgementsGroupTime the duration used to group acknowledgements
220+
* @param acknowledgeAsynchronously whether to ignore the acknowledge operation
221+
* completion and make it asynchronous from the message consuming processing to
222+
* improve performance by allowing the acknowledges and message processing to
223+
* interleave
224+
* @param acknowledgeScheduler the scheduler to use to handle acknowledgements
225+
* @param negativeAckRedeliveryDelay the delay to wait before re-delivering messages
226+
* that have failed to be processed
227+
* @param deadLetterPolicy the dead letter policy for the consumer
228+
* @param retryLetterTopicEnable whether the retries are enabled
229+
* @param receiverQueueSize the size of the consumer receive queue
230+
* @param maxTotalReceiverQueueSizeAcrossPartitions the maximum total receiver queue
231+
* size across partitions
232+
* @param autoUpdatePartitions whether the consumer shall subscribe automatically to
233+
* new partitions of partitioned topics
234+
* @param autoUpdatePartitionsInterval the interval of updating partitions when
235+
* autoUpdatePartitions is enabled
236+
* @param cryptoKeyReader the key reader to be used to decrypt the message payloads
237+
* @param cryptoFailureAction the action the consumer will take in case of decryption
238+
* failures
239+
* @param maxPendingChunkedMessage the maximum number of messages in the queue holding
240+
* pending chunked messages
241+
* @param autoAckOldestChunkedMessageOnQueueFull whether to automatically acknowledge
242+
* pending chunked messages when maxPendingChunkedMessage is reached
243+
* @param expireTimeOfIncompleteChunkedMessage the time interval to expire incomplete
244+
* chunks if a consumer fails to receive all the chunks
245+
* @deprecated since 0.7.0 for removal in 0.9.0 in favor of
246+
* {@link #ImmutableReactiveMessageConsumerSpec(List, Pattern, RegexSubscriptionMode, Duration, String, SubscriptionMode, SubscriptionType, SubscriptionInitialPosition, KeySharedPolicy, Boolean, Map, String, Map, Integer, Boolean, Boolean, Duration, Duration, Duration, Boolean, Scheduler, Duration, RedeliveryBackoff, RedeliveryBackoff, DeadLetterPolicy, Boolean, Integer, Integer, Boolean, Duration, CryptoKeyReader, ConsumerCryptoFailureAction, Integer, Boolean, Duration)}
247+
*/
248+
@Deprecated
194249
public ImmutableReactiveMessageConsumerSpec(List<String> topicNames, Pattern topicsPattern,
250+
RegexSubscriptionMode topicsPatternSubscriptionMode, Duration topicsPatternAutoDiscoveryPeriod,
251+
String subscriptionName, SubscriptionMode subscriptionMode, SubscriptionType subscriptionType,
252+
SubscriptionInitialPosition subscriptionInitialPosition, KeySharedPolicy keySharedPolicy,
253+
Boolean replicateSubscriptionState, Map<String, String> subscriptionProperties, String consumerName,
254+
Map<String, String> properties, Integer priorityLevel, Boolean readCompacted, Boolean batchIndexAckEnabled,
255+
Duration ackTimeout, Duration ackTimeoutTickTime, Duration acknowledgementsGroupTime,
256+
Boolean acknowledgeAsynchronously, Scheduler acknowledgeScheduler, Duration negativeAckRedeliveryDelay,
257+
DeadLetterPolicy deadLetterPolicy, Boolean retryLetterTopicEnable, Integer receiverQueueSize,
258+
Integer maxTotalReceiverQueueSizeAcrossPartitions, Boolean autoUpdatePartitions,
259+
Duration autoUpdatePartitionsInterval, CryptoKeyReader cryptoKeyReader,
260+
ConsumerCryptoFailureAction cryptoFailureAction, Integer maxPendingChunkedMessage,
261+
Boolean autoAckOldestChunkedMessageOnQueueFull, Duration expireTimeOfIncompleteChunkedMessage) {
262+
this.topicNames = topicNames;
263+
this.topicsPattern = topicsPattern;
264+
this.topicsPatternSubscriptionMode = topicsPatternSubscriptionMode;
265+
this.topicsPatternAutoDiscoveryPeriod = topicsPatternAutoDiscoveryPeriod;
266+
this.subscriptionName = subscriptionName;
267+
this.subscriptionMode = subscriptionMode;
268+
this.subscriptionType = subscriptionType;
269+
this.subscriptionInitialPosition = subscriptionInitialPosition;
270+
this.keySharedPolicy = keySharedPolicy;
271+
this.replicateSubscriptionState = replicateSubscriptionState;
272+
this.subscriptionProperties = subscriptionProperties;
273+
this.consumerName = consumerName;
274+
this.properties = properties;
275+
this.priorityLevel = priorityLevel;
276+
this.readCompacted = readCompacted;
277+
this.batchIndexAckEnabled = batchIndexAckEnabled;
278+
this.ackTimeout = ackTimeout;
279+
this.ackTimeoutTickTime = ackTimeoutTickTime;
280+
this.acknowledgementsGroupTime = acknowledgementsGroupTime;
281+
this.acknowledgeAsynchronously = acknowledgeAsynchronously;
282+
this.acknowledgeScheduler = acknowledgeScheduler;
283+
this.negativeAckRedeliveryDelay = negativeAckRedeliveryDelay;
284+
this.negativeAckRedeliveryBackoff = null;
285+
this.ackTimeoutRedeliveryBackoff = null;
286+
this.deadLetterPolicy = deadLetterPolicy;
287+
this.retryLetterTopicEnable = retryLetterTopicEnable;
288+
this.receiverQueueSize = receiverQueueSize;
289+
this.maxTotalReceiverQueueSizeAcrossPartitions = maxTotalReceiverQueueSizeAcrossPartitions;
290+
this.autoUpdatePartitions = autoUpdatePartitions;
291+
this.autoUpdatePartitionsInterval = autoUpdatePartitionsInterval;
292+
this.cryptoKeyReader = cryptoKeyReader;
293+
this.cryptoFailureAction = cryptoFailureAction;
294+
this.maxPendingChunkedMessage = maxPendingChunkedMessage;
295+
this.autoAckOldestChunkedMessageOnQueueFull = autoAckOldestChunkedMessageOnQueueFull;
296+
this.expireTimeOfIncompleteChunkedMessage = expireTimeOfIncompleteChunkedMessage;
297+
}
298+
299+
/**
300+
* Constructs an instance with the specified parameters. Intended for use by the
301+
* Jackson mixin for the Jackson serde.
302+
* @param topicNames the topics to subscribe to
303+
* @param topicsPattern the topics pattern of the topics to subscribe to
304+
* @param topicsPatternSubscriptionMode the type of topics to subscribe to when using
305+
* a topic pattern - Persistent, Non-Persistent, or both
306+
* @param topicsPatternAutoDiscoveryPeriod the topics auto discovery period when using
307+
* a topic pattern
308+
* @param subscriptionName the subscription name
309+
* @param subscriptionMode the subscription mode
310+
* @param subscriptionType the subscription type
311+
* @param subscriptionInitialPosition the subscription initial position
312+
* @param keySharedPolicy the policy used for {@link SubscriptionType#Key_Shared}
313+
* subscriptions
314+
* @param replicateSubscriptionState whether the subscription shall be replicated
315+
* @param subscriptionProperties the properties for the subscription
316+
* @param consumerName the consumer name
317+
* @param properties the consumer properties
318+
* @param priorityLevel the priority level for the consumer to which a broker gives
319+
* more priority while dispatching messages
320+
* @param readCompacted whether to read messages from the compacted topic rather than
321+
* reading the full message backlog of the topic
322+
* @param batchIndexAckEnabled whether batch index acknowledgement is enabled
323+
* @param ackTimeout the timeout duration for unacknowledged messages
324+
* @param ackTimeoutTickTime the tick time of the ack-timeout redelivery
325+
* @param acknowledgementsGroupTime the duration used to group acknowledgements
326+
* @param acknowledgeAsynchronously whether to ignore the acknowledge operation
327+
* completion and make it asynchronous from the message consuming processing to
328+
* improve performance by allowing the acknowledges and message processing to
329+
* interleave
330+
* @param acknowledgeScheduler the scheduler to use to handle acknowledgements
331+
* @param negativeAckRedeliveryDelay the delay to wait before re-delivering messages
332+
* that have failed to be processed
333+
* @param deadLetterPolicy the dead letter policy for the consumer
334+
* @param negativeAckRedeliveryBackoff the redelivery backoff policy for messages that
335+
* are negatively acknowledged
336+
* @param ackTimeoutRedeliveryBackoff the redelivery backoff policy for messages that
337+
* are redelivered due to acknowledgement timeout
338+
* @param retryLetterTopicEnable whether the retries are enabled
339+
* @param receiverQueueSize the size of the consumer receive queue
340+
* @param maxTotalReceiverQueueSizeAcrossPartitions the maximum total receiver queue
341+
* size across partitions
342+
* @param autoUpdatePartitions whether the consumer shall subscribe automatically to
343+
* new partitions of partitioned topics
344+
* @param autoUpdatePartitionsInterval the interval of updating partitions when
345+
* autoUpdatePartitions is enabled
346+
* @param cryptoKeyReader the key reader to be used to decrypt the message payloads
347+
* @param cryptoFailureAction the action the consumer will take in case of decryption
348+
* failures
349+
* @param maxPendingChunkedMessage the maximum number of messages in the queue holding
350+
* pending chunked messages
351+
* @param autoAckOldestChunkedMessageOnQueueFull whether to automatically acknowledge
352+
* pending chunked messages when maxPendingChunkedMessage is reached
353+
* @param expireTimeOfIncompleteChunkedMessage the time interval to expire incomplete
354+
* chunks if a consumer fails to receive all the chunks
355+
*/
356+
@SuppressWarnings("unused")
357+
ImmutableReactiveMessageConsumerSpec(List<String> topicNames, Pattern topicsPattern,
195358
RegexSubscriptionMode topicsPatternSubscriptionMode, Duration topicsPatternAutoDiscoveryPeriod,
196359
String subscriptionName, SubscriptionMode subscriptionMode, SubscriptionType subscriptionType,
197360
SubscriptionInitialPosition subscriptionInitialPosition, KeySharedPolicy keySharedPolicy,

0 commit comments

Comments
 (0)