For example, the orchestration receives the first message and immediately
begins processing it. As the message is processing, another correlated
message arrives and is queued. When the first message is completed processing
the second message is dequeued and begins processing. This pattern repeats
until no more messages have arrived.
Can anyone offer a fairly straightforward solution to this? How can I
simultaneously process and receive messages in the same orchestration
instance?
Thanks!
So all you have to do is have the loop for your sequential convoy and
do your processing within it and you're done. That's easy huh?
Your biggest issue is going to be knowing when to terminate this
convoy (which message is the last). There are a lot of ways to do
this such as time or count.
Lastly I would do my processing in a child Orchestration that you call
using the Call Orchestration shape. This will help give yo some
encapsulation. Do you really need to process the messages one at a
time? Often when I do with a sequential convoy is to use Start
Orchestration instead of Call and then pass in a self-correlating
receive port as a parameter to the called Orchestration.
You keep a counter to count how many times you called Start
Orchestration, then you have a second loop that receives the responses
(if you need responses at all or need to know when all the processing
is done). What's great about this pattern is that you get parallel
processing, which increases throughput and scales much better in
larger environments.
Kind Regards,
-Dan
Thank you much for responding!
-m
"Dan Rosanova" wrote:
> .
>
The Thoughtworks paper actually runs through a Broker example (which
is what you want to do). If these are too verbose or don't make
sense, I can send you something quickly.
Basically the main Orchestration calls Start on the child sending the
message and a self-correlating one way port as Orchestration
parameters. It's a Receive in the main and a Send port in the child.
The main Orchestration would call Start in a loop, sending out many
messages and incrementing a counter. When it is done it would do a
second loop with that counter to receive the responses. It's really a
lot easier than it sounds. Simplest multiprocessing I've ever seen!
Kind Regards,
-Dan
I'm using a Sequential Convoy Main Orchestration and when this orchestration
suspends for any reason, it suspends the other messages that're waiting to be
processing too (are waiting in the orchestration work queue).
That's OK, but if I terminate the orchestration (because I cannot resume the
message with the problem), all the other messages are lost (the one with the
error and all the others waiting to be processed)! This is not OK for me.
I suppose that having a child orchestration with self correlating as you
said, the behavior is the same.
Any idea or workaround?
Thanks in advance,
Diego
"Dan Rosanova" wrote:
> .
>
Kind Regards,
-Dan