1

我通过Mule向Active MQ队列发送消息。

我想要这样,只有最新的消息保留在队列中,而不是任何以前的消息。

如何做到这一点?

非常感谢。

4

1 回答 1

3

set the queue size to be 1, the default eviction policy, which is oldestMessageEvictionStrategy, should kick out the previous message and put in the newest one. You can also set other policies for priorities, such as OldestMessageWithLowestPriorityEvictionStrategy or mess around with the TTL settings on your messages.

You may also get some warnings about full queue though, so be prepared to handle that.

于 2009-04-22T12:42:40.320 回答