Trying to make a containerised
windows service using docker to consume messages from rabbitmq
queues.
I am also using EasyNetQ
client to connect with RabbitMQ.
However it is failing with Persistent
Channel timed out exception
The operation requested on PersistentChannel timed out
Here is my code for Executing the consumer
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
while (!stoppingToken.IsCancellationRequested)
{
try
{
using (var bus = RabbitHutch.CreateBus("host=localhost;username=guest;password=guest"))
{
bus.Receive("Queue", msg => msg.Add<CustomModel>(m =>
{
_logger.LogInformation("Received Message: {0}, {1}", m.Prop1, m.Prop2);}));
}
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
}
}
catch (Exception ex)
{
_logger.LogError(ex.InnerException?.ToString());
}
}
}
I am not really sure what could be causing the timeout? Anybody have similar issue?