My BizTalk orchestration receives a series of requests from System A via a
BizTalk generated web service. The workflow to process an individual
request
is basically: receive the request, send a request-received acknowledgement
message, process the request (which involves a series of messages back and
forth with System B and can take anywhere from a few seconds to three
days.
The receipt and acknowledgement of the request is handled in my main
orchestration. The processing of the request is handled in a
sub-orchestration which I call synchronously from my main orchestration.
So
when n requests come in they get processed one at a time - receive,
acknowledge, process, receive, acknowledge, process, etc. The problem is
that when the first request takes longer than a few seconds to process,
the
latter requests timeout in the web service.
So an obvious alternative is to start the processing sub-orchestration
asynchronously rather than calling it synchronously. That way I could
receive and acknowlege the first message, start an orchestration on
another
thread to process it, and receive and acknowledge the second request while
the first is still processing and spawn an orchestration on yet another
thread to process the second request. And on and on until I've received
acknowledged all requests and spawned off orchestrations to process them.
I'm looking into that approach, but I'm concerned that the n
orchestrations
processing n requests will not be able to distinguish the different
messages
coming from System B during the processing because the messages are
correlated on order number and all of the threads are processing requests
for the same order. System B, which is outside of my control, doesn't
provide data in the response message to uniquely tie it to the request I
sent.
So the behavior I'd like to have is for my main orchestration to receive
and
acknowledge the first request and submit it to a queue for processing with
System B. Then it would receive and acknowledge the second request and
submit it to the same queue. Effectively I want the processing on a
separate
asynchronous thread (so I can quickly acknowledge all incoming requests)
but
I want the separate requests processed in order on one thread as opposed
to
in parallel on many threads. Can anyone suggest how I might get that
behavior in a BizTalk orchestration?
Thanks,
Zoe


|