Skip to content

Add overloaded sendAndReceive methods to JmsTemplate to use explicit response queue#36162

Merged
jhoeller merged 1 commit intospring-projects:mainfrom
pisek:main
Jan 16, 2026
Merged

Add overloaded sendAndReceive methods to JmsTemplate to use explicit response queue#36162
jhoeller merged 1 commit intospring-projects:mainfrom
pisek:main

Conversation

@pisek
Copy link
Contributor

@pisek pisek commented Jan 16, 2026

No description provided.

…e to use explicit response queue

Signed-off-by: Michał Pisarski <pisekfm@o2.pl>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 16, 2026
@jhoeller jhoeller self-assigned this Jan 16, 2026
@jhoeller jhoeller added in: messaging Issues in messaging modules (jms, messaging) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 16, 2026
@jhoeller jhoeller added this to the 7.0.4 milestone Jan 16, 2026
@jhoeller jhoeller merged commit 3f390d5 into spring-projects:main Jan 16, 2026
5 checks passed
@jhoeller
Copy link
Contributor

Good idea, and implemented in a straightforward fashion! Thanks for the PR - rolled into 7.0.4 now.

@acogoluegnes
Copy link
Contributor

@jhoeller rabbitmq/rabbitmq-jms-client#698 bumps Spring to 7.0.4 and has a RPC test failing. I suspect this change to be the culprit. I see the reply consumer is now created after the message is sent, so the RPC server may send a reply before the temporary queue is created. The requester does not get any response then. Do you think this analysis is correct?

I reproduced the failure locally, but it is transient, which makes sense as there is a race condition.

@jhoeller
Copy link
Contributor

jhoeller commented Feb 13, 2026

The temporary Queue instance is technically created before the send operation still; it's just the MessageConsumer for that Queue that is created after the send now. Any insight into why RabbitMQ effectively creates the temporary queue on createConsumer there rather than on the actual createTemporaryQueue call? With ActiveMQ, the queue seems to exist in a stable form after createTemporaryQueue, with createConsumer then just starting delivery from the queue.

In any case, I'll revise this to differentiate between the useCorrelationId code path and the temporary queue path, performing the createConsumer call early in the latter case again (where we don't have to wait for a correlation/message id on the sent message). Let's track this in the derived issue: #36321

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: messaging Issues in messaging modules (jms, messaging) type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants