Skip to content
This repository has been archived by the owner on Sep 19, 2022. It is now read-only.

Message serialization of connected transport (AzureServiceBusTransport) #1

Open
KatoStoelen opened this issue Feb 25, 2020 · 0 comments

Comments

@KatoStoelen
Copy link

I'm currently using this package in send-only endpoints to safely combine database write operations and message sending when using Azure Service Bus as transport. I do, however, struggle to configure the NewtonsoftSerializer. As per this sample, I have the following ConnectorConfiguration:

var connectorConfiguration = new ConnectorConfiguration<AzureServiceBusTransport>(
    "MyEndpoint",
    "[SQL_CONNECTION_STRING]",
    connectedTransport =>
    {
        connectedTransport.ConnectionString("AZURE_SERVICEBUS_CONNECTION_STRING");

        var transportSettings = connectedTransport.GetSettings();

        var serializer = Tuple.Create(
            new NServiceBus.NewtonsoftSerializer() as SerializationDefinition,
            new NServiceBus.Settings.SettingsHolder());

        transportSettings.Set("MainSerializer", serializer);
    });

But, messages sent to Azure Service Bus is serialized as XML. Is there anything wrong with the configuration?

In my receive endpoints I have now added the XML serializer as an additional deserializer, which works fine. It would, however, be nice if I could use the same serialization everywhere (JSON in this instance).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant