I have created a small class for demonstration purpose that sends a message to rabbitmq on a specific port:
class RabbitMqPublisher
{
private IAdvancedBus _advancedBus;
public RabbitMqPublisher()
{
_advancedBus = RabbitHutch.CreateBus("host=rabbitmq-server:5672;virtualHost=/;username=user;password=pass").Advanced;
}
public void PublishMessage(string message)
{
var routingKey = "SimpleMessage";
// declare some objects
var queue = _advancedBus.QueueDeclare("TestQueue.SimpleMessage");
var exchange = _advancedBus.ExchangeDeclare("TestExchange.SimpleMessage", ExchangeType.Direct);
var binding = _advancedBus.Bind(exchange, queue, routingKey);
_advancedBus.Publish(exchange, routingKey, true, new Message<string>(message));
}
}
In this case the port on which the RabbitMQ server is waiting for messages is 5672. My question is besides that, what port is used by the client to send this message, and would it be possible to configure it?