chutney-testing/chutney-legacy

๐Ÿ› | AMQP target with cluster addresses ?

iguissouma opened this issue ยท 2 comments

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

Did you try something like this : amqp://localhost:5672,localhost:5673,localhost:5674 ?

If this does not work, we will have to :

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.