Tobi Sasse wrote:Hi guys, I have a basic question on how to use JMS for RPC purposes. Please excuse my smartphone's spelling... Let me introduce an example:
I do have two frontend servers (plain Java Applications) that Take Requests from Users. so there is request R1 on frontend Server F1.
Further I have an ActiveMQ Broker on another machine with two Queues: TO_BACKEND and TO_FRONTEND
Further there is a backend server B1 that Processes Requests from the frontend severs.
So the Flow is as follows: F1 and F2 listen on TO_FRONTEND. B1 listens on TO_BACKEND.
F1 receives a request and puts a Message containing R1 on TO_BACKEND Where B1 picke it up, Processes it and puts a reply message on TO_FRONTEND.
Question: how do i ensure that the reply Message gets routed to F1 and Not to F2? I am missing a routing concept/component. I do not want to create seperate queues for each frontend/backend server couple, as my servers are supposed to not know of each other (extremely loose coupled system).
Further I do not want to use JMS topics and have all listeners filtering for Messages that belong to them. This should be done by a routing component.
Can you point me to best practices/frameworks please?
Thanks a lot,
Tobi
Pat Farrell wrote:Why not just use JMS to send messages, and not bother with RPC at all?
I see no advantage of using RPC. Sending messages is much cleaner and easier.
Tobi Sasse wrote:Either send it to a topic and have all the other consumers (that are not X) filtering the message and determining "oh this message is for X and not for me so forget it" - which may cause some significant overhead on the consumers. Or to set up a private queue inbetween the producer and consumer x. The later approach would introduce some addressing problems, which aren't solved by plain JMS.
