Wednesday, February 25, 2015

Must receive before sending a message whose messagetype corresponds to a requestresponse operation on an implemented port(Second approach)

The issue was due to two response sent against single request on requestresponse port and for that I wrote a post : http://tech-findings.blogspot.com/2015/02/must-receive-before-sending-message.html  but was curious to find if there is another way to do this and Deepak Sanghi commented on the link which I shared  on LinkedIn , about the another approach to handle this scenario.


It made sense, and I tried it. Below is the modified orchestration


Changes  done as below:

1.   Receive Input Message
2.   Transform to destination format
3.   Send transformed message to destination system
4.   Construct positive response message (but not sent)
5.   If an exception occurs in above steps then catch it in Exception Handler
6.   Construct negative response message  including exception message (but not sent)
7.   The last thing is to place a send shape which sends response

So depending upon the scenario either of the positive response or negative response will be created but wouldn't be sent immediately instead it is sent at last after evaluating the exception.



Related Post:


2 comments:

  1. Hi,
    If i am working on this scenario i would connect the success response send shape to the response port operation and construct a fault message in the catch block and connect fault to a fault on the port.
    Thanks

    ReplyDelete
  2. Yes, what you are suggesting is true if the operation for success response and fault response are different, but if operation is same then it won't work.

    ReplyDelete