MT-3 + Automatonymous-3 not Transitioning to Next State

571 views
Skip to first unread message

rmacdonaldsmith

unread,
Sep 28, 2015, 4:52:37 PM9/28/15
to masstransit-discuss
Hi,

I have a Automatonymous v3 state machine saga. It will progress though states as expected when i run it under unit tests.

But when I add some MassTransit operation (by that I mean using .Publish() or .Execute() or .Add(Activity<T> customActivity) that involves sending something on the bus, then i do not transition to the next state. The message that i want to send (using one of the above) is sent to and received and responded by the target agent. But the state machine will not progress. I get an exception (see below). Note that I cam receiving event messages in to my saga, and handling them. It is only when I want to transition that i get this problem, so I never reach the first state transition.

Am I doing something wrong here? Or is this something in the new MT3 / Automatonymous3 interaction?

Thanks!

15458 [16] ERROR MassTransit.Pipeline.Filters.RescueReceiveContextFilter<MassTransit.ReceiveContext> (null) - Rescuing e
xception
Automatonymous.NotAcceptedStateMachineException: Loyalty.Core.Redemption.RedemptionState(984dfacd-9784-4ba1-aa03-a14f263
895a7) Saga exception on receipt of Loyalty.Messages.Redemption.Events.FraudCheckOk: Not accepted in state InProgress
   at Automatonymous.Pipeline.StateMachineSagaMessageFilter`2.<Send>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at MassTransit.Saga.Policies.AnyExistingSagaPolicy`2.<MassTransit-Saga-ISagaPolicy<TSaga\,TMessage>-Existing>d__3.Mov
eNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at MassTransit.Saga.InMemorySagaRepository`1.<SendToInstance>d__9`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at MassTransit.Saga.InMemorySagaRepository`1.<MassTransit-Saga-ISagaRepository<TSaga>-SendQuery>d__8`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at MassTransit.Saga.Pipeline.Filters.QuerySagaFilter`2.<MassTransit-Pipeline-IFilter<MassTransit-ConsumeContext<TMess
age>>-Send>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at MassTransit.Saga.Pipeline.Filters.QuerySagaFilter`2.<MassTransit-Pipeline-IFilter<MassTransit-ConsumeContext<TMess
age>>-Send>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at MassTransit.Saga.Pipeline.Filters.CorrelationIdMessageFilter`1.<Send>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at MassTransit.Pipeline.Filters.TeeConsumeFilter`1.<>c__DisplayClass7_0.<<Send>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at MassTransit.Pipeline.Filters.TeeConsumeFilter`1.<Send>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at MassTransit.Pipeline.Filters.MessageConsumeFilter`1.<MassTransit-Pipeline-IFilter<MassTransit-ConsumeContext>-Send
>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at MassTransit.Pipeline.Filters.MessageConsumeFilter`1.<MassTransit-Pipeline-IFilter<MassTransit-ConsumeContext>-Send
>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at MassTransit.Pipeline.Filters.DeserializeFilter.<Send>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at MassTransit.Pipeline.Filters.RescueReceiveContextFilter`1.<MassTransit-Pipeline-IFilter<MassTransit-ReceiveContext
>-Send>d__5.MoveNext()




Here is some state machine code - note that i never enter the InProgress state:

          Initially(

               When(RedemptionStarted)

                   .Then(context =>

                       {

                           context.Instance.RedemptionId = context.Data.RedemptionId.ToString();

                           context.Instance.Gpid = context.Data.GPID;

                           context.Instance.GiftDetails = context.Data.Gift;

                       })

                   .Publish(context => new GetUserInfo(context.Instance.Gpid,

                                                       new Guid(context.Instance.RedemptionId))),

               //.Add(new SendGetUserInfoCommandActivity(_userServiceUri))


                When(GotUserInfo)

                   .Then(context => context.Instance.UserInfo = context.Data.User)

                   .Then(

                       context =>

                       Log.InfoFormat(

                           "Handled GotUserInfo. Current state [{0}], transitioning to [InProgress]. [{1}]", "GotUserInfo", context.Instance.RedemptionId))

                   //.Add(new SendFraudCheckCommand(_siftServiceUri))

                   .Publish(

                       context =>

                       new CheckRequestForFraud(context.Instance.Gpid, new Guid(context.Instance.RedemptionId),

                                                context.Instance.PointsToRedeem,

                                                context.Instance.UserInfo,

                                                context.Instance.GiftDetails))

                   .Then(context => context.)

                   .TransitionTo(InProgress)

               );


//WE NEVER ENTER THIS STATE

           During(InProgress,

                  When(FraudCheckPassed)

                       .Publish(context => new BeginPointsRedemption(context.Instance.Gpid, new Guid(context.Instance.RedemptionId),

                                                                 context.Instance.PointsToRedeem,

                                                                 context.Instance.GiftDetails))

                      //.Add(new SendReservePointsCommandActivity(_pointsVaultUri))

                      .TransitionTo(FraudCheckOk),


                   When(FraudCheckFailed)

                      .Then(

                          context =>

                          Log.InfoFormat("Failed fraudcheck for redemption [{0}] and GPID [{0}]",


                                          context.Instance.RedemptionId, context.Instance.Gpid))

                      .TransitionTo(FraudCheckBad)

                      .Finalize()

               );

//left out the later saga definition for brevity, but we dont reach this point anyway.

            State(() => InProgress);

            State(() => FraudCheckOk);

            State(() => FraudCheckBad);

            State(() => PointsReserved);

            State(() => PointsCheckFailed);

            State(() => GiftCardOrdered);


            Event(() => RedemptionStarted,

                x => x.CorrelateBy(state => state.RedemptionId, context => context.Message.RedemptionId.ToString())

                    .SelectId(context => context.Message.RedemptionId));

            

            Event(() => GotUserInfo,

                x => x.CorrelateBy(state => state.RedemptionId, context => context.Message.RedemptionId.ToString())

                    .SelectId(context => context.Message.RedemptionId));


            Event(() => FraudCheckPassed,

                x => x.CorrelateBy(state => state.RedemptionId, context => context.Message.RedemptionId.ToString())

                    .SelectId(context => context.Message.RedemptionId));


            Event(() => FraudCheckFailed);

            Event(() => PointsDebited);

            Event(() => InsufficientPoints);

Chris Patterson

unread,
Sep 28, 2015, 5:04:23 PM9/28/15
to masstrans...@googlegroups.com
This smells strongly like you aren't using serializable transactions in your saga repository. Check to make sure your isolation level is set when you create the repository. Otherwise, another event correlated to the same state machine may not find a valid instance due to transaction isolation.


--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/649133a5-bde9-449d-9bdb-57d53a6f55d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

rmacdonaldsmith

unread,
Sep 28, 2015, 5:29:44 PM9/28/15
to masstransit-discuss
Ah, i see. I am using the InMemorySagaRepository at the moment (this is a proof of concept, so I don't care about durability at this point). Do isolation level still apply?
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.

Chris Patterson

unread,
Sep 28, 2015, 5:40:51 PM9/28/15
to masstrans...@googlegroups.com
This reads strange to me: Saga exception on receipt of Loyalty.Messages.Redemption.Events.FraudCheckOk: Not accepted in state InProgress

What is that event and what interface does it implement? FraudCheckOk - I only see that declared as a state.

Also, there is no need to initialize State(() => ...) anymore, those are done automatically.


To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.

To post to this group, send email to masstrans...@googlegroups.com.

rmacdonaldsmith

unread,
Sep 28, 2015, 6:57:57 PM9/28/15
to masstransit-discuss
Here is the complete saga class:

public RedemptionProcessManager()

       {

           Initially(

               When(RedemptionStarted)

                   .Then(context =>

                       {

                           context.Instance.RedemptionId = context.Data.RedemptionId.ToString();

                           context.Instance.Gpid = context.Data.GPID;

                           context.Instance.GiftDetails = context.Data.Gift;

                       })

                   .Publish(context => new GetUserInfo(context.Instance.Gpid,

                                                       new Guid(context.Instance.RedemptionId))),

               //.Add(new SendGetUserInfoCommandActivity(_userServiceUri))

               When(GotUserInfo)

                   .Then(context => context.Instance.UserInfo = context.Data.User)

                   .Then(

                       context =>

                       Log.InfoFormat(

                           "Handled GotUserInfo. Current state [{0}], transitioning to [InProgress]. [{1}]", "GotUserInfo", context.Instance.RedemptionId))

                   //.Add(new SendFraudCheckCommand(_siftServiceUri))

                   .Publish(

                       context =>

                       new CheckRequestForFraud(context.Instance.Gpid, new Guid(context.Instance.RedemptionId),

                                                context.Instance.PointsToRedeem,

                                                context.Instance.UserInfo,

                                                context.Instance.GiftDetails))

                   .TransitionTo(InProgress)

               );


            During(InProgress,

                  When(FraudCheckPassed)

                       .Publish(context => new BeginPointsRedemption(context.Instance.Gpid, new Guid(context.Instance.RedemptionId),

                                                                 context.Instance.PointsToRedeem,

                                                                 context.Instance.GiftDetails))

                      //.Add(new SendReservePointsCommandActivity(_pointsVaultUri))

                      .TransitionTo(FraudCheckOk),


                   When(FraudCheckFailed)

                      .Then(

                          context =>

                          Log.InfoFormat("Failed fraudcheck for redemption [{0}] and GPID [{0}]",

                                         context.Instance.RedemptionId, context.Instance.Gpid))

                      .TransitionTo(FraudCheckBad)

                      .Finalize()

               );

           During(FraudCheckOk,

                  When(PointsDebited)

                      .Add(new SendOrderGiftCardCommandActivity(_giftServiceAddress))

                      .TransitionTo(GiftCardOrdered),

                  When(InsufficientPoints)

                      .Then(

                          context =>

                          Log.WarnFormat("User has insufficient points to redeem. RedemptionId [{0}], GPID [{0}]",

                                         context.Instance.RedemptionId, context.Instance.Gpid))

                      .Finalize()

               );


            InstanceState(x => x.CurrentState);


            Event(() => RedemptionStarted,

               x => x.CorrelateBy(state => state.RedemptionId, context => context.Message.RedemptionId.ToString())


                    .SelectId(context => context.Message.RedemptionId));

            Event(() => GotUserInfo,

               x => x.CorrelateBy(state => state.RedemptionId, context => context.Message.RedemptionId.ToString())

                   .SelectId(context => context.Message.RedemptionId));


            Event(() => FraudCheckPassed,

               x => x.CorrelateBy(state => state.RedemptionId, context => context.Message.RedemptionId.ToString())

                   .SelectId(context => context.Message.RedemptionId));


            Event(() => FraudCheckFailed);

           Event(() => PointsDebited);

           Event(() => InsufficientPoints);

       }


        public State InProgress { get; set; }

       public State FraudCheckOk { get; set; }

       public State FraudCheckBad { get; set; } //terminal state

       public State PointsReserved { get; set; }

       public State PointsCommited { get; set; }

       public State PointsCheckFailed { get; set; } //terminal state

       public State GiftCardOrdered { get; set; } //terminal state


        public Event<RedemptionStarted> RedemptionStarted { get; set; }

       public Event<UserInfoRetrieved> GotUserInfo { get; set; }

       public Event<FraudCheckOk> FraudCheckPassed { get; set; }

       public Event<FraudCheckBad> FraudCheckFailed { get; set; }

       public Event<NotEnoughPoints> InsufficientPoints { get; set; }

       public Event<PointsDebited> PointsDebited { get; set; }

       public Event<GiftOrdered> GiftCardOrderPlaced { get; set; }

   }


The FraudCheckOk message comes from an existing set of messages (I am trying to demonstrate another way of doing something (hopefully simpler!), so thought I would keep the messages the same for familiarity), but the hierarchy is something like this:

FraudCheckOk --> RedemptionEvent --> IEvent

Chris Patterson

unread,
Sep 28, 2015, 7:35:06 PM9/28/15
to masstrans...@googlegroups.com
So there is a case where if another thread tries to access the same saga with the 3.0.13 release, the in-memory saga repository is not actually matching the serializable transaction style. So I'll have an update for that later that unlocks the index once the saga is added.

Also, why do you have .ToString() in the CorrelateBy, is RedemptionId a string or a Guid? If it's a Guid, remove to ToString. Maybe post the instance class as well?



--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.

Robert Macdonald Smith

unread,
Sep 28, 2015, 7:59:28 PM9/28/15
to masstrans...@googlegroups.com
Groan; I figured out my problem. On my saga state class, I had the default constructor, but did not have the constructor that takes the correlationId, so it was never able to correlate the messages with my state instance. (I always tell people how a rubber duck can help!)

But: the .ToString() you spotted. I threw this together pretty quick, so I did not chase this around: if i defined the RedemptionId on the State class as a GUID I got some compile time error when defining the event correlation in the saga event definition, along the lines that what I was correlating on had to be a class (could not be a struct). 

            Event(() => RedemptionStarted,
                x => x.CorrelateBy(state => state.RedemptionId, context => context.Message.RedemptionId.ToString())
                    .SelectId(context => context.Message.RedemptionId));

The RedemptionId on the message is a GUID. So I had to make the RedemptionId on the state class a string to get around this. Hence, I am doing .ToString()  and in reverse new Guid(message.RedemptionId). Not pretty!

So, if you have any suggestions here, that would be great :)

