antonyvorontsov / RabbitMQ.Client.Core.DependencyInjection

.Net Core library-wrapper of RabbitMQ.Client for Dependency Injection.
MIT License
111 stars 36 forks source link

Problem setting up in NET Core 3.1 #31

Closed martinbures97 closed 4 years ago

martinbures97 commented 4 years ago

Hi Antony,

im trying to remake my rabbit mq app into .NET Core 3.1 console app using DI. Here im sending you pic of my code which works.

image

I tried your tutorial from github -> setting up appsettings, registering rabbitmq client into DI etc. Here is my remaked code.

image

But when i try to resolve IQueueService image

This error occurs 'connection.start was never received, likely due to a network timeout' image

My appsettings are set to default and my host name/username/pwd is same as in old code. image

Please can you help me with this error ? Thanks

antonyvorontsov commented 4 years ago

Hi, Martin!

I actually have no idea what how I help you. Seems that something wrong with configuration in the appsettings.json file. Have you tried a "manual" way of configuring a RabbitMQ client via RabbitMqClientOptions?

var configuration = new RabbitMqClientOptions
{
    HostName = "hostname",
    Port = 5432,
    UserName = "username",
    Password = "pwd"
};
services.AddRabbitMqClient(configuration);

And by the way, are you sure that you have valid port and hostname? An exception IOException: connection. start was never received, likely due to a network timeout usually shows when something wrong with configuration options.

Best regards, Antony

antonyvorontsov commented 4 years ago

If RabbitMqClientOptions won't help you then something is really wrong. I would really appreciate if you could give me a code example (not screenshots, actual code) which I can use to reproduce the problem.

antonyvorontsov commented 4 years ago

Closing due to inactivity.

Fell free to re-open it again if you need my help further.