-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RabbitMQ.Client.Exceptions.BrokerUnreachableException: 'None of the specified endpoints were reachable' #8
Comments
You solved it. I also met this mistake |
Hello! I didn't understand how you solved the problem, could you please tell me how? |
This means that the app can't connect to Rabbit AMQP api, which should be running on localhost:5672. |
Thanks @evgenirusev - I was trying to get the RabitMq "Hello World" tutorial to work and could not figure out why is it not working. This is what worked for me:
|
thanks @evgenirusev for me "host.docker.internal" worked. In my situation I have a docker desktop running with linux container and rabbitmq:3-management on it, then I created a dotnet core webapi with VS 20219. Now when I am running the code it is working
But not working in this scenario |
I have also faced the issue you can check this issue and resolution Happy Coding! |
Hi, I created a small application using .netcore and rabbitmq and created the image in docker for both of them using below docker-compose code - version: '3' isp_hub: volumes: after running the cmd docker-compose up the image is created and container is started and i am using Jmeter client to hit the container .net code is working but while trying to pass the data in queue getting below exception - "log":"info: Microsoft.Hosting.Lifetime[0]\r\n","stream":"stdout","time":"2022-04-04T08:25:22.6109672Z"} rabbitmq connection code - public void SendToMessageBroker(string requestData)
i am new to docker . please help me to understand the issue and how to resolve it |
run rabbitmq on docker. |
Facing the same issues, this solves my problems for persistent connection |
evgenirusev 's solution works ! thank you Evgeni Rusev |
It works |
Its Work! |
Hi, the code is best,

when i want run in debug mode i have an error with this title
Can you help me?
[20:17:25 INF] User profile is available. Using 'C:\Users\Hossein\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest. [20:17:35 INF] Unable to connect to broker Application startup exception: Autofac.Core.DependencyResolutionException: An exception was thrown while activating ?:RawRabbit.IBusClient. ---> RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable ---> System.IO.IOException: connection.start was never received, likely due to a network timeout at RabbitMQ.Client.Framing.Impl.Connection.StartAndTune() at RabbitMQ.Client.Framing.Impl.Connection.Open(Boolean insist) at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.Init(IFrameHandler fh) at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName) --- End of inner exception stack trace --- at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName) at RawRabbit.Channel.ChannelFactory.ConnectAsync(CancellationToken token) at RawRabbit.DependencyInjection.RawRabbitDependencyRegisterExtension.<>c.<AddRawRabbit>b__0_3(IDependencyResolver resolver) at RawRabbit.DependencyInjection.SimpleDependencyInjection.<>c__DisplayClass4_0
2.b__0()at System.Lazy
1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy
1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)at System.Lazy
1.CreateValue() at RawRabbit.DependencyInjection.SimpleDependencyInjection.GetService(Type serviceType, Object[] additional) at RawRabbit.DependencyInjection.SimpleDependencyInjection.GetService[TService](Object[] additional) at RawRabbit.Instantiation.InstanceFactory.Create() at DShop.Common.RabbitMq.Extensions.<>c.<ConfigureBus>b__2_1(IComponentContext context) in C:\Users\Hossein\Desktop\Repository\Microservice\DNC\DNC-DShop.Common\src\DShop.Common\RabbitMq\Extensions.cs:line 89 at Autofac.Builder.RegistrationBuilder.<>c__DisplayClass0_0
1.b__0(IComponentContext c, IEnumerable1 p) in C:\projects\autofac\src\Autofac\Builder\RegistrationBuilder.cs:line 62 at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable
1 parameters) in C:\projects\autofac\src\Autofac\Core\Activators\Delegate\DelegateActivator.cs:line 71at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable
1 parameters, Object& decoratorTarget) in C:\projects\autofac\src\Autofac\Core\Resolving\InstanceLookup.cs:line 118 --- End of inner exception stack trace --- at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable
1 parameters, Object& decoratorTarget) in C:\projects\autofac\src\Autofac\Core\Resolving\InstanceLookup.cs:line 136at Autofac.Core.Resolving.InstanceLookup.Execute() in C:\projects\autofac\src\Autofac\Core\Resolving\InstanceLookup.cs:line 85
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable
1 parameters) in C:\projects\autofac\src\Autofac\Core\Resolving\ResolveOperation.cs:line 130 at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable
1 parameters) in C:\projects\autofac\src\Autofac\Core\Resolving\ResolveOperation.cs:line 83at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable
1 parameters, Object& instance) in C:\projects\autofac\src\Autofac\ResolutionExtensions.cs:line 1041 at Autofac.ResolutionExtensions.ResolveOptionalService(IComponentContext context, Service service, IEnumerable
1 parameters) in C:\projects\autofac\src\Autofac\ResolutionExtensions.cs:line 814at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider) at DShop.Common.RabbitMq.BusSubscriber..ctor(IApplicationBuilder app) in C:\Users\Hossein\Desktop\Repository\Microservice\DNC\DNC-DShop.Common\src\DShop.Common\RabbitMq\BusSubscriber.cs:line 32
at DShop.Common.RabbitMq.Extensions.UseRabbitMq(IApplicationBuilder app) in C:\Users\Hossein\Desktop\Repository\Microservice\DNC\DNC-DShop.Common\src\DShop.Common\RabbitMq\Extensions.cs:line 25
at DShop.Api.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, IApplicationLifetime applicationLifetime, IConsulClient client, IStartupInitializer startupInitializer) in C:\Users\Hossein\Desktop\Repository\Microservice\DNC\DNC-DShop.Api\src\DShop.Api\Startup.cs:line 91
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
[20:17:35 FTL] Application startup exception
Autofac.Core.DependencyResolutionException: An exception was thrown while activating ?:RawRabbit.IBusClient. ---> RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable ---> System.IO.IOException: connection.start was never received, likely due to a network timeout
at RabbitMQ.Client.Framing.Impl.Connection.StartAndTune()
at RabbitMQ.Client.Framing.Impl.Connection.Open(Boolean insist)
at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.Init(IFrameHandler fh)
at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName)
--- End of inner exception stack trace ---
at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName)
at RawRabbit.Channel.ChannelFactory.ConnectAsync(CancellationToken token)
at RawRabbit.DependencyInjection.RawRabbitDependencyRegisterExtension.<>c.b__0_3(IDependencyResolver resolver)
at RawRabbit.DependencyInjection.SimpleDependencyInjection.<>c__DisplayClass4_0
2.<AddSingleton>b__0() at System.Lazy
1.ViaFactory(LazyThreadSafetyMode mode)at System.Lazy
1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy
1.CreateValue()at RawRabbit.DependencyInjection.SimpleDependencyInjection.GetService(Type serviceType, Object[] additional)
at RawRabbit.DependencyInjection.SimpleDependencyInjection.GetService[TService](Object[] additional)
at RawRabbit.Instantiation.InstanceFactory.Create()
at DShop.Common.RabbitMq.Extensions.<>c.b__2_1(IComponentContext context) in C:\Users\Hossein\Desktop\Repository\Microservice\DNC\DNC-DShop.Common\src\DShop.Common\RabbitMq\Extensions.cs:line 89
at Autofac.Builder.RegistrationBuilder.<>c__DisplayClass0_0
1.<ForDelegate>b__0(IComponentContext c, IEnumerable
1 p) in C:\projects\autofac\src\Autofac\Builder\RegistrationBuilder.cs:line 62at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable
1 parameters) in C:\projects\autofac\src\Autofac\Core\Activators\Delegate\DelegateActivator.cs:line 71 at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable
1 parameters, Object& decoratorTarget) in C:\projects\autofac\src\Autofac\Core\Resolving\InstanceLookup.cs:line 118--- End of inner exception stack trace ---
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable
1 parameters, Object& decoratorTarget) in C:\projects\autofac\src\Autofac\Core\Resolving\InstanceLookup.cs:line 136 at Autofac.Core.Resolving.InstanceLookup.Execute() in C:\projects\autofac\src\Autofac\Core\Resolving\InstanceLookup.cs:line 85 at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable
1 parameters) in C:\projects\autofac\src\Autofac\Core\Resolving\ResolveOperation.cs:line 130at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable
1 parameters) in C:\projects\autofac\src\Autofac\Core\Resolving\ResolveOperation.cs:line 83 at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable
1 parameters, Object& instance) in C:\projects\autofac\src\Autofac\ResolutionExtensions.cs:line 1041at Autofac.ResolutionExtensions.ResolveOptionalService(IComponentContext context, Service service, IEnumerable`1 parameters) in C:\projects\autofac\src\Autofac\ResolutionExtensions.cs:line 814
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider) at DShop.Common.RabbitMq.BusSubscriber..ctor(IApplicationBuilder app) in C:\Users\Hossein\Desktop\Repository\Microservice\DNC\DNC-DShop.Common\src\DShop.Common\RabbitMq\BusSubscriber.cs:line 32
at DShop.Common.RabbitMq.Extensions.UseRabbitMq(IApplicationBuilder app) in C:\Users\Hossein\Desktop\Repository\Microservice\DNC\DNC-DShop.Common\src\DShop.Common\RabbitMq\Extensions.cs:line 25
at DShop.Api.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, IApplicationLifetime applicationLifetime, IConsulClient client, IStartupInitializer startupInitializer) in C:\Users\Hossein\Desktop\Repository\Microservice\DNC\DNC-DShop.Api\src\DShop.Api\Startup.cs:line 91
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
`
The text was updated successfully, but these errors were encountered: