Send endpoints

77 views
Skip to first unread message

Giga Matica

unread,
Dec 4, 2020, 2:17:10 PM12/4/20
to masstransit-discuss
Howdy, for send endpoints, how can I designate a specific serializer?

For receive endpoint is pretty easy.

 cfg.ReceiveEndpoint(queue, x =>
                    {
                        x.ClearMessageDeserializers();
                        x.UseRawCustomSerializer();
                        x.Consumer<MyMessageConsumer>(provider);
                    }

Thanks

Chris Patterson

unread,
Dec 4, 2020, 2:29:53 PM12/4/20
to masstrans...@googlegroups.com
The built-in serializers have their own extension methods (such as UseJsonSerializer()), you can look at those to create your own extension method (or equally configure the receive endpoint).



--
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 view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/9e663c62-0baf-452a-bdc6-b7c61ad79d1bn%40googlegroups.com.

Giga Matica

unread,
Dec 4, 2020, 2:50:40 PM12/4/20
to masstransit-discuss
Thanks for your quick response,

Those allow to specify for the entire Bus or ReceiveEndpoints, I was wondering how to do it just for specific Send endpoints.

Maybe Im confused.

Thanks

Chris Patterson

unread,
Dec 4, 2020, 5:14:46 PM12/4/20
to masstrans...@googlegroups.com
Something like this might work:

configurator.ConfigureSend(x => x.UseExecute(e =>
{
if(e.DestinationAddress == new Uri("some:address"))
{
e.Serializer = new JsonMessageSerializer();
}
}));


Giga Matica

unread,
Dec 7, 2020, 9:11:27 AM12/7/20
to masstransit-discuss
Thank you a lot.
Reply all
Reply to author
Forward
0 new messages