我需要通过读取要从包含从 1 到 10 的整数值的 csv 文件设置的持久订阅 ID,将 10 个不同的持久订阅者添加到消息代理中。但是,JMeter 未能读取该值,而是尝试设置订阅 ID 为 ${id}。下面是我在 JMeter 中所做的配置。
请注意,当我通过用户定义的变量尝试相同的操作时,它将获取变量的值并成功创建持久订阅。
JMeter 日志如下。
2016/08/29 17:56:39 INFO - jmeter.engine.StandardJMeterEngine: Running the test!
2016/08/29 17:56:39 INFO - jmeter.samplers.SampleEvent: List of sample_variables: []
2016/08/29 17:56:39 INFO - jmeter.gui.util.JMeterMenuBar: setRunning(true,*local*)
2016/08/29 17:56:39 INFO - jmeter.engine.StandardJMeterEngine: Starting ThreadGroup: 1 : DueTopic1 - Node 1- Sub 1
2016/08/29 17:56:39 INFO - jmeter.engine.StandardJMeterEngine: Starting 1 threads for group DueTopic1 - Node 1- Sub 1.
2016/08/29 17:56:39 INFO - jmeter.engine.StandardJMeterEngine: Thread will continue on error
2016/08/29 17:56:39 INFO - jmeter.threads.ThreadGroup: Starting thread group number 1 threads 1 ramp-up 1 perThread 1000.0 delayedStart=false
2016/08/29 17:56:39 INFO - jmeter.threads.ThreadGroup: Started thread group number 1
2016/08/29 17:56:39 INFO - jmeter.engine.StandardJMeterEngine: All thread groups have been started
2016/08/29 17:56:39 INFO - jmeter.threads.JMeterThread: Thread started: DueTopic1 - Node 1- Sub 1 1-1
2016/08/29 17:56:39 ERROR - jmeter.protocol.jms.client.ReceiveSubscriber: Error during close: javax.jms.JMSException: Error closing connection: org.wso2.andes.AMQConnectionClosedException: Error: Subscription ID: carbon:${id} cannot contain any of following symbols ~!@#;%^*()+={}|<>"', and space. " / " can only use as the tenant separator
[error code 541: internal error]
at org.wso2.andes.client.AMQConnection.doClose(AMQConnection.java:971)
at org.wso2.andes.client.AMQConnection.close(AMQConnection.java:897)
at org.wso2.andes.client.AMQConnection.close(AMQConnection.java:888)
at org.wso2.andes.client.AMQConnection.close(AMQConnection.java:883)
at org.apache.jmeter.protocol.jms.Utils.close(Utils.java:78)
at org.apache.jmeter.protocol.jms.client.ReceiveSubscriber.close(ReceiveSubscriber.java:359)
at org.apache.jmeter.protocol.jms.client.ReceiveSubscriber.<init>(ReceiveSubscriber.java:255)
at org.apache.jmeter.protocol.jms.client.ReceiveSubscriber.<init>(ReceiveSubscriber.java:115)
at org.apache.jmeter.protocol.jms.sampler.SubscriberSampler.initReceiveClient(SubscriberSampler.java:126)
at org.apache.jmeter.protocol.jms.sampler.SubscriberSampler.threadStarted(SubscriberSampler.java:298)
at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:647)
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:996)
at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:978)
at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:616)
at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:604)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:237)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.wso2.andes.AMQConnectionClosedException: Error: Subscription ID: carbon:${id} cannot contain any of following symbols ~!@#;%^*()+={}|<>"', and space. " / " can only use as the tenant separator
[error code 541: internal error]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.wso2.andes.AMQException.cloneForCurrentThread(AMQException.java:110)
at org.wso2.andes.client.protocol.AMQProtocolHandler.writeCommandFrameAndWaitForReply(AMQProtocolHandler.java:640)
at org.wso2.andes.client.protocol.AMQProtocolHandler.syncWrite(AMQProtocolHandler.java:676)
at org.wso2.andes.client.protocol.AMQProtocolHandler.closeConnection(AMQProtocolHandler.java:707)
at org.wso2.andes.client.AMQConnectionDelegate_8_0.closeConnection(AMQConnectionDelegate_8_0.java:61)
at org.wso2.andes.client.AMQConnection.doClose(AMQConnection.java:955)
... 16 more
Caused by: org.wso2.andes.AMQConnectionClosedException: Error: Subscription ID: carbon:${id} cannot contain any of following symbols ~!@#;%^*()+={}|<>"', and space. " / " can only use as the tenant separator
[error code 541: internal error]
at org.wso2.andes.client.handler.ConnectionCloseMethodHandler.methodReceived(ConnectionCloseMethodHandler.java:91)
at org.wso2.andes.client.handler.ClientMethodDispatcherImpl.dispatchConnectionClose(ClientMethodDispatcherImpl.java:192)
at org.wso2.andes.framing.amqp_0_91.ConnectionCloseBodyImpl.execute(ConnectionCloseBodyImpl.java:140)
at org.wso2.andes.client.state.AMQStateManager.methodReceived(AMQStateManager.java:111)
at org.wso2.andes.client.protocol.AMQProtocolHandler.methodBodyReceived(AMQProtocolHandler.java:517)
at org.wso2.andes.client.protocol.AMQProtocolSession.methodFrameReceived(AMQProtocolSession.java:467)
at org.wso2.andes.framing.AMQMethodBodyImpl.handle(AMQMethodBodyImpl.java:96)
at org.wso2.andes.client.protocol.AMQProtocolHandler$2.run(AMQProtocolHandler.java:468)
at org.wso2.andes.pool.Job.processAll(Job.java:109)
at org.wso2.andes.pool.Job.run(Job.java:153)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
... 1 more
2016/08/29 17:56:39 ERROR - jmeter.protocol.jms.sampler.SubscriberSampler: Could not initialise client javax.jms.JMSException: Error registering consumer: org.wso2.andes.AMQConnectionClosedException: Error: Subscription ID: carbon:${id} cannot contain any of following symbols ~!@#;%^*()+={}|<>"', and space. " / " can only use as the tenant separator
[error code 541: internal error]
at org.wso2.andes.client.AMQSession$6.execute(AMQSession.java:2143)
at org.wso2.andes.client.AMQSession$6.execute(AMQSession.java:2086)
at org.wso2.andes.client.AMQConnectionDelegate_8_0.executeRetrySupport(AMQConnectionDelegate_8_0.java:324)
at org.wso2.andes.client.AMQConnection$3.run(AMQConnection.java:655)
at java.security.AccessController.doPrivileged(Native Method)
at org.wso2.andes.client.AMQConnection.executeRetrySupport(AMQConnection.java:652)
at org.wso2.andes.client.failover.FailoverRetrySupport.execute(FailoverRetrySupport.java:102)
at org.wso2.andes.client.AMQSession.createConsumerImpl(AMQSession.java:2084)
at org.wso2.andes.client.AMQSession.createConsumer(AMQSession.java:1072)
at org.wso2.andes.client.AMQSession.createDurableSubscriber(AMQSession.java:1226)
at org.wso2.andes.client.AMQSession.createDurableSubscriber(AMQSession.java:1121)
at org.apache.jmeter.protocol.jms.client.ReceiveSubscriber.createSubscriber(ReceiveSubscriber.java:284)
at org.apache.jmeter.protocol.jms.client.ReceiveSubscriber.<init>(ReceiveSubscriber.java:239)
at org.apache.jmeter.protocol.jms.client.ReceiveSubscriber.<init>(ReceiveSubscriber.java:115)
at org.apache.jmeter.protocol.jms.sampler.SubscriberSampler.initReceiveClient(SubscriberSampler.java:126)
at org.apache.jmeter.protocol.jms.sampler.SubscriberSampler.threadStarted(SubscriberSampler.java:298)
at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:647)
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:996)
at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:978)
at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:616)
at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:604)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:237)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.wso2.andes.AMQConnectionClosedException: Error: Subscription ID: carbon:${id} cannot contain any of following symbols ~!@#;%^*()+={}|<>"', and space. " / " can only use as the tenant separator
[error code 541: internal error]
at org.wso2.andes.client.handler.ConnectionCloseMethodHandler.methodReceived(ConnectionCloseMethodHandler.java:91)
at org.wso2.andes.client.handler.ClientMethodDispatcherImpl.dispatchConnectionClose(ClientMethodDispatcherImpl.java:192)
at org.wso2.andes.framing.amqp_0_91.ConnectionCloseBodyImpl.execute(ConnectionCloseBodyImpl.java:140)
at org.wso2.andes.client.state.AMQStateManager.methodReceived(AMQStateManager.java:111)
at org.wso2.andes.client.protocol.AMQProtocolHandler.methodBodyReceived(AMQProtocolHandler.java:517)
at org.wso2.andes.client.protocol.AMQProtocolSession.methodFrameReceived(AMQProtocolSession.java:467)
at org.wso2.andes.framing.AMQMethodBodyImpl.handle(AMQMethodBodyImpl.java:96)
at org.wso2.andes.client.protocol.AMQProtocolHandler$2.run(AMQProtocolHandler.java:468)
at org.wso2.andes.pool.Job.processAll(Job.java:109)
at org.wso2.andes.pool.Job.run(Job.java:153)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
... 1 more
2016/08/29 17:56:39 INFO - jmeter.services.FileServer: Stored: training.csv
2016/08/29 17:56:39 INFO - jmeter.threads.JMeterThread: Thread is done: DueTopic1 - Node 1- Sub 1 1-1
2016/08/29 17:56:39 INFO - jmeter.threads.JMeterThread: Thread finished: DueTopic1 - Node 1- Sub 1 1-1
2016/08/29 17:56:39 INFO - jmeter.engine.StandardJMeterEngine: Notifying test listeners of end of test
2016/08/29 17:56:39 INFO - jmeter.services.FileServer: Close: training.csv
2016/08/29 17:56:39 INFO - jmeter.protocol.jms.client.InitialContextFactory: InitialContextFactory.close() called and Context instances cleaned up
2016/08/29 17:56:39 INFO - jmeter.gui.util.JMeterMenuBar: setRunning(false,*local*)