Skip to content
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

Auto-configuration for Rabbit Streams doesn't consider RabbitConnectionDetails #42489

Closed
wilkinsona opened this issue Oct 1, 2024 · 0 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@wilkinsona
Copy link
Member

The auto-configuration for Rabbit Streams looks at the spring.rabbit.stream.* properties for various settings, sometimes falling back to a more general spring.rabbit property:

static EnvironmentBuilder configure(EnvironmentBuilder builder, RabbitProperties properties) {
builder.lazyInitialization(true);
RabbitProperties.Stream stream = properties.getStream();
PropertyMapper map = PropertyMapper.get();
map.from(stream.getHost()).to(builder::host);
map.from(stream.getPort()).to(builder::port);
map.from(stream.getVirtualHost())
.as(withFallback(properties::getVirtualHost))
.whenNonNull()
.to(builder::virtualHost);
map.from(stream.getUsername()).as(withFallback(properties::getUsername)).whenNonNull().to(builder::username);
map.from(stream.getPassword()).as(withFallback(properties::getPassword)).whenNonNull().to(builder::password);
return builder;
}

This fallback logic is incorrect as it ignores any RabbitConnectionDetails that may have been defined so, for example, a @ServiceConnection for Rabbit running in a container won't work correctly when using streams.

@wilkinsona wilkinsona added the type: bug A general bug label Oct 1, 2024
@wilkinsona wilkinsona added this to the 3.2.x milestone Oct 1, 2024
@wilkinsona wilkinsona self-assigned this Oct 1, 2024
@wilkinsona wilkinsona changed the title Auto-configuration for Rabbit streams doesn't consider RabbitConnectionDetails Auto-configuration for Rabbit Streams doesn't consider RabbitConnectionDetails Oct 1, 2024
@wilkinsona wilkinsona modified the milestones: 3.2.x, 3.2.11 Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant