Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support expression in @SendTo for JMS endpoints [SPR-12899] #17498

Closed
spring-projects-issues opened this issue Apr 8, 2015 · 3 comments
Closed
Assignees
Labels
in: messaging Issues in messaging modules (jms, messaging) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Apr 8, 2015

John W opened SPR-12899 and commented

I have a case where a JMSListener needs to send back a message on the original queue/topic it was received.

Here is a really small version of what I am trying to do:

foo.topic=my.foo.topic
@Component
public class FooReceiver {
...
 @JmsListener(destination = "${foo.topic}")
 @SendTo("${foo.topic}")
 public Message<String> handleFooMessage(final String message) {
 ...
  Message<String> reply = MessageBuilder.withPayload(someString).build();
  return reply;
 }

The replies were never showing up.

I set a JMSReplyTo on the incoming message, and then the reply worked. Strange..

So I started stepping through org.springframework.jms.config.MethodJmsListenerEndpoint.getDefaultResponseDestination() to make sure that I wasn't having some sort of proxy issue (i.e. #17118). On line 122 though, I could see the issue - the value of

return (String) destinations[0];

shows up as

[${foo.topic}]

In other words, it does not appear to be getting expanded. Sure enough, in my activemq queue list I see a queue named ${foo.topic}.

Should I expect this property to be getting expanded inside the @SendTo annotation?

Thanks
John


Affects: 4.1.4

Issue Links:

Referenced from: commits f98a6c6

@spring-projects-issues
Copy link
Collaborator Author

Stéphane Nicoll commented

It's an oversight. JmsListener is handled indeed but SendTo is not.

@spring-projects-issues
Copy link
Collaborator Author

Stéphane Nicoll commented

This is now implemented on master and available in 4.2.0.BUILD-SNAPSHOT soon.

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

Modified title (was: "@SendTo annotation not expanding properties").

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

No branches or pull requests

2 participants