...
- Using a system property
Any message that comes to the client with the redelivery flag true will get delayed. The delay can be set using a custom system property. New messages that are received by the client does not get blocked due to the redelivered message. Therefore, redelivered messages are unordered.
Note When using this feature, it may be necessary to use “Per-Message Acknowledgements” depending on the use case.
This system property can be set as shown below. This value is given in milliseconds. The default value is 0.
Code Block System.setProperty("AndesRedeliveryDelay", "10000");
Using a parameter in the connection URL
Warning The possibility of specifying the redlivery delay in the connection URL is available only as a WUM update for WSO2 MB 3.2.0. This WUM update is effective from the 5th of April, 2018. For instructions on getting updates for WSO2 MB, see Updating WSO2 Products.
Once you get the WUM update, be sure to replace all instances of the
andes-client-3.2.19.jar
used in the subscriber client with the new JAR found in WUM-updated WSO2 MB (<WUM-UPDATED_MB>/client-lib/andes-client-3.2.19.jar
).With this option, the expected redelivery delay can be specified in milliseconds in the connection URL by using the redeliverydelay parameter. For example, see the following connection URL, which specifies a redelivery delay of 15000 milliseconds:
Code Block amqp://admin:admin@clientID/carbon?redeliverydelay='15000'&brokerlist='tcp://localhost:5673'
See Setting the Connection URL for more details on all the paramaters used in the connection URL.
...