Rob.

You received this message because you are subscribed to a topic in the Google Groups "masstransit-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/masstransit-discuss/ZUiSV1HWUyE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to masstransit-dis...@googlegroups.com.

To post to this group, send email to masstrans...@googlegroups.com.

Chris Patterson

unread,
Sep 28, 2015, 8:06:24 PM9/28/15
to masstrans...@googlegroups.com
Your state class should be able to have a Guid (in fact, I think it has to be Guid CorrelationId {get; set;}) and you can use that instead of RedemptionId (since they would be equivalent).

Then you can just CorrelateBy(context => context.Message.RedemptionId).SelectId(context => context.Message.RedemptionId);

The constructor does not matter as CorrelationId will be get;set; and initialized by MT for the state instance.

So a state instance would be something like:

class State 
{
  Guid CorrelationId {get;set;}
  string CurrentState {get;set;}
  string GiftDetails {get;set;}
  string GiftId {get;set;} // etc...
}

in this case, redemptionId would correlate with CorrelationId, which is the PK of the saga.



rmacdonaldsmith

unread,
Oct 15, 2015, 2:01:46 PM10/15/15
to masstransit-discuss
Hey Chris,

Sorry to resurrect this thread again - I have not had time to get back on this for a while.

So I have simplified my Saga and the messages, and I am still getting the error message that it cannot receive the message in the Initial state. Here is the code, can you see what I am missing here?:

using System;

using System.Globalization;

using Automatonymous;

using Automatonymous.Graphing;

using Messages;

using ProcessManager.Core.Activities;

namespace ProcessManager.Core

{

public class SampleState :

SagaStateMachineInstance

{

public Guid RedemptionId { get; set; }

public long Gpid { get; set; }

public string UsersEmailAddress { get; set; }

public int NumberOfPoints { get; set; }

public string PointsExchangeId { get; set; }

public Guid CorrelationId { get; set; }

public State CurrentState { get; set; }

}

public sealed class PointsProcessManager :

MassTransitStateMachine<SampleState>

{

private readonly Uri _pointsVaultUri = new Uri("rabbitmq://ci-rmq-01.qasql.opentable.com/Messages:Commands-ReservePoints?durable=false&autodelete=true");

public PointsProcessManager()

{

Initially(

When(ReceivedRequestForNewRedemption)

.Then(context =>

{

context.Instance.Gpid = context.Data.Gpid;

context.Instance.RedemptionId = context.Data.RedemptionId;

context.Instance.NumberOfPoints = context.Data.PointsToRedeem;

context.Instance.UsersEmailAddress = context.Data.UsersEmailAddress;

Log(string.Format("redemptionid: {0}", context.Instance.RedemptionId));

})

.Add(new SendReservePointsCommandActivity(_pointsVaultUri))

.TransitionTo(Started)

);

During(Started,

When(PointsReservedEvent)

.Then(context =>

{

Console.ForegroundColor = ConsoleColor.DarkYellow;

Console.WriteLine("Entered PointsReserved.");

})

.TransitionTo(Completed)

);

// Event(() => ReceivedRequestForNewRedemption);

// Event(() => PointsReservedEvent);

Event(() => ReceivedRequestForNewRedemption,

x => x.CorrelateById(context => context.Message.RedemptionId)

.SelectId(context => context.Message.RedemptionId));

Event(() => PointsReservedEvent,

x => x.CorrelateById(context => context.Message.RedemptionId)

.SelectId(context => context.Message.RedemptionId));

InstanceState(x => x.CurrentState);

}

public State Started { get; set; }

public State Completed { get; set; }

public Event<Events.RedemptionStarted> ReceivedRequestForNewRedemption { get; set; }

public Event<Events.PointsReserved> PointsReservedEvent { get; set; }

private static void Log(string logMessage)

{

var fColor = Console.ForegroundColor;

Console.ForegroundColor = ConsoleColor.DarkYellow;

Console.WriteLine(logMessage);

Console.ForegroundColor = fColor;

}

}

}


