Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/305.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java ActiveMQ重新交付策略和阻塞/非阻塞使用者设计_Java_Jms_Activemq - Fatal编程技术网

Java ActiveMQ重新交付策略和阻塞/非阻塞使用者设计

Java ActiveMQ重新交付策略和阻塞/非阻塞使用者设计,java,jms,activemq,Java,Jms,Activemq,我有一个JMS队列,从中可以获得多种类型的消息。所有消息都是对象消息。 我让Spring DMLC处理它们,并尝试将它们传递到外部端点 每种消息类型都与不同的端点相关联 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

我有一个JMS队列,从中可以获得多种类型的消息。所有消息都是对象消息。 我让Spring DMLC处理它们,并尝试将它们传递到外部端点

每种消息类型都与不同的端点相关联

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
如果其中一个端点发生故障,如果我使用重新交付策略设置长达2小时,我不希望其他端点的消息被阻止

假设使用者拾取了一组要传递给端点X的消息,并且如果X关闭,我不想阻止要传递给端点Y的其他消息

非阻塞消费者在这方面对我有帮助吗

当我使用blocking consumer using Redelivery策略时,它会被阻塞,直到端点恢复正常,或者直到它重新交付并放弃将失败消息丢弃到DLQ为止

当外部端点只有一个时,阻塞使用者就可以完美地工作。如果出现故障,则消费者会阻止这些消息,直到端点恢复

如果消息必须传递到一个或多个端点,我认为阻塞消费者在这方面对我没有帮助

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

我没有找到任何关于非阻塞消费者的信息,我想知道它是否真的对我的问题有帮助。

老掉牙但很好。在您的AMQ连接工厂上使用nonBlockingRedelivery(true)

您找到解决方案了吗?(我也有同样的问题…)