简体   繁体   中英

ActiveMQ Redelivery Policy and Blocking/Non-Blocking consumers design

I have a JMS queue where I get messages of several type. All messages are Object messages. I have Spring DMLC processing them and tries delivering them to external endpoints.

Each message type is associated with different endpoint.

Example: 

Message A with type A to be delivered to endpoint A
Message B with type A to be delivered to endpoint A
Message C with type A to be delivered to endpoint A

Message D with type X to be delivered to endpoint X
Message E with type X to be delivered to endpoint X
Message F with type X to be delivered to endpoint X

If one of the endpoint goes down, I don't want messages meant for other endpoints getting blocked if I use Redelivery Policy setup for up to 2 hours.

Assuming that consumers picked up a set of messages to be delivered to endpoint X and if X is down, I don't want to block other messages to be delivered for endpoint Y.

Does non blocking consumer help me here?

When I use blocking consumer using Redelivery Policy, it gets blocked till the endpoint is back to normal or till the time it redelivers and gives up dropping off failed messages to DLQ.

Blocking consumers worked perfectly when the external endpoint is just one. If it goes down, then consumers blocked those messages till the endpoint comes back up.

I don't think blocking consumers help me here if message(s) got to be delivered to 1 or more endpoint.

I am not finding any information for non blocking consumers and I would like to know if it actually helps me with my problem.

Oldie but goodie. Use nonBlockingRedelivery(true) on your AMQ connection factory

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM