JMeter:我可以使用任何JMeter采样器来连接消息并将消息发送到azurecloude中的队列-Azure Service Bus

时间:2019-01-28 09:01:02

标签: jmeter jms azureservicebus

我可以使用任何JMeter采样器(即JMS点对点,JMS Publisher ...)连接并发送消息到azureCloud(AzureServiceBus)中的队列吗?

我在这里按照描述的步骤操作:jmeter: Can I use jmeter JMeter "JMS Point-To-Point" to send messages to MSFT Azure Service Bus queue?

servicebus.properties-文件在lib文件夹中

但出现以下错误:

2019-01-28 09:41:40,878 ERROR o.a.q.j.JmsConnection: Failed to connect to remote at: amqp://....servicebus01.servicebus....:-1
2019-01-28 09:41:40,885 ERROR o.a.j.p.j.s.JMSSampler: Connection timed out: no further information: ....servicebus01.servicebus.dddddd.rr/xx.xx.xx.xx:5672
javax.jms.JMSException: Connection timed out: no further information: .......servicebus01.servicebus.sssss.de/xx.x.xxx.xxx:yyyyy
    at org.apache.qpid.jms.exceptions.JmsExceptionSupport.create(JmsExceptionSupport.java:86) ~[qpid-jms-client-0.40.0.jar:?]
    at org.apache.qpid.jms.exceptions.JmsExceptionSupport.create(JmsExceptionSupport.java:108) ~[qpid-jms-client-0.40.0.jar:?]
    at org.apache.qpid.jms.JmsConnection.connect(JmsConnection.java:176) ~[qpid-jms-client-0.40.0.jar:?]
    at org.apache.qpid.jms.JmsConnectionFactory.createQueueConnection(JmsConnectionFactory.java:235) ~[qpid-jms-client-0.40.0.jar:?]
    at org.apache.qpid.jms.JmsConnectionFactory.createQueueConnection(JmsConnectionFactory.java:222) ~[qpid-jms-client-0.40.0.jar:?]
    at org.apache.jmeter.protocol.jms.sampler.JMSSampler.threadStarted(JMSSampler.java:664) [ApacheJMeter_jms.jar:5.0 r1840935]
    at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:762) [ApacheJMeter_core.jar:5.0 r1840935]
    at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:994) [jorphan.jar:5.0 r1840935]
    at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:977) [jorphan.jar:5.0 r1840935]
    at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:730) [ApacheJMeter_core.jar:5.0 r1840935]
    at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:718) [ApacheJMeter_core.jar:5.0 r1840935]
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:249) [ApacheJMeter_core.jar:5.0 r1840935]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_171]
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection timed out: no further information: .......servicebus01.servicebus.xxxx.dd/xx.x.xxx.xxx:yyyyy
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[?:1.8.0_171]
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) ~[?:1.8.0_171]
    at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:327) ~[netty-transport-4.1.32.Final.jar:4.1.32.Final]
    at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:340) ~[netty-transport-4.1.32.Final.jar:4.1.32.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644) ~[netty-transport-4.1.32.Final.jar:4.1.32.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:591) ~[netty-transport-4.1.32.Final.jar:4.1.32.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:508) ~[netty-transport-4.1.32.Final.jar:4.1.32.Final]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:470) ~[netty-transport-4.1.32.Final.jar:4.1.32.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:909) ~[netty-common-4.1.32.Final.jar:4.1.32.Final]
    ... 1 more
Caused by: java.net.ConnectException: Connection timed out: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[?:1.8.0_171]
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) ~[?:1.8.0_171]
    at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:327) ~[netty-transport-4.1.32.Final.jar:4.1.32.Final]
    at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:340) ~[netty-transport-4.1.32.Final.jar:4.1.32.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644) ~[netty-transport-4.1.32.Final.jar:4.1.32.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:591) ~[netty-transport-4.1.32.Final.jar:4.1.32.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:508) ~[netty-transport-4.1.32.Final.jar:4.1.32.Final]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:470) ~[netty-transport-4.1.32.Final.jar:4.1.32.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:909) ~[netty-common-4.1.32.Final.jar:4.1.32.Final]
    ... 1 more
2019-01-28 09:41:40,891 WARN o.a.j.p.j.s.JMSSampler: Session may not be null while creating message
java.lang.IllegalStateException: Session may not be null while creating message
    at org.apache.jmeter.protocol.jms.sampler.JMSSampler.createMessage(JMSSampler.java:466) ~[ApacheJMeter_jms.jar:5.0 r1840935]
    at org.apache.jmeter.protocol.jms.sampler.JMSSampler.handleRequestResponse(JMSSampler.java:297) ~[ApacheJMeter_jms.jar:5.0 r1840935]
    at org.apache.jmeter.protocol.jms.sampler.JMSSampler.sample(JMSSampler.java:206) [ApacheJMeter_jms.jar:5.0 r1840935]
    at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622) [ApacheJMeter_core.jar:5.0 r1840935]
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546) [ApacheJMeter_core.jar:5.0 r1840935]
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486) [ApacheJMeter_core.jar:5.0 r1840935]
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253) [ApacheJMeter_core.jar:5.0 r1840935]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_171]
2019-01-28 09:41:40,892 INFO o.a.j.t.JMeterThread: Thread is done: Thread Group 1-1

我在JMeter / lib-folder中使用Jmeter-5.0和以下库:

geronimo-jms_2.0_spec-1.0-alpha-2.jar
netty-buffer-4.1.32.Final.jar
netty-codec-4.1.32.Final.jar

netty-codec-http-4.1.32.Final.jar
netty-common-4.1.32.Final.jar
netty-handler-4.1.32.Final.jar
netty-resolver-4.1.32.Final.jar
netty-transport-4.1.32.Final.jar
netty-transport-native-epoll-4.1.32.Final-linux-x86_64.jar
netty-transport-native-kqueue-4.1.32.Final-osx-x86_64.jar
netty-transport-native-unix-common-4.1.32.Final.jar
optional
proton-j-0.31.0.jar
qpid-jms-client-0.40.0.jar
qpid-jms-discovery-0.40.0.jar
slf4j-api-1.7.25.jar

Jmeter TestPlan

1 个答案:

答案 0 :(得分:0)

您是否可以从负载代理访问目标主机?可能您需要configure JMeter proxy settings

例如:

jmeter -H my.proxy.server -P 8000 -u username -a password -N localhost