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-issuemaster opened this issue Apr 8, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

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:

  • #16784 Support destination variable placeholders in @SendTo and @SendToUser for STOMP endpoints

Referenced from: commits f98a6c6

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 9, 2015

Stéphane Nicoll commented

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

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 16, 2015

Stéphane Nicoll commented

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

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 17, 2015

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
You can’t perform that action at this time.