Created
November 3, 2020 11:34
-
-
Save fatihdumanli/8c403f1b864f923f583a54901e349a54 to your computer and use it in GitHub Desktop.
Publishing a command to rabbitmq server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void BasicPublish(ICommand command, string destination) | |
{ | |
using (var channel = connection.CreateModel()) | |
{ | |
channel.ExchangeDeclare(COMMAND_EXCHANGE_NAME, type: ExchangeType.Direct); | |
channel.BasicPublish(exchange: COMMAND_EXCHANGE_NAME, routingKey: destination, basicProperties: null, body: command.ToJson().ToByteArray()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment