tags:

views:

74

answers:

1

I am sending messages to an active mq queue through mule. I want that only latest message to remain in the queue and not any previous one. how can this be achieved?

thanks.

+2  A: 

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.

yx