none
Need help with message routing RRS feed

  • Question

  • Assume that an orchestration is subscribed to a MessageType1 to get messages from the BizTalk message box. This orchestration has an error handling block which should send the original message with MessageType1 to an offline file folder. However, once this message has been sent to the corresponding send port it goes via the BizTalk message box and, thus, is taken by this orchestration again forming an infinitive loop.

    I tried to populate a promoted property, e.g. ErrorReport.ErrorCode, to distingish between normal & failed messages but the Receive Port filter can't filter by "Not Exists" operation.

    Any suggestions?

    Note that I'd like to preserve this message intact to simplify its post-processing by fixing its data and moving it into an incoming folder. I am also aware of possibility of creating a new message type/new orchestration to handle it but seeking for a simplier solution as I described.

    Thursday, June 30, 2011 6:33 PM

Answers

  • Only adapters that actually use files (i.e. File and FTP/FTPS) will populate this property (not 100% sure about WSS, but I think it doesn't, but there is a WSS.* property for file name).  Other adapters like HTTP and SQL will obviously not populate this property.  Also messages create in an orchestration that don't assign to an existing message that was received with this property populated will also not populate this property.  Promoted properties need not exist in the message and you can make your own property to stipulate a status if you like.  My favorite way to solve your specific problem is to add "BTS.Operation != Name_Of_Error_Send_Operation_In_Orchestration" to your activating subscription to not receive messages sent from the error send port. 

    Kind Regards,

    -Dan


    If this answers your question, please Mark as Answer
    Tuesday, July 5, 2011 6:15 PM

All replies

  • If you don't want to do anything more, then use the "Exists" operator, on any promoted property you are sure will be in message, to get the message in the orchestration and set this property in the context to null (by trying to promote it with value null) in orchestration so that the message is not getting received again.
    Mark As Answer or Vote As Helpful if My Reply Does, Regards, -Rohit
    Thursday, June 30, 2011 7:30 PM
    Moderator
  • Assume that an orchestration is subscribed to a MessageType1 to get messages from the BizTalk message box. This orchestration has an error handling block which should send the original message with MessageType1 to an offline file folder. However, once this message has been sent to the corresponding send port it goes via the BizTalk message box and, thus, is taken by this orchestration again forming an infinitive loop.

    I tried to populate a promoted property, e.g. ErrorReport.ErrorCode, to distingish between normal & failed messages but the Receive Port filter can't filter by "Not Exists" operation.

    Any suggestions?

    Note that I'd like to preserve this message intact to simplify its post-processing by fixing its data and moving it into an incoming folder. I am also aware of possibility of creating a new message type/new orchestration to handle it but seeking for a simplier solution as I described.


    Have you considered using the ESB Tookit's Exception management Framework. This is a perfect scenario for that use. The ESB portal will hold all your suspended messages from the orchestration along with the Error description so it'll be easy for you to determine the reason for the failure. The Exception Management framework has an API that allows you to set properties of the Fault message (which is a wrapper around the message) in the exception handler of the orcehstration.
    Thursday, June 30, 2011 9:48 PM
  • If you don't want to do anything more, then use the "Exists" operator, on any promoted property you are sure will be in message, to get the message in the orchestration and set this property in the context to null (by trying to promote it with value null) in orchestration so that the message is not getting received again.
    Mark As Answer or Vote As Helpful if My Reply Does, Regards, -Rohit

    That's what I tried first. It is no problem to filter the messages by Exists but how to configure the orchestration to NOT grab the messages without a promoted property? If no filters applied then this orchetsration will grab any messages regardless whether this promoted property exists or not.
    Monday, July 4, 2011 1:52 PM
  • Hi,

    Add BTS.ReceivePortName Exists to your receive shape filter expression.

    Best regards

    Rasmus Jaeger

    Tuesday, July 5, 2011 7:17 AM
  • Add BTS.ReceivePortName Exists to your receive shape filter expression.

    Rasmus Jaeger


    Sounds like a hack. I wonder in what cases BTS.ReceivePortName will exist or not exist?
    Tuesday, July 5, 2011 5:22 PM
  • Only adapters that actually use files (i.e. File and FTP/FTPS) will populate this property (not 100% sure about WSS, but I think it doesn't, but there is a WSS.* property for file name).  Other adapters like HTTP and SQL will obviously not populate this property.  Also messages create in an orchestration that don't assign to an existing message that was received with this property populated will also not populate this property.  Promoted properties need not exist in the message and you can make your own property to stipulate a status if you like.  My favorite way to solve your specific problem is to add "BTS.Operation != Name_Of_Error_Send_Operation_In_Orchestration" to your activating subscription to not receive messages sent from the error send port. 

    Kind Regards,

    -Dan


    If this answers your question, please Mark as Answer
    Tuesday, July 5, 2011 6:15 PM