Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 C# 中的 ActiveMQ。我不明白如何在代码中设置重新交付政策。我试图在消费者端的代码中设置属性,但我无法理解它是否有效。
RedeliveryPolicy policy = connection.RedeliveryPolicy policy.InitialRedeliveryDelay = 50000; policy.MaximumRedeliveries = 5;
上面我已经设置了属性,但我不知道它是否正确。
应该是 connection.getRedeliveryPolicy();
下面是一个简单的设置示例:
RedeliveryPolicy policy = connection.getRedeliveryPolicy(); policy.setInitialRedeliveryDelay(500); policy.setBackOffMultiplier(2); policy.setUseExponentialBackOff(true); policy.setMaximumRedeliveries(2);