jlavallee / JMeter-Rabbit-AMQP

A JMeter plugin to publish & consume messages from RabbitMQ or any AMQP message broker
Apache License 2.0
158 stars 180 forks source link

Timeout error #25

Open hpirosha opened 9 years ago

hpirosha commented 9 years ago

First of all thanks for open-sourcing this very useful Jmeter plugin. While using this with amqp-client-3.3.4 version, it throws the following timeout error:

2015/05/27 14:49:16 ERROR - com.zeroclue.jmeter.protocol.amqp.AMQPPublisher: Failed to initialize channel :  java.io.IOException
    at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:106)
    at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:102)
    at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:124)
    at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:374)
    at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:590)
    at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:563)
    at com.zeroclue.jmeter.protocol.amqp.AMQPSampler.createChannel(AMQPSampler.java:427)
    at com.zeroclue.jmeter.protocol.amqp.AMQPSampler.initChannel(AMQPSampler.java:75)
    at com.zeroclue.jmeter.protocol.amqp.AMQPPublisher.initChannel(AMQPPublisher.java:274)
    at com.zeroclue.jmeter.protocol.amqp.AMQPPublisher.sample(AMQPPublisher.java:73)
    at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:429)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
    at java.lang.Thread.run(Thread.java:724)
Caused by: com.rabbitmq.client.ShutdownSignalException: connection error
    at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:67)
    at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:33)
    at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:343)
    at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:216)
    at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:118)
    ... 10 more
Caused by: java.net.SocketTimeoutException: Timeout during Connection negotiation
    at com.rabbitmq.client.impl.AMQConnection.handleSocketTimeout(AMQConnection.java:583)
    at com.rabbitmq.client.impl.AMQConnection.access$600(AMQConnection.java:65)
    at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:558)
    ... 1 more

On little debugging, I changed the code in AMQPSampler to NOT set the virtual host parameter on connection factory if it is null. Now it does not error out.

if(getVirtualHost()!=null && !"".equals.getVirtualHost())
                factory.setVirtualHost(getVirtualHost());

Not sure why it gives the above error when it is set to null.

Thanks, Hussain

abhishekdesarda commented 7 years ago

Hi,

I am getting below error, will above change help me to resolve this issue?

Please help!

2017-08-01 07:27:04,117 ERROR c.z.j.p.a.AMQPConsumer: Failed to initialize channel java.util.concurrent.TimeoutException: null at com.rabbitmq.utility.BlockingCell.get(BlockingCell.java:77) ~[amqp-client-3.6.1.jar:?] at com.rabbitmq.utility.BlockingCell.uninterruptibleGet(BlockingCell.java:111) ~[amqp-client-3.6.1.jar:?] at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:37) ~[amqp-client-3.6.1.jar:?] at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:367) ~[amqp-client-3.6.1.jar:?] at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:293) ~[amqp-client-3.6.1.jar:?] at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:716) ~[amqp-client-3.6.1.jar:?] at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:647) ~[amqp-client-3.6.1.jar:?] at com.zeroclue.jmeter.protocol.amqp.AMQPSampler.createChannel(AMQPSampler.java:437) ~[JMeterAMQP.jar:?] at com.zeroclue.jmeter.protocol.amqp.AMQPSampler.initChannel(AMQPSampler.java:79) ~[JMeterAMQP.jar:?] at com.zeroclue.jmeter.protocol.amqp.AMQPConsumer.initChannel(AMQPConsumer.java:339) ~[JMeterAMQP.jar:?] at com.zeroclue.jmeter.protocol.amqp.AMQPConsumer.sample(AMQPConsumer.java:64) [JMeterAMQP.jar:?] at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:491) [ApacheJMeter_core.jar:3.2 r1790748] at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:425) [ApacheJMeter_core.jar:3.2 r1790748] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:254) [ApacheJMeter_core.jar:3.2 r1790748] at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]

Thanks, Abhishek