and the bus init code:

var bus = Bus.Factory.CreateUsingRabbitMq(configurator =>

{

var uriBuilder = new UriBuilder("rabbitmq", "ci-rmq-01.qasql.opentable.com");

var host = configurator.Host(uriBuilder.Uri, h =>

{

h.Username("guest");

h.Password("guest");

});

configurator.ReceiveEndpoint(host, "redemption_process_manager",

e =>

{

e.StateMachineSaga(new PointsProcessManager(), new InMemorySagaRepository<SampleState>());

});

configurator.ReceiveEndpoint(host, "redemption_service",

e =>

{

e.Consumer<ApplicationService>();

});

configurator.UseLog4Net();

});

Chris Patterson

unread,
Oct 15, 2015, 3:19:52 PM10/15/15
to masstrans...@googlegroups.com

On Thu, Oct 15, 2015 at 11:01 AM, 'rmacdonaldsmith' via masstransit-discuss <masstrans...@googlegroups.com> wrote:

var bus = Bus.Factory.CreateUsingRabbitMq(configurator =>

{

var uriBuilder = new UriBuilder("rabbitmq", "ci-rmq-01.qasql.opentable.com");

var host = configurator.Host(uriBuilder.Uri, h =>

{

h.Username("guest");

h.Password("guest");

});

configurator.ReceiveEndpoint(host, "redemption_process_manager",

e =>

{

e.StateMachineSaga(new PointsProcessManager(), new InMemorySagaRepository<SampleState>());

});

configurator.ReceiveEndpoint(host, "redemption_service",

e =>

{

e.Consumer<ApplicationService>();

});

configurator.UseLog4Net();

});


