In the default client shipped with ActiveMQ "Classic" org.apache.activemq:activemq-client:5.17.0
re-delivery policy is being configured like this
var connectionFactory = new ActiveMQConnectionFactory();
var policy = new RedeliveryPolicy();
// and apply necessary config via setters
// e.g. collisionAvoidance, maximumRedeliveries, redeliveryDelay
connectionFactory.setRedeliveryPolicy(policy);
I would like to use the ActiveMQ Artemis client org.apache.activemq:artemis-jms-client:2.22.0
,
but there is nothing similar in its Java classes API that could allow to do the same.
How to configure re-delivery policy in ActiveMQ Artemis?
In ActiveMQ Artemis the redelivery policy is configured on the broker. See the documentation for more details on that. Configuring redelivery on the broker allows the same policy to be enforced across all protocols and clients rather than having to be individually configured.
For what it's worth, ActiveMQ Artemis supports the OpenWire protocol so you can continue to use the org.apache.activemq:activemq-client:5.17.0
client if necessary.