15458 [16] ERROR MassTransit.Pipeline.Filters.RescueReceiveContextFilter<MassTransit.ReceiveContext> (null) - Rescuing exceptionAutomatonymous.NotAcceptedStateMachineException: Loyalty.Core.Redemption.RedemptionState(984dfacd-9784-4ba1-aa03-a14f263895a7) 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.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.<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<TMessage>>-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<TMessage>>-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() 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);
--
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.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
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.
--
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/35d76ad4-fb2c-4450-baef-6c8054c44878%40googlegroups.com.
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; }
}
--
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/e6fda921-f332-4f60-9b5f-2926c3f29509%40googlegroups.com.
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 view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/CAHX4WYfELDasARPo2BHqN5u-T5DDL-cEtbjvfwx3gEk6BByGbg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/EC86F905-DF2A-4CE7-9942-736F13202E08%40gmail.com.
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;
}
}
}
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();
});
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();
});
--
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/926568ea-b92d-4c31-9fff-08ec7a6e7550%40googlegroups.com.
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/b2e1798f-7deb-4f3c-9332-3aa1fcd168e4%40googlegroups.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-discuss+unsub...@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.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/e6592871-5703-4a9a-8e9e-0d0769be6871%40googlegroups.com.
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/c6b56e5b-299a-42aa-9b2e-78e0f9aafd3f%40googlegroups.com.
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/5907b201-6acb-4aeb-81d8-c9d940d85d60%40googlegroups.com.
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 unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/558705f7-cb53-46c2-b47a-aef5d8953bb6%40googlegroups.com.
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.
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.