I think I'm missing something. What are you expecting the behavior to be?
Are you concerned about the discarded message of endforcefully when the saga
has already been completed? Also, I know this is just a sample, but were you
demonstrating with bus.Send(new endnormally()) that which the scenario is
occurring? As you stated this would end up immediately completing the
saga. Or if you're saying that the delayed message never properly gets
consumed in its appropriate sagas? If so, are you using the CorrelationId?

What you're describing with a delayed message is what I would expect to use
for things that have time considerations (most sagas do).

On Thu, Mar 10, 2011 at 7:42 AM, Jason Meckley <[email protected]>wrote:

> I have a saga that can end one of two ways.
> 1. normally: that is the saga behaves as it's suppose to and notify the
> user
> 2. forced: if the saga is not completed in 30 minutes. complete the saga
> anyway.
>
> class mysaga
>    : isaga<state>
>    , initiatedby<start>
>    , orchestrates<endnormally>
>    , orchestrates<endforcefully>
> {
>     void consume(start message)
>     {
>           var delay = datetime.now.addminutes(30);
>           bus.DelaySend(delay, new endforcefully());
>           bus.Send(new endnormally());
>     }
>
>     void consume(endnormally message)
>     {
>           notifyuserthesagaiscomplete();
>           IsComplete = true;
>     }
>
>     void consume(endforcefully message)
>     {
>           warn("ended forcefully");
>           IsComplete = true;
>     }
> }
>
> I'm am receiving errors "Got message endforcefully, but had no consumers
> for it". Which makes sense because the saga was deleted from storage upon
> completion. I thought this type of setup was common to ensure sagas
> completed though? similar to the process of confirming a user signed up for
> an account (and not a bot). What would be a better approach to forcing the
> completion of a saga?
>
> I am using PHT to store the sagas.
>
> i could configure a timer to delete entries in the PHT that are older than
> 30 minutes. but then I have to
> 1. store the id somewhere to retrieve the saga
> 2. somehow know the saga is more than 30 minutes old. I could do that by
> storing a value in the saga state, but that seems like hack.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Rhino Tools Dev" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rhino-tools-dev?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino Tools Dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rhino-tools-dev?hl=en.

Reply via email to