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 : https://tech-findings.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

must receive before sending a message

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.



If you have questions or suggestions, feel free to do in comments section below !!!


Do share if you find this helpful .......
 
                          Knowledge Sharing is Caring !!!!!!


Related Post:






2 Comments

If you have any suggestions or questions or want to share something then please drop a comment

  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
Previous Post Next Post