cfenv not parsing RMQ hostnames correctly
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- java, rabbitmq, spring-boot
- Domain
- backend
Research direction
Start with AmqpCfEnvProcessor.java and CfCredentials.java, then compare their credential handling with the RabbitMQ service broker documentation linked in the issue. Trace how hostname values become Spring RabbitMQ properties; done means the processor preserves all entries from the hostnames environment field instead of exposing only the first node.
Written by the indexing model from the issue text.
Description
Issue Description
When a developer uses service broker to attach a multi-node RMQ cluster to his application, cfenv will only parse the 1st node and ignore the others.
Here is an example of what the ENV variables looks like for a multi-node RMQ cluster.
"p.rabbitmq": [{
xxx
"credentials": {
xxx
"hostname": "q-i0.rabbitmq-server.bosh.rabbitmq.bosh",
"hostnames": [
"q-i0.rabbitmq-server.bosh.rabbitmq.bosh",
"q-i1.rabbitmq-server.bosh.rabbitmq.bosh",
"q-i2.rabbitmq-server.bosh.rabbitmq.bosh"
],
}
Note that both hostname and hostnames are listed and hostnames contains the hostname for all 3 nodes.
From the official service broker documentation, both hostname and hostnames are top-level properties for AMQP connection.
The top level properties uri, uris, vhost, username, password, hostname, and hostnames provide access to the AMQP 0.9.1 protocol.
However, AmqpCfEnvProcessor calls cfCredentials.getHost() which only parse host and hostname from ENV.
This leads to application totally ignoring the other nodes in RMQ cluster.
An example of ENV parsed by AmqpCfEnvProcessor can be found below.
"name": "AmqpCfEnvProcessor",
"properties": {
"spring.rabbitmq.host": {
"value": "q-i0.rabbitmq-server.bosh.rabbitmq.bosh"
},
"spring.rabbitmq.password": {
"value": "******"
},
"spring.rabbitmq.username": {
"value": "09db23ac-0c02-46a9-8959-20729bcf1770"
},
"spring.rabbitmq.ssl.enabled": {
"value": "true"
},
"spring.rabbitmq.port": {
"value": "5671"
},
"spring.rabbitmq.virtualHost": {
"value": "b7124f11-7685-4873-a3e4-24ac9ed3cdba"
}
}
As you can see, there is only 1 host.
Expected behavior
AmqpCfEnvProcessor able to parse all nodes from the hostnames ENV variable.
- Dominant language
- Java
- Stars
- 97
- Forks
- 64
- Avg merge
- 6h 36m
- Merged PRs (30d)
- 6
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pivotal-cf/java-cfenv
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 45/100
pivotal-cf/java-cfenv#354 · 1 reaction ·
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 48/100
pivotal-cf/java-cfenv#296 · 3 reactions ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
pivotal-cf/java-cfenv#292 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
pivotal-cf/java-cfenv#255 · 2 comments ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
pivotal-cf/java-cfenv#249 · 2 comments ·
All issues in pivotal-cf/java-cfenv
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oracle/javavscode#652 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenAPITools/openapi-generator#25014 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
AloisSeckar/demos-java#380 ·