Skip to content

Allow to set TTL (and other QoS-related settings) on a per-message (and/or per-send) basis #26840

Open
@mauromol

Description

@mauromol

I know there are at least two other issues on this topic:

With this I'm asking if you could reconsider to improve JmsTemplate so that it's possible to do this, especially in light of the existence now of Spring Boot, which configures a JmsTemplate for you (so the workaround to create a new JmsTemplate instance on each message send makes things much more complex than they could be).

Use case: I'm using JmsTemplate to send notifications; these notifications should have different expiration times depending on their context, which has itself an expiration after which all related notifications become stale and useless.

To workaround this, apart from the option to create new JmsTemplates on each send operation, there's the possibility to use one of the execute(...) overloadings that takes a ProducerCallback parameter, however in this case you're completely left alone with regards to the message creation and actual sending process, which is not trivial (see org.springframework.jms.core.JmsTemplate.doSend(Session, Destination, MessageCreator) implementation).

Metadata

Metadata

Assignees

Labels

in: messagingIssues in messaging modules (jms, messaging)type: enhancementA general enhancement

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions