RabbitMQ for Pivotal Cloud Foundry 1.8.0 - 1.8.7
The customer is using the RabbitMQ OnDemand Broker and their application uses a URI containing string "%2F" for vhost. The following error is seen trying to publish a message to the Broker.
Application log reports:
=ERROR REPORT==== 2-May-2017::16:45:02 ===
Error on AMQP connection <0.15436.8> (10.236.180.38:54452 -> 10.236.181.21:5672, user: '9e47ac33-d9bb-4565-ba14-d5832544ff76', state: opening):
access to vhost '%2F' refused for user '9e47ac33-d9bb-4565-ba14-d5832544ff76'
=INFO REPORT==== 2-May-2017::16:45:02 ===
closing AMQP connection <0.15436.8> (10.236.180.38:54452 -> 10.236.181.21:5672)
This error is caused when the client spring-cloud-connectors library is not decoding the path component of the URI. This means that the client thinks the vhost is %2F instead of the value /.
This formatting worked previously when using standard RabbitMQ service but is broken on the OnDemand Broker introduced in 1.8.x. If your applications are coded to use "%2F" in URI then they will encounter this error when using the OnDemand Broker.
You can also refer to the appendix examples of URI's for more details.
The workaround to this issue is to hardcode the vhost to "/" for amqp config in the application code rather than using "%2F" (See "Additional Information" below).
The code fix for this issue is available in the 1.8.8 release of RabbitMQ for PCF. This fix implements generating vhost names that do not have to go through a URI encode/decode filter.
Additionally, there will be a fix in a future version of Spring, such that spring-cloud-connectors properly decode the "%2F" string.
This issue is referenced in RabbitMQ release notes
spring-bootclient libraries cannot bind to dedicated instance services
Example of working URI
Example of problematic URI