How to ensure that the replier is always online throughout the whole time request messages are being
Hi Team,
Good Afternoon!!
Functionality: Publishers ---> q/prd:durable queue--->XYZ consumers (replier) and reply to publisher by using non-durable queue.
Please help with me with end to end steps for below ask.
How to ensure that the replier is always online throughout the whole time request messages are being published?
NOTE: If a client is using a Temporary Queue and disconnects for over a minute, the Temporary Queue will be removed from the event broker, and automatically recreated once the client reconnects.
Kindly suggest!!
Thank you in advance!!
Answers
-
Hi @Yogi,
It sounds like what you want here is a synchronous reply - the replier replies as soon as it can, and the requester waits a specified amount of time before deciding that the replier is dead and taking some business logic decision based on that.
To do that, you'd use the request/reply pattern _without the queues_ that you have in the interaction above. So you'd produce to a topic, add a correlation ID to the message headers. The replier replies on a response topic, with the correlation ID in the response. No queues are involved: the producer needs to keep track of which requests it has issued and which have been responded to.
0 -
@TomF 's response is the way to go. Synchronous request/reply with a topic is the pattern that works best for these use cases. In the Solace APIs, you will find "helper" classes/APIs that assist in this.
For example, take a look at RequestReplyMessagePublisher (Solace PubSub+ Messaging API for Java 1.1.0 API) in the Java API.
0 -
And you can take a look at the requestor is implemented in Python here as well
0