Posting Messages Back to the Message Box – Again

Ok, everyone wants a copy of the sample, so I’ve found somewhere to store files and it’s here

My sample is pretty straightforward, the PreProcessing orchestration retrieves all messages that haven’t been processed, then marks the Message as being PreProcessed and pops it back into the MessageBox – you’d obviously do your work in-between these steps though.

There are two other orchestrations that retrieve messages that have been processed, and are of the appropriate MessageType for the orchestration (MessageType1 or MessageType2), all you have to do is deploy and bind the PreProcessing Orchestration to a port, a FILE port for example.

I’ve supplied two XML message files one has a MessageType of MessageType1 and the other MessageType2, these will be processed by different processing orchestrations.

Each of the processing orchestrations outputs some debug, which you can view using this tool from SysInternals to check that the message is routed to the right orchestration.

Remember, if you need to send the same message out or to another orchestration you’ll have to update the ProcessingStatus field otherwise the ProcessingOrchestration will pick it up as well and you’ll end up with a recursive loop.

Comments (3)

  1. Hi,

    thanks for the sample, many people were asking me before about this. This is a fine example of what I pointed out in:

    To make it even better you may indeed add context to the message instead of using PI’s. To do this, a custom receive pipeline would suit the job fine! (Only few lines of code involved.)

    Kind regards, love your blog!


    [please direct feedback to: bts2004communityfeedback (at) hotmail (dot) com]

  2. I also implemented a scenario where messages are posted back to the message box, but with a slightly different twist:

    Instead of using a "Process flag", I just created another schema that I transform processed messages to. The other ochestration then only listens for messages conforming to that schema.