Can you post your message contracts as well? Or send them to me directly?

Chris Patterson

unread,
Oct 15, 2015, 3:33:05 PM10/15/15
to masstrans...@googlegroups.com
FYI, this gist: https://gist.github.com/phatboyg/56df1a314bf74e7acfee

Works for me, and writes out the message "redemption id: "

All I did was create interfaces for your messages and put them to work. Does this help point anything out?

rmacdonaldsmith

unread,
Oct 15, 2015, 5:19:58 PM10/15/15
to masstransit-discuss
Hi Chris,

Thanks for taking the time to look at this. here are my message contracts. I took a look at you gist. So what I am having trouble with seems to be message correlation with my saga. I seem to be able to create a saga instance; I can break in to the code and see that I execute the Initially block, and I can see that I send the corresponding command out from the SendReservePointsCommandActivity   . I have another process that receives that command and responds with an event. This event (PointsReserved) is going to be received by the 

public Event<Events.PointsReserved> PointsReservedEvent { get; set; } 

event in the saga. BUT: instead of the event arriving in the saga During the Started state, I get an exception:

Automatonymous.NotAcceptedStateMachineException: ProcessManager.Core.SampleState
(9a88ec42-3c21-46b4-ac12-6e14b6064fff) Saga exception on receipt of Messages.Events+PointsReserved: Not accepted in state Initial

