SagaSpecification throwing duplicate key exception

14 views
Skip to first unread message

Sadprofessor

unread,
Jan 30, 2018, 7:02:08 AM1/30/18
to masstransit-discuss
Hey,

So in my upgrade to 4.0.1 I've got all my sagas working except one, which on registration is causing the SagaSpecification ctor to throw with a duplicate key on this

   _messageTypes = messageSpecifications.ToDictionary(x => x.MessageType);

What should I be looking for in the saga? I can't see any obvious duplicate event declarations etc.

Cheers

Chris Patterson

unread,
Jan 30, 2018, 11:43:51 AM1/30/18
to masstrans...@googlegroups.com
The Gitter room is a quicker response, but...

Are you certain that you have each message only configured once within the saga? Is it a state machine saga, or normal one?

If you have the same message type multiple times in Event<T> statements, you'll get this error. I should make it a better error too.


--
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/78d24b26-8b2d-4cd7-94b9-b30dba842514%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sadprofessor

unread,
Jan 30, 2018, 12:06:05 PM1/30/18
to masstransit-discuss
Nice I'll move to gitter in future.

Yeah so I found it, it was due to a duplicate Schedule. We often reuse the same 'Timeout' message, but we'll switch to having more context-specific timeout messages.

I still don't know why the DuplicateKeyException just doesn't tell you what the duplicate was. That's the biggest annoyance in my life right now

Thanks for the help


On Tuesday, 30 January 2018 16:43:51 UTC, Chris Patterson wrote:
The Gitter room is a quicker response, but...

Are you certain that you have each message only configured once within the saga? Is it a state machine saga, or normal one?

If you have the same message type multiple times in Event<T> statements, you'll get this error. I should make it a better error too.

On Tue, Jan 30, 2018 at 4:02 AM, Sadprofessor <thomas...@gmail.com> wrote:
Hey,

So in my upgrade to 4.0.1 I've got all my sagas working except one, which on registration is causing the SagaSpecification ctor to throw with a duplicate key on this

   _messageTypes = messageSpecifications.ToDictionary(x => x.MessageType);

What should I be looking for in the saga? I can't see any obvious duplicate event declarations etc.

Cheers

--
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