|
Home > Archive > BizTalk Server Orchestration > May 2006 > Does BAM gurantee sequencing of BAM events
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Does BAM gurantee sequencing of BAM events
|
|
| Pandit 2006-05-10, 1:17 am |
| I have a question which I'm not able to find any explanation for this.
The question is does "BAM gurantee sequencing of BAM events fired
asynchronously to a BAM Activity"?
For ex:- let'z assume I have a field called as "Status" in a BAM Activity
"PurchaseOrder". This status gets updated as various points are hit in an
Orchestration.
When the Orchestration starts, the "Status" column is updated to have a
value "Initiated".
When the Orchestration sends out a request to an external system its status
is now "Sent request and waiting for response"
When it gets a response from the external system the status is updated to
reflect "Got response"
when the Orchestration is about to complete it's status is updated to
reflect "Completed".
So basically when the orchestration completes, I expect to see status
"Completed" in BAM against column "Status" and not any other status. Does
BAM gurantee this?
--
Pandit
| |
| Pandit 2006-05-10, 1:17 am |
| Further, I read something about this here.
http://msdn.microsoft.com/library/d...uationtopic.asp
The interesting section here is,
The problem with components sending events to BAM asynchronously is that the
asynchronous event data may be processed out-of-order, thus resulting in
conclusions like “150% of the Purchase Orders are Delivered” - just because
the “Delivered” data happens to be processed 1 second before the
“Received”.
Does it mean, BAM gurantees sequencing? It so confusing.
--
Pandit
"Pandit" wrote:
> I have a question which I'm not able to find any explanation for this.
>
> The question is does "BAM gurantee sequencing of BAM events fired
> asynchronously to a BAM Activity"?
>
> For ex:- let'z assume I have a field called as "Status" in a BAM Activity
> "PurchaseOrder". This status gets updated as various points are hit in an
> Orchestration.
>
> When the Orchestration starts, the "Status" column is updated to have a
> value "Initiated".
> When the Orchestration sends out a request to an external system its status
> is now "Sent request and waiting for response"
> When it gets a response from the external system the status is updated to
> reflect "Got response"
> when the Orchestration is about to complete it's status is updated to
> reflect "Completed".
>
> So basically when the orchestration completes, I expect to see status
> "Completed" in BAM against column "Status" and not any other status. Does
> BAM gurantee this?
>
>
> --
> Pandit
| |
| Eric Stott 2006-05-10, 1:15 pm |
| If you are using BufferedEventStream, it does not guarantee sequencing, as
the BAM messages are sent to the message box and it is processed in a FIFO
(First In Fastest Out).
If you absolutely need sequencing, you will want to use DirectEventStream,
where the messages are placed directly into the BAMPrimaryImport database.
Here are the benefits/drawbacks of using the DirectEventStream:
1. You send the BAM messages into the BAMPrimaryImport database
2. All logic for ensuring that the BAM message is written successfully to
the BAMPrimaryImport database must be handled in the orchestration, instead
of letting BizTalk do it.
To learn more about these two methods, this blog has assisted me greatly:
http://blogs.msdn.com/keithlim/default.aspx
Eric
http://stottcreations.com/blog
"Pandit" <Pandit@discussions.microsoft.com> wrote in message
news:CD23755A-8F40-4635-9D39-B6C31F79E1F5@microsoft.com...[vbcol=seagreen]
> Further, I read something about this here.
> http://msdn.microsoft.com/library/d...uationtopic.asp
>
> The interesting section here is,
>
> The problem with components sending events to BAM asynchronously is that
> the
> asynchronous event data may be processed out-of-order, thus resulting in
> conclusions like "150% of the Purchase Orders are Delivered" - just
> because
> the "Delivered" data happens to be processed 1 second before the
> "Received".
>
>
> Does it mean, BAM gurantees sequencing? It so confusing.
>
> --
> Pandit
>
>
> "Pandit" wrote:
>
| |
| A b h i j e e t 2006-05-11, 7:15 am |
| Hi Eric,
I believe sequencing can be achieved in BufferedEventStream also, by
implementing EnableContinuations.
EnableContinuation evolves to avoid out-of-order processing of asynchronous
event data.
Actually, while doing a POC on same we realized that if you didn’t able to
maintain or loose “continuationToken” then all the subsequent events will not
be tracked. These events can be viewed pending in “Continuation” table.
ContinuationToken maintains the chaining or ordering of BAM events.
Abhijeet
http://geekswithblogs.net/abhijeet
"Eric Stott" wrote:
> If you are using BufferedEventStream, it does not guarantee sequencing, as
> the BAM messages are sent to the message box and it is processed in a FIFO
> (First In Fastest Out).
> If you absolutely need sequencing, you will want to use DirectEventStream,
> where the messages are placed directly into the BAMPrimaryImport database.
> Here are the benefits/drawbacks of using the DirectEventStream:
> 1. You send the BAM messages into the BAMPrimaryImport database
> 2. All logic for ensuring that the BAM message is written successfully to
> the BAMPrimaryImport database must be handled in the orchestration, instead
> of letting BizTalk do it.
>
> To learn more about these two methods, this blog has assisted me greatly:
> http://blogs.msdn.com/keithlim/default.aspx
>
> Eric
> http://stottcreations.com/blog
>
> "Pandit" <Pandit@discussions.microsoft.com> wrote in message
> news:CD23755A-8F40-4635-9D39-B6C31F79E1F5@microsoft.com...
>
>
>
| |
| Keith Lim 2006-05-12, 1:16 am |
| Hi all,
Frankly speaking, if you were to update the same column using
BufferedEventStream, there is no guarantee that the actual order of the
events occur being preserved, even with Continuation. Continuation simply
ensures that the various applications/processes that contribute data to a
particular activity instance have a chance to do so but it DOES not
guarantee the sequence due to internal merging, especially if the events
occur very closely together, (milliseconds). If your event occurs minutes
apart, there would be no problem and that is the case in most real world
scenario.
So, if you only have one orchestration contributing to the activity
instance, you don't need continuation. Let me know if this clarify
things.
Thanks,
Keith Lim [MSFT]
My BizTalk BAM Blog: http://blogs.msdn.com/keithlim/default.aspx
--------------------[vbcol=seagreen]
<Abhijeet@discussions.microsoft.com>[vbcol=seagreen]
<CD23755A-8F40-4635-9D39-B6C31F79E1F5@microsoft.com>
<#iskkREdGHA.4532@TK2MSFTNGP02.phx.gbl>[vbcol=seagreen]
asynchronous[vbcol=seagreen]
to[vbcol=seagreen]
will not[vbcol=seagreen]
table.[vbcol=seagreen]
as[vbcol=seagreen]
FIFO[vbcol=seagreen]
DirectEventStream,[vbcol=seagreen]
database.[vbcol=seagreen]
to[vbcol=seagreen]
instead[vbcol=seagreen]
greatly:[vbcol=seagreen]
http://msdn.microsoft.com/library/d...-us/sdk/htm/frl
rfmicrosoftbiztalkbameventobservationeve
ntstreamclassenablecontinuationtopic
.asp[vbcol=seagreen]
that[vbcol=seagreen]
in[vbcol=seagreen]
just[vbcol=seagreen]
this.[vbcol=seagreen]
in[vbcol=seagreen]
have a[vbcol=seagreen]
updated to[vbcol=seagreen]
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
| |
| A b h i j e e t 2006-05-12, 1:16 am |
| Hi All,
How can we handle following scenario?
In the same orchestration we have fired three events
1. Begin Activity
2. Track “data1”
3. Track “data related to data1”
4. End Activity
If above events are fired in 1,2,4,3 sequence i.e. out-of-order then
activity will close before tracking data in 3. We will loose 3 for that
particular activity.
I thought that EnableContinuation are meant to handle above scenarios.
--
Any Ideas???
Abhijeet
"Keith Lim (MSFT)" wrote:
> Hi all,
>
> Frankly speaking, if you were to update the same column using
> BufferedEventStream, there is no guarantee that the actual order of the
> events occur being preserved, even with Continuation. Continuation simply
> ensures that the various applications/processes that contribute data to a
> particular activity instance have a chance to do so but it DOES not
> guarantee the sequence due to internal merging, especially if the events
> occur very closely together, (milliseconds). If your event occurs minutes
> apart, there would be no problem and that is the case in most real world
> scenario.
>
> So, if you only have one orchestration contributing to the activity
> instance, you don't need continuation. Let me know if this clarify
> things.
>
> Thanks,
> Keith Lim [MSFT]
> My BizTalk BAM Blog: http://blogs.msdn.com/keithlim/default.aspx
>
> --------------------
> <Abhijeet@discussions.microsoft.com>
> <CD23755A-8F40-4635-9D39-B6C31F79E1F5@microsoft.com>
> <#iskkREdGHA.4532@TK2MSFTNGP02.phx.gbl>
> asynchronous
> to
> will not
> table.
> as
> FIFO
> DirectEventStream,
> database.
> to
> instead
> greatly:
> http://msdn.microsoft.com/library/d...-us/sdk/htm/frl
> rfmicrosoftbiztalkbameventobservationeve
ntstreamclassenablecontinuationtopic
> .asp
> that
> in
> just
> this.
> in
> have a
> updated to
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
>
> Note: For the benefit of the community-at-large, all responses to this
> message are best directed to the newsgroup/thread from which they
> originated.
>
>
| |
| Keith Lim 2006-05-15, 1:14 pm |
| Hi Abhijeet,
Please rephrase items 2 and 3, the text does not seem to be displaying
correctly.
Anyway, if it is in the same orchestration instance (process), you don't
need continuation. You would know exactly how the data flows, You will
need to ensure that in the sequence of call, EndActivity is called last.
Continuation is meant for scenario where many applications/processes are
contributing to the same activity instance. E.g. Activity A contains col1,
col2, col3 which get value from Process1, Process2, Process3 respectively;
Process1 could be a pipeline, process2 could be an orchestration and
process3 could be a stand alone application.
Psuedo code for the above scenarion would include:
Process1:
BA ActivityA, "A100"
UA ActivityA, "A100" Col1 = 5
EC ActiivtyA "A100" "Process2A100"
EA ActivityA "A100"
Process2:
UA ActivityA, "Process2A100", Col2 = 10
EC ActivityA, "Process2A100", Process3A100"
EA AcitivytA, "Process2A100"
Process3:
UA ActiivityA, "Process3A100", Col3 = 15
EA ActivityA, "Process3A100"
where BA = BeginActivity, UA = UpdateActivity, EC = EnableContinuation, EA
= EndActivity
In the above scenario, you would notice that Process2 and Process3 do not
have BeginActivity because their events are to be merged back to the main
continuation segment (in process1 A100). The IDs used :"Process2A100" and
"Process3A100" are known as token ID's and exist only temporaly. Once they
are merged they will not be in the table. Also, notice that becuase they
do not have BeginActivity, they are NOT visible from the Portal (indicated
by the IsVisible column in the BAM_ActivityA_Active table.).
The second kind of relationship is where an instance of an activity relates
to another instance of a separete activity. E.g In ActiivtyA, the instance
A100 related to two instances of ActivityB: B150, B160. These are done via
the AddRelatedActivity or AddReference methods. See my blog and online do
for more details.
Feel free to post additional questions if this does not solve your issue.
Thanks,
Keith Lim [MSFT]
--------------------[vbcol=seagreen]
<Abhijeet@discussions.microsoft.com>[vbcol=seagreen]
<CD23755A-8F40-4635-9D39-B6C31F79E1F5@microsoft.com>
<#iskkREdGHA.4532@TK2MSFTNGP02.phx.gbl>
<23EBB079-1E6A-40D7-B3C7-0184C3B63AD8@microsoft.com>
<APseB4VdGHA.188@TK2MSFTNGXA01.phx.gbl>[vbcol=seagreen]
simply[vbcol=seagreen]
a[vbcol=seagreen]
events[vbcol=seagreen]
minutes[vbcol=seagreen]
world[vbcol=seagreen]
microsoft.public.biztalk.orchestration:14464[vbcol=seagreen]
also, by[vbcol=seagreen]
didn’t able[vbcol=seagreen]
subsequent events[vbcol=seagreen]
“Continuationâ€[vbcol=seagree
n]
sequencing,[vbcol=seagreen]
a[vbcol=seagreen]
successfully[vbcol=seagreen]
http://msdn.microsoft.com/library/d...-us/sdk/htm/frl[vbcol=seagreen]
rfmicrosoftbiztalkbameventobservationeve
ntstreamclassenablecontinuationtopic[vbc
ol=seagreen]
is[vbcol=seagreen]
resulting[vbcol=seagreen]
DeliveredÂ" -[vbcol=seagreen]
before the[vbcol=seagreen]
BAM[vbcol=seagreen]
hit[vbcol=seagreen]
its[vbcol=seagreen]
updated to[vbcol=seagreen]
status[vbcol=seagreen]
status.[vbcol=seagreen]
rights.[vbcol=seagreen]
Thanks,
Keith Lim [MSFT]
My BizTalk BAM Blog: http://blogs.msdn.com/keithlim/default.aspx
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
|
|
|
|
|