I have logged out the correlationId (which is the redemptionId) earlier in the program and I can see that they match. But it looks like the saga can not correlate the incoming message to an instance of a Saga? (At least that is my guess). So I am thinking that I am not configuring things right?

Chris Patterson

unread,
Oct 15, 2015, 5:37:53 PM10/15/15
to masstrans...@googlegroups.com
Did you update to 3.0.14, which fixes the concurrency issue on the in-memory saga repository?


--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.

rmacdonaldsmith

unread,
Oct 15, 2015, 7:13:30 PM10/15/15
to masstransit-discuss
I am at 3.0.14 for all the MassTransit dependencies: MT, MT.Automatonymous, etc. I am at 3.0.6 for Automatonymous (which I think is the most recent.)

I have also tried using the CorrelatedBy<> interface in my message definitions (and removed the correlation function in the Event definitions) and got the same exception when trying to receive an event in any state other than Initial.

Chris Patterson

unread,
Oct 15, 2015, 7:39:28 PM10/15/15
to masstrans...@googlegroups.com
I hate to push for more but if I could get a complete reproducible case as a single file that I could build and run locally that would really help. I used your code and wasn't able to see the same issue so I'm not sure what could be different without having a complete example. 



__
Chris Patterson




On Thu, Oct 15, 2015 at 4:13 PM -0700, "'rmacdonaldsmith' via masstransit-discuss" <masstrans...@googlegroups.com> wrote:

I am at 3.0.14 for all the MassTransit dependencies: MT, MT.Automatonymous, etc. I am at 3.0.6 for Automatonymous (which I think is the most recent.)

I have also tried using the CorrelatedBy<> interface in my message definitions (and removed the correlation function in the Event definitions) and got the same exception when trying to receive an event in any state other than Initial.

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.

rmacdonaldsmith

unread,
Oct 15, 2015, 7:53:07 PM10/15/15
to masstransit-discuss
Hey, no problem, I understand where you are coming from. Let me try to get that together tonight.

Thanks again.

Rob.


On Thursday, October 15, 2015 at 4:39:28 PM UTC-7, Chris Patterson wrote:
I hate to push for more but if I could get a complete reproducible case as a single file that I could build and run locally that would really help. I used your code and wasn't able to see the same issue so I'm not sure what could be different without having a complete example. 



__
Chris Patterson




On Thu, Oct 15, 2015 at 4:13 PM -0700, "'rmacdonaldsmith' via masstransit-discuss" <masstrans...@googlegroups.com> wrote:

I am at 3.0.14 for all the MassTransit dependencies: MT, MT.Automatonymous, etc. I am at 3.0.6 for Automatonymous (which I think is the most recent.)

I have also tried using the CorrelatedBy<> interface in my message definitions (and removed the correlation function in the Event definitions) and got the same exception when trying to receive an event in any state other than Initial.

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.

rmacdonaldsmith

unread,
Oct 19, 2015, 1:24:03 PM10/19/15
to masstransit-discuss
Hi Chris,

Sorry for the delay; I was working from home Friday and left the code on my work machine in the office. So, I created a repo with the code I am running. You just need to run these 2 projects; ProcessManagerService and PointsVaultGateway. You should see the saga run and there should be an exception reported in the console of ProcessManagerService.


I hope this helps. Let me know if you have any trouble. I have tried to keep this pretty simple!

Thanks,

Rob.

rmacdonaldsmith

unread,
Oct 21, 2015, 2:21:17 PM10/21/15
to masstransit-discuss
Hey, don't want to be a squeaky wheel, and I understand that you offer your time for free (for which I am very grateful!) - just checking to make sure you did not miss this one. Its not urgent. Thanks again.

Chris Patterson

unread,
Oct 21, 2015, 2:30:12 PM10/21/15
to masstrans...@googlegroups.com
I'll check it closer later today, sorry for the Task.Delay().

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.

