.comment-link {margin-left:.6em;}

Ben Cops

Friday, June 18, 2004

Posting Messages Back to the Message Box - Again

Posting Messages Back to the Message Box - Again
I appear to be at least the third person to come to this solution, so it must be a good one. Ok what we’ve got is a scenario where if something goes wrong (we cannot connect to a certain system because its down, authorisation by a human is required, or there’s an exception we can’t handle, etc), we send the message to a holding area where its sorted out. On returning from the holding area, the messge can either carry on from where it left off or start again from the beginning.

So to start from the beginning, I thought, we’ll just call the orchestration again (the whole thing from the start) but with the message as it was before. The message holds details of what irreversible things its done, and so we won’t do them again.

But you can’t directly call an orchestration from itself – the compiler won’t let you create a circular ref.

Instead I found I could send it direct to the message box (direct port) with a field that marks it as resubmitted. I then have another orchestration which subscribes to the message box (direct receive port) with a filter saying “resubmitted=true”. This picks up the message/payment instruction and resubmits it to /calls directly the main orchestration.

Christof Claessens said:
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.


Which is in some ways neater. But for me they really are the same message so I prefer to keep them the same schema. What would be great would be if I could wrap a message in a resubmit message. This would be the envelope schema stuff I presume? I might have a go at this when I get a minute...

10 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home