Reputation: 1
I'm starting at RabbitMq and I'm having trouble starting my API. This error occurred: System.TimeoutException: 'The requested operation on PersistentChannel has timed out'.
I am using EasyNetQ.
RabbitMq is running in a Docker container that is configured as settings: http: 15672 and ampq: 56712. Click here to access Rabbitmq without any problems in the browser.
Below is the code (for now the hardcode) of the settings. Try to pass the username and password as well, but without success, according to the code.
protected override Task ExecuteAsync(CancellationToken stoppingToken)
{
_bus = RabbitHutch.CreateBus("host=localhost:5672;username=guest;password=guest");
_bus.RespondAsync<UsuarioRegistradoIntegrationEvent, ResponseMessage>(async request =>
new ResponseMessage(await RegistrarCliente(request)));
return Task.CompletedTask;
}
ou
protected override Task ExecuteAsync(CancellationToken stoppingToken)
{
_bus = RabbitHutch.CreateBus("host=localhost:5672");
_bus.RespondAsync<UsuarioRegistradoIntegrationEvent, ResponseMessage>(async request =>
new ResponseMessage(await RegistrarCliente(request)));
return Task.CompletedTask;
}
ou
protected override Task ExecuteAsync(CancellationToken stoppingToken)
{
_bus = RabbitHutch.CreateBus("host=localhost");
_bus.RespondAsync<UsuarioRegistradoIntegrationEvent, ResponseMessage>(async request =>
new ResponseMessage(await RegistrarCliente(request)));
return Task.CompletedTask;
}
Upvotes: 0
Views: 1053
Reputation: 10265
RabbitHutch.CreateBus("host=localhost")
once per application instance (share the instance). protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
_bus = RabbitHutch.CreateBus("host=localhost");
await _bus.RespondAsync<UsuarioRegistradoIntegrationEvent, ResponseMessage>(async request =>
new ResponseMessage(await RegistrarCliente(request)));
}
We're missing the implementation of RegistrarCliente(request) which makes it difficult to spot any other problems.
Upvotes: 1