Publishing custom event when routing slip completes

44 views
Skip to first unread message

Emir Ključanin

unread,
May 26, 2018, 8:06:19 AM5/26/18
to masstransit-discuss
Hi all,
I've already asked something similar on gitter and Chrish helped me to solve my problem, but this is something that could be useful.
With the current implementation of routing slip we can send events to the specific endpoints which is fine in most cases. But, for example, in my case, I have a routing slip for for creating a user (or business logic requires couple of activities in order for user to be created) and when routing slip is finished I want to publish UserCreatedEvent and this event is handled in 4-5 different consumers (send welcome email to the user, saga, send notification to the admin, etc). With current implementation I have to AddSubcription for all of these consumers endpoints, and it would be great if we could do something like:

await builder.AddSubscription(RoutingSlipEvents.Completed, context =>
        context.
Publish<AssignLicenceFailedEvent>(new
        {
            command.
UserPrincipalName,
            command.
Office365CustomerId,
            context.
CorrelationId
        }));

Is something like this possible or even does it makes sense?

Chris Patterson

unread,
May 27, 2018, 12:34:23 PM5/27/18
to masstrans...@googlegroups.com
You could enter this as an issue on GitHub, and I can try to figure something out for it.

--
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/40082c83-e2f4-405f-9aee-6be5ee1d5759%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Emir Ključanin

unread,
May 27, 2018, 12:50:10 PM5/27/18
to masstransit-discuss

https://github.com/MassTransit/MassTransit/issues/1128

Here it is :). I wasn't sure if this should be posted as an issue.

On Sunday, May 27, 2018 at 6:34:23 PM UTC+2, Chris Patterson wrote:
You could enter this as an issue on GitHub, and I can try to figure something out for it.
On Sat, May 26, 2018 at 7:06 AM, Emir Ključanin <emir.kl...@gmail.com> wrote:
Hi all,
I've already asked something similar on gitter and Chrish helped me to solve my problem, but this is something that could be useful.
With the current implementation of routing slip we can send events to the specific endpoints which is fine in most cases. But, for example, in my case, I have a routing slip for for creating a user (or business logic requires couple of activities in order for user to be created) and when routing slip is finished I want to publish UserCreatedEvent and this event is handled in 4-5 different consumers (send welcome email to the user, saga, send notification to the admin, etc). With current implementation I have to AddSubcription for all of these consumers endpoints, and it would be great if we could do something like:

await builder.AddSubscription(RoutingSlipEvents.Completed, context =>
        context.
Publish<AssignLicenceFailedEvent>(new
        {
            command.
UserPrincipalName,
            command.
Office365CustomerId,
            context.
CorrelationId
        }));

Is something like this possible or even does it makes sense?

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