Home > front end >  Is there a way to modify the MessageType in MassTransit?
Is there a way to modify the MessageType in MassTransit?

Time:09-16

I am interfacing to an existing Azure service bus application, that uses MassTransit to publish messages.

Due to not following the guidance here https://masstransit-project.com/usage/messages.html#message-names message types are badly named.

I know I can use [EntityName] to override the topic naming convention, but I want to also override the message type.

At the moment, I have to create message types as below:

namespace SillyName.Messages;
public interface MyBadMessageType {}

I would like to name my message classes like this:

namespace OtherSystem.Messages;
public interface IUpdateUserMessage {}

Is there a way to override the default naming convention of MassTransit?

CodePudding user response:

If you are referring to the messageType element in the JSON envelope, that value cannot be changed without changing the actual message type itself (namespace, class, assembly).

  • Related