0

I have this code, which works well,

void Message(IMessage m)
{
    m.MyProperty = "Some Value";
}
await context.Publish<IMessage>(Message).ConfigureAwait(false);

I have a contract (IMessage) and create a constructor for an action that is to be published.

But I want to be able to create the action from a string. I.e. from this starting point,

var messageType = "IMessage";

I want to be able to send the same message as above.

This may not be the best way to do what I want to do, but it would be really interesting if it can be done.

Nick
  • 1
  • 2

1 Answers1

1

Seems like NServiceBus RAW might be a good fit for this. Not sure what you are up to but that allows you do define your own payload:

Ramon Smits
  • 2,482
  • 1
  • 18
  • 20
  • The messaging is working correctly. It's more a question about creating the messages dynamically from the contract interface. – Nick Jul 12 '18 at 10:54