Configuration error with Saga

489 views
Skip to first unread message

Symon Rottem

unread,
Jul 6, 2011, 9:22:48 AM7/6/11
to masstrans...@googlegroups.com
I'm getting an error while trying to set up my first saga and I'm not sure I understand what the error is saying.

The saga is a state machine which begins as follows:

Define(() =>
{
Initially(
When(Start)
.Then((saga, message) => saga.Initialize(message))

...

There's a state defined...

public static State Initial { get; set; }

..and an event...

public static Event<StartJob> Start { get; set; }

...and the corresponding method...

public void Initialize(StartJob message)
{
}

..so I would have thought everything was OK.  The exception thrown is:


MassTransit.Exceptions.ConfigurationException
Failed to create the saga connector for Agent.JobSaga
   at MassTransit.Saga.SubscriptionConnectors.SagaConnector`1..ctor(ISagaRepository`1 sagaRepository) in d:\Home\MassTransit\src\MassTransit\Saga\SubscriptionConnectors\SagaConnector.cs:line 57
   at MassTransit.SagaSubscriptionConfiguratorExtensions.SubscribeSaga[T](IServiceBus bus, ISagaRepository`1 sagaRepository) in d:\Home\MassTransit\src\MassTransit\Saga\Configuration\SagaSubscriptionConfiguratorExtensions.cs:line 55
   at Agent.JobProcessingService.Start() in E:\Source\JobProcessingService.cs:line 31
   at Agent.Program.<>c__DisplayClass8.<Main>b__6(JobProcessingService o) in E:\Source\Program.cs:line 74
   at Topshelf.Builders.LocalServiceBuilder`1.StartService(T service) in d:\BuildAgent-01\work\799c08e77fef999d\src\Topshelf\Config\Builders\LocalServiceBuilder.cs:line 65
HelpLink: 

System.NotSupportedException
No method to connect to event was found for Messages.StartJob
   at MassTransit.Saga.SubscriptionConnectors.SagaEventConnectorFactory`2.<Create>d__0.MoveNext() in d:\Home\MassTransit\src\MassTransit\Saga\SubscriptionConnectors\SagaEventConnectorFactory.cs:line 66
   at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
   at System.Linq.Enumerable.<ConcatIterator>d__71`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at MassTransit.Saga.SubscriptionConnectors.SagaConnector`1..ctor(ISagaRepository`1 sagaRepository) in d:\Home\MassTransit\src\MassTransit\Saga\SubscriptionConnectors\SagaConnector.cs:line 48
HelpLink: 

Does anyone have any clues for me?

Cheers,

Symon Rottem

unread,
Jul 6, 2011, 10:34:44 AM7/6/11
to masstransit-discuss
Never mind; this was a DUH moment. I forgot to add the
CorrelatedBy<Guid> interface to the start message. Couldn't see the
forest for the trees.

*sigh*

Symon.

On Jul 6, 3:22 pm, Symon Rottem <s.rot...@gmail.com> wrote:
> I'm getting an error while trying to set up my first saga and I'm not sure I
> understand what the error is saying.
>
> The saga is a state machine which begins as follows:
>
> Define(() =>
> {
> Initially(
> When(Start)
> .Then((saga, message) => saga.Initialize(message))
>
> ...
>
> There's a state defined...
>
> public static State Initial { get; set; }
>
> ..and an event...
>
> public static Event<StartJob> Start { get; set; }
>
> ...and the corresponding method...
>
> public void Initialize(StartJob message)
> {
>
> }
>
> ..so I would have thought everything was OK.  The exception thrown is:
>
> MassTransit.Exceptions.ConfigurationException
> *Failed to create the saga connector for Agent.JobSaga*
>    at
> MassTransit.Saga.SubscriptionConnectors.SagaConnector`1..ctor(ISagaReposito ry`1
> sagaRepository) in
> d:\Home\MassTransit\src\MassTransit\Saga\SubscriptionConnectors\SagaConnect or.cs:line
> 57
>    at
> MassTransit.SagaSubscriptionConfiguratorExtensions.SubscribeSaga[T](IServic eBus
> bus, ISagaRepository`1 sagaRepository) in
> d:\Home\MassTransit\src\MassTransit\Saga\Configuration\SagaSubscriptionConf iguratorExtensions.cs:line
> 55
>    at Agent.JobProcessingService.Start() in
> E:\Source\JobProcessingService.cs:line 31
>    at Agent.Program.<>c__DisplayClass8.<Main>b__6(JobProcessingService o) in
> E:\Source\Program.cs:line 74
>    at Topshelf.Builders.LocalServiceBuilder`1.StartService(T service) in
> d:\BuildAgent-01\work\799c08e77fef999d\src\Topshelf\Config\Builders\LocalSe rviceBuilder.cs:line
> 65
> HelpLink:
>
> System.NotSupportedException
> *No method to connect to event was found for Messages.StartJob*
>    at
> MassTransit.Saga.SubscriptionConnectors.SagaEventConnectorFactory`2.<Create >d__0.MoveNext()
> in
> d:\Home\MassTransit\src\MassTransit\Saga\SubscriptionConnectors\SagaEventCo nnectorFactory.cs:line
> 66
>    at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
>    at System.Linq.Enumerable.<ConcatIterator>d__71`1.MoveNext()
>    at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
>    at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
>    at
> MassTransit.Saga.SubscriptionConnectors.SagaConnector`1..ctor(ISagaReposito ry`1
> sagaRepository) in
> d:\Home\MassTransit\src\MassTransit\Saga\SubscriptionConnectors\SagaConnect or.cs:line

Chris Patterson

unread,
Jul 6, 2011, 1:12:45 PM7/6/11
to masstrans...@googlegroups.com
yeah, the exceptions are pretty noisy, we should add a precondition check to the message type and throw a better exception in that case...


--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To post to this group, send email to masstrans...@googlegroups.com.
To unsubscribe from this group, send email to masstransit-dis...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/masstransit-discuss?hl=en.


Reply all
Reply to author
Forward
0 new messages