Skip to content

Allow for setting TTL on a response sent by @JmsListener [SPR-13774] #18348

@spring-projects-issues

Description

@spring-projects-issues

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:

Referenced from: commits d04f785, 9589749

Backported to: 4.1.9

Metadata

Metadata

Assignees

Labels

in: messagingIssues in messaging modules (jms, messaging)status: backportedAn issue that has been backported to maintenance branchestype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions