During(Active,
When(RecordPersisted)
.Then(context => {
Log.Debug("RecordPersisted");
})
.Catch<MongoDbConcurrencyException>(ex => ex
.Then(c => {
Log.Warn("MongoDbConcurrencyException occurred"); //this is never shown
}))
.TransitionTo(Persisted) //exception happens on persisting this state
)x.ReceiveEndpoint(host, queue, ep => {
ep.UseInMemoryOutbox();
ep.LoadFrom(context);
ep.LoadStateMachineSagas(context);
// how to UsePartitioner here?
});ep.UseRetry(p => {
p.Immediate(0);
p.Handle<MongoDbConcurrencyException>();
});--
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/x9Wt3KUoRZE/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.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/e9705406-04af-4316-8868-bc621e261e7c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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/x9Wt3KUoRZE/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.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/b1fe503f-38a1-4517-af47-e69355c756c1%40googlegroups.com.
ep.UseRetry(p => {
p.Immediate(0);
p.Handle<MongoDbConcurrencyException>();
});
ep.UseInMemoryOutbox();
ep.LoadFrom(context);
ep.LoadStateMachineSagas(context);
var partitioner = ep.CreatePartitioner(1);
var scope = context.Resolve<ILifetimeScope>();
var stateMachine = context.Resolve<TicketsStateMachine>();
ep.StateMachineSaga(stateMachine, scope, sc => {
sc.Message<TicketUpdated>(m => m.UsePartitioner(partitioner, kp => kp.Message.TicketId));
});--
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 masstransit-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/e065efbc-b79b-46d7-af74-abf4ce118324%40googlegroups.com.
--- SAGA: created: 283b5f4d-4178-4156-aeaa-2effda6cc0ef
--- SAGA: created: 283b5f4d-4178-4156-aeaa-2effda6cc0ef
--- SAGA: created: 283b5f4d-4178-4156-aeaa-2effda6cc0ef--- SAGA: created: 283b5f4d-4178-4156-aeaa-2effda6cc0ef
--- SAGA: already active (Active) for record: 283b5f4d-4178-4156-aeaa-2effda6cc0ef
--- SAGA: already active (Active) for record: 283b5f4d-4178-4156-aeaa-2effda6cc0ef
R-RETRY rabbitmq://localhost/test_queue N/A Unable to update saga. It may not have been found or may have been updated by another process
R-FAULT rabbitmq://localhost/test_queue N/A TestMT.RecordCreated TestMT.Program+RecordState(00:00:00.0771963) Unable to update saga. It may not have been found or may have been updated by another proces
--
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 masstransit-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/33a90a23-f7a0-4283-a9e0-aa92eb32cddf%40googlegroups.com.
Event(() => RecordCreated, x => x.CorrelateBy(s=>s.RecordId, context => context.Message.RecordId).SelectId(s => Guid.Parse(s.Message.RecordId)));Event(() => RecordCreated, x => x.CorrelateById(context => Guid.Parse(context.Message.RecordId)).SelectId(s => Guid.Parse(s.Message.RecordId)));var partitioner = ep.CreatePartitioner(1);
ep.StateMachineSaga(stateMachine, sagaRepository, sc => {
sc.Message<RecordCreated>(m => m.UsePartitioner(partitioner, k => k.Message.RecordId));
});
ep.UsePartitioner(1,
cc => {
if (cc.TryGetMessage(out ConsumeContext<RecordCreated> createSagaContext))
return Guid.Parse(createSagaContext.Message.RecordId);
return cc.CorrelationId ?? Guid.Empty;
});I have noticed in your gist that your guid is a string and you parse it to a guid. It kind of looks like you missed a parse but I'm not sure. Maybe you could simplify it and just pass a guid so you don't have any parsing.