Question

Does anyone know if two applications can communicate to each other via MassTransit.RuntimeServices using the Binary Serializer?

As soon as I configured my bus to use the Binary Serializer, the application times-out after invoking UseSubscriptionService() method. When I look at the output of MassTransit.RuntimeServices process, I see an except was thrown:

System.Runtime.Serialization.SerializationException: Failed to deserialize message

Does MassTransit.RuntimeServices need to access the content of the message (and therefore, to deserialize it) in order to perform the routing?

Here are the code snippets where I configure them:

Application 1

Bus.Initialize(sbc =>
                {
                    sbc.UseMsmq();
                    sbc.UseBinarySerializer();
                    sbc.VerifyMsmqConfiguration();
                    sbc.UseMulticastSubscriptionClient();
                    sbc.ReceiveFrom("msmq://localhost/EGQueue");
                    sbc.UseSubscriptionService("msmq://localhost/mt_subscriptions");
                });

Application 2

Bus.Initialize(sbc =>
        {
            sbc.UseMsmq();
            sbc.UseBinarySerializer();
            sbc.VerifyMsmqConfiguration();
            sbc.UseMulticastSubscriptionClient();
            sbc.ReceiveFrom("msmq://localhost/M3AgentQueue");
            sbc.Subscribe(c => c.LoadFrom(Container));
            sbc.UseSubscriptionService("msmq://localhost/mt_subscriptions");
        });
Was it helpful?

Solution

You need to compile your own version of the Runtime Services that uses the binary serializer. That's the only change you need, but the Serializer needs to match everywhere.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top