spring-cloud / spring-cloud/spring-cloud-stream

RabbitMessageChannelBinder fails to initialize LocalizedQueueConnectionFactory if ssl.enabled is not specified

Open
#2,331 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.1k
Forks
646
Avg merge
2d 3h
Merged PRs (30d)
8

Description

@vkochnev commented on Wed Nov 03 2021

https://github.com/spring-cloud/spring-cloud-stream-binder-rabbit/blob/09c8b9bdc5a172b4034b32ff4d70b094ccb616b7/spring-cloud-stream-binder-rabbit/src/main/java/org/springframework/cloud/stream/binder/rabbit/RabbitMessageChannelBinder.java#L262

Shouldn't it be this.rabbitProperties.getSsl().determineEnabled() instead? The problem is if spring.rabbitmq.ssl.enabled is not specified in application.yml this line fails with NPE.

Also if virtualHost, username and/or password are specified on addresses instead of separate fields current implementation will ignore them, use of determine* alternatives might help here also (It looks like I should file these separately, but I'm not sure it makes sense).

More comprehensive solution might be discussed in https://github.com/spring-projects/spring-amqp/issues/1384

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in spring-cloud-stream-binder-rabbit/src/main/java/org/springframework/cloud/stream/binder/rabbit/RabbitMessageChannelBinder.java at the referenced line around 262. Reproduce initialization with spring.rabbitmq.ssl.enabled omitted, then inspect how virtualHost, username, and password supplied on an address are handled. Done means initialization no longer fails in the reported configuration and the intended address properties are not ignored.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, rabbitmq
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.