Ron McLeod wrote:It looks like you are going to be notifying the endpoints synchronously.
Do the endpoints need to be notified in any particular order?
What if one of the web service endpoints is unavailable, or a POST operation fails?
Does it matter?
Do you need to notify the endpoints which had previously been notified to somehow undo any processing which that may have done based on the notification?
Do you need to inform the application of the notification failures?
If it were me, I would create an additional message queue for Completion Notification messages, and submit n number of messages to the queue, one corresponding to each endpoint which needs to be notified, and have a queue listener dedicated to Completion Notification delivery then try and independently deliver the notification to the endpoint. If the message could not be delivered successfully, it could be put back on the queue for later delivery.
Jack Tauson wrote:Could you please elaborate on additional message queue for Completion Notification messages that you mentioned? like when to call it- do I need to call it independently inside each webservice call?
Sorry for the slow response.
What I was suggesting was to have 2 queues:
- the one that you have already for events such as COMPLETE
- another one notifications to the various endpoints
In your code where you have Need to call around 8-10 webservices, rather than serially trying to deliver the notification to a number of endpoint, you could just submit messages to the new queue; one for each endpoint which needs to be notified.
Then you could have a another queue listener which having the responsibility to to deliver the notifications to the endpoint described in the queued message. I haven't had a need to work with Spring, but I would imagine that you could have a number of worker threads for a particular queue, allowing you to deliver notifications to a number of endpoints concurrently.