ViS
ViS

Reputation: 1517

how to send response to a sender from ESB before adding message to a jms queue

I have a requirement, where I am getting requests from ESB api and using ESB sequencing through restfull tomcat endpoints I am validating the request and then sending it to the JMS queue,

This is working fine but i also want to send the response to the sender, if the validation fails in restfull tomcat endpoint. Since the validation fails the message does not get delivered to the queue and gets dropped there.

Request Flow,

Sender -> 
    ESB API -> 
        ESB sequence -> 
               tomcat validation endpoint -> 
                                    ESB sequence -> 
                                            AddressEndpoint for JMS queue.

Here, at "tomcat validation endpoint ->" if the validation is success the flow should continue to "AddressEndpoint for JMS queue." at the same time it should acknowledge the sender that the message was success.

Is it possible?

Please suggest, the sender presently does not get notified if the message reached the queue or got dropped at tomcat endpoint in the esb sequence.

Upvotes: 2

Views: 369

Answers (2)

As Jean-Michel said, you can use a clone mediator and send a copy of the message to JMS and the other copy to the caller using RESPOND or SEND mediator.

Upvotes: 1

Jean-Michel
Jean-Michel

Reputation: 5946

When you receive the response from your tomcat validation endpoint, outSequence or faultSequence is executed depending if the endpoint was reachable, etc. In those sequences, you can clone the response if you need and in one target, you send your message to the JMS queue and in the other, you send a response to the caller

Upvotes: 3

Related Questions