I need to make a message in a topic expired (ttl=0) upon arrival of a newer message with the same id (property). I imagine that this can be done by creating my own version of the TracingInterceptor that overrides the addMessage method and invokes the setJMSExpiration() on all messages with the same property that exist in the destination. But this doesn't seem to be the most performant way of doing this. Can anybody suggest a better way of doing this (e.g. delete messages from the destination before insertion on the resource layer)?
Thanks a lot!
You're pattern is called "crud" and it is a pattern for a database not a jms.