gpt4 book ai didi

java - 使用 ActiveMQ 的 JMeter JMS 点对点采样器

转载 作者:行者123 更新时间:2023-12-02 09:07:02 27 4
gpt4 key购买 nike

我们正在升级应用程序以使用 ActiveMQ(经典版,版本 5.15.9)。因此,我们正在调整现有的 JMeter(版本 3.1)测试以使用 ActiveMQ。在JMS Sampler中,属性已修改并设置如下:

  • 初始上下文工厂 =org.apache.activemq.jndi.ActiveMQInitialContextFactory
  • 上下文提供程序网址 = tcp://[MyHost]:61616
  • 队列连接工厂 = ConnectionFactory
  • 发送队列=queue.MyApp.RequestQueue
  • 接收队列=queue.MyApp.ResponseQueue

尽管如此,我在 JMeter 日志中收到以下错误(即使功能测试适用于 ActiveMQ 独立版和队列):

ERROR - jmeter.protocol.jms.sampler.JMSSampler: queue.MyApp.RequestQueue javax.naming.NameNotFoundException: queue.MyApp.RequestQueue

at org.apache.activemq.jndi.ReadOnlyContext.lookup(ReadOnlyContext.java:235)

at javax.naming.InitialContext.lookup(InitialContext.java:417)

at org.apache.jmeter.protocol.jms.sampler.JMSSampler.threadStarted(JMSSampler.java:337)

at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:659)

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:628)

at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:616)

at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:245)

at java.lang.Thread.run(Thread.java:745)

有什么想法我可能错过了什么吗?

最佳答案

您需要配置JMS Point-to-Point Sampler有点不同,即:

  1. JNDI 名称请求队列:Q.REQ
  2. JNDI 名称接收队列:Q.RSP
  3. 添加以下 JNDI 属性:

    • queue.Q.RSP,值为 queue.MyApp.ResponseQueue
    • queue.Q.REQ,值为 queue.MyApp.RequestQueue

完整配置以防万一:

enter image description here

更多信息:Building a JMS Testing Plan - Apache JMeter

演示:

enter image description here

关于java - 使用 ActiveMQ 的 JMeter JMS 点对点采样器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59733419/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com