Allow for setting TTL on a response sent by @JmsListener [SPR-13774] #18348
Labels
in: messaging
Issues in messaging modules (jms, messaging)
status: backported
An issue that has been backported to maintenance branches
type: enhancement
A general enhancement
Milestone
Uh oh!
There was an error while loading. Please reload this page.
Maciej Miklas opened SPR-13774 and commented
Currently AbstractAdaptableMessageListener#sendResponse(...) calls producer.send(response) which results with JMS Message without TTL.
We are using ActiveMQ with persistent messages, in order to avoid queue pollution we have to set TTL on every message.
One possibility to solve this issue is to introduce new annotation, like
@ResponseTTL
, or something more generic:@ResponseSetup
Other possibility would be to give us option to pragmatically configure MessageProducer.
The MessagingMessageListenerAdapter has already a suitable method: #postProcessProducer(), but currently it's impossible to register custom implementation.
The reason for that is that the class MethodJmsListenerEndpoint has factory method creating MessagingMessageListenerAdapter, but MethodJmsListenerEndpoint cannot be extended because JmsListenerAnnotationBeanPostProcessor creates its instance inside of #processJmsListener().
Actually it would be enough to create factory method on JmsListenerAnnotationBeanPostProcessor that would create instance of MethodJmsListenerEndpoint.
Affects: 4.1.8, 4.2.3
Issue Links:
@JmsListener
("is depended on by")Referenced from: commits d04f785, 9589749
Backported to: 4.1.9
The text was updated successfully, but these errors were encountered: