Consume Subscription Vs. Durable Subscription

Let us think our BPD & Human Service as shown in below diagram
Durable Subscription
Scenario 1: If we run bpd, the flow waits at MIE1 & MIE2,  after execute Human Service both MIE1 & MIE2 will trigger and Instance will be completed successfully.
Scenario 2: Check Durable Subscription option for MIE1 and Uncheck Durable Subscription option for MIE2.
Before bpd execution run fireMyUCA1 human service. Go to inspector  view,Flow only waits at MIE2 only because MIE1 automatically fires because Durable Subscription option was checked .If you want fire MIE2 again you have to run fireMyUCA1 human  service.

Observations:-We are checked Durable Subscription option for MIE1 means .If any of event fired(Which related MIE1) before flow reached MIE1 .That event persisted and Once our flow come into active it will be fired .

“What if the event that would trigger the listener occurs before the listener is reached? This is where the concept of the Durable Subscription comes into play. If this flag is checked, then the arrival of an event before the listener is reached is remembered and when the process reaches the Intermediate Message Event, it is immediately notified that the solution can continue. If this flag is not checked, then the event that arrived previously is discarded and the process will wait for a further event.”

Consume subscription

"Consume" means when an intermediate listener in a given Business Process instance correlates to a message, should it mark that message so that it will not be used by any other event listeners in that instance that are listening for the same event. It is very important to note that this is a per instance flag. The value on this flag has no between 2 listeners in separate BPD instances. If a message is consumed, then the next time a listener begins listening it will only react to events that have not been consumed for this Business Process Instance.

Create two BPDs:

  • Create Human Service which will fire MYUCA1.Run service
  • Then Two instances were created (BPD1,BPD2).
  • Coming to BPD1 flow, instance   will wait at MIE step because ,StartMessageEvent was consumed the message .So MIE is waiting for another Message.(If you observe the BPD1 Instance status is in Active state).
  • coming to BPD2 flow  won’t wait it fires both events(MSE,MIE).(If you observe the BPD2 Instance status is complete )

I hope this post helps you. So far this is my best effort to explain. Please correct me if I do anything wrong.

Leave a Reply

Your email address will not be published. Required fields are marked *