๐ | AMQP target with cluster addresses ?
iguissouma opened this issue ยท 2 comments
iguissouma commented
I want to be able to specify different addresses of rabbitmq cluster for AMQP target.
When I specify a list of uri like below,
"url": "amqp://localhost:5672,amqp://localhost:5673,amqp://localhost:5674"
I got this error:
Caused by: java.lang.IllegalArgumentException: Multiple segments in path of AMQP URI: //localhost:5673,amqp://localhost:5674
at com.rabbitmq.client.ConnectionFactory.setUri(ConnectionFactory.java:342)
at com.chutneytesting.task.amqp.ConnectionFactoryFactory.create(ConnectionFactoryFactory.java:13)
at com.chutneytesting.task.amqp.AmqpBasicConsumeTask.<init>(AmqpBasicConsumeTask.java:40)
... 18 common frames omitted
In regular spring application we can specify addresses:
rabbitmq:
addresses: localhost:5672,localhost:5673,localhost:5674
username: guest
password: guest
boddissattva commented
Did you try something like this : amqp://localhost:5672,localhost:5673,localhost:5674
?
If this does not work, we will have to :
- Check that target could be define without errors with multiple hosts.
- Extract the hosts definitions from target or use an explicit property to change the connection creation here https://github.com/chutney-testing/chutney/blob/b06bd3beeef1a11f1ba750f3926d3c0e68558e07/task-impl/src/main/java/com/chutneytesting/task/amqp/AmqpBasicConsumeTask.java#L78
boddissattva commented
After some test and code reading, multihost urls are not supported by the method ConnectionFactory.setUri()
used in Chutney ConnectionFactoryFactory
class.
Multiple adresses should be passed in via newConnection(...)
method as already mentionned.