To post to this group, send email to masstrans...@googlegroups.com.

rmacdonaldsmith

unread,
Oct 28, 2015, 12:15:02 PM10/28/15
to masstransit-discuss
Monitor.Pulse();

Chris Patterson

unread,
Oct 28, 2015, 2:53:14 PM10/28/15
to masstrans...@googlegroups.com
Well played. Today, I should have some time later today. :)


On Wed, Oct 28, 2015 at 11:15 AM, 'rmacdonaldsmith' via masstransit-discuss <masstrans...@googlegroups.com> wrote:
Monitor.Pulse();

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.

rmacdonaldsmith

unread,
Nov 3, 2015, 12:24:20 PM11/3/15
to masstransit-discuss
Hey Chris, is there a chance you can get to this in the next couple days? If you are in the Financial District I can buy you a beer!

Chris Patterson

unread,
Nov 3, 2015, 1:52:48 PM11/3/15
to masstrans...@googlegroups.com
I will pull it down in a few minutes and take a look!


On Tue, Nov 3, 2015 at 9:24 AM, 'rmacdonaldsmith' via masstransit-discuss <masstrans...@googlegroups.com> wrote:
Hey Chris, is there a chance you can get to this in the next couple days? If you are in the Financial District I can buy you a beer!

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.

Chris Patterson

unread,
Nov 3, 2015, 2:58:48 PM11/3/15
to masstrans...@googlegroups.com
Issue submitted for your state machine activity on your GitHub repository. 


rmacdonaldsmith

unread,
Nov 3, 2015, 4:02:05 PM11/3/15
to masstransit-discuss
Chris, thanks for taking a look. And I am serious about buying you a beer if you are in SF some time!


On Tuesday, November 3, 2015 at 11:58:48 AM UTC-8, Chris Patterson wrote:
Issue submitted for your state machine activity on your GitHub repository. 


On Tue, Nov 3, 2015 at 10:52 AM, Chris Patterson <ch...@phatboyg.com> wrote:
I will pull it down in a few minutes and take a look!

On Tue, Nov 3, 2015 at 9:24 AM, 'rmacdonaldsmith' via masstransit-discuss <masstrans...@googlegroups.com> wrote:
Hey Chris, is there a chance you can get to this in the next couple days? If you are in the Financial District I can buy you a beer!

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.

To post to this group, send email to masstrans...@googlegroups.com.

Chris Patterson

unread,
Nov 3, 2015, 4:18:07 PM11/3/15
to masstrans...@googlegroups.com
And I am serious about taking you up on it!

__
Chris Patterson




To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.

To post to this group, send email to masstrans...@googlegroups.com.

rmacdonaldsmith

unread,
Nov 9, 2015, 1:20:36 PM11/9/15
to masstransit-discuss
Wanna DM me on Twitter and we can arrange something?

I am around this week, and at QCon next week (which is still in SF)


On Tuesday, November 3, 2015 at 1:18:07 PM UTC-8, Chris Patterson wrote:
And I am serious about taking you up on it!

__
Chris Patterson




On Tue, Nov 3, 2015 at 1:02 PM -0800, "'rmacdonaldsmith' via masstransit-discuss" <masstrans...@googlegroups.com> wrote:

Chris, thanks for taking a look. And I am serious about buying you a beer if you are in SF some time!

On Tuesday, November 3, 2015 at 11:58:48 AM UTC-8, Chris Patterson wrote:
Issue submitted for your state machine activity on your GitHub repository. 



On Tue, Nov 3, 2015 at 10:52 AM, Chris Patterson <ch...@phatboyg.com> wrote:
I will pull it down in a few minutes and take a look!


On Tue, Nov 3, 2015 at 9:24 AM, 'rmacdonaldsmith' via masstransit-discuss <masstrans...@googlegroups.com> wrote:
Hey Chris, is there a chance you can get to this in the next couple days? If you are in the Financial District I can buy you a beer!

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/5907b201-6acb-4aeb-81d8-c9d940d85d60%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages