Skip to content

Bug/Doc: Producer connection refused if not using .load_balancer_mode(true) #228

@chevdor

Description

@chevdor

Describe the bug

This is probably more an information to add to the doc/examples than a bug per say.
A hint in the error message could also save some time :)

I am hosting a RabbitMQ instance in K8s, not using a LoadBalancer but using Traefik.
Running a consumer with:

	let environment = Environment::builder()
		.host("rabbitmq.sample.org")
		.username("user")
		.password("pass")
		// .port(5552)
		.build()
		.await?;

works fine.

Running a producer with the same:

	let environment = Environment::builder()
		.host("rabbitmq.sample.org")
		.username("user")
		.password("pass")
		// .port(5552)
		.build()
		.await?;

fails with:
Error: Client(Io(Os { code: 61, kind: ConnectionRefused, message: "Connection refused" }))

The producer however does connect sucessfully when using:

	let environment = Environment::builder()
		.host("rabbitmq.sample.org")
		.username("user")
		.password("pass")
		.load_balancer_mode(true)                        // REQUIRED
		// .port(5552)
		.build()
		.await?;

Reproduction steps

see above

Expected behavior

Hint in the doc/error message about .load_balancer().
I did not find any other mention other than this PR.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions