【问题标题】:JMeter JMS Point-to-Point Sampler with ActiveMQJMeter JMS 点对点采样器与 ActiveMQ
【发布时间】:2020-01-14 12:03:11
【问题描述】:

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

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

不过,我在 JMeter 日志中收到以下错误(即使功能测试与 ActiveMQ 独立和队列一起工作):

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

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

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

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

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

在 org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:996)

在 org.apache.jorphan.collections.HashTree.traverse(HashTree.java:978)

在 org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:628)

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

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

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

有没有想过我可能错过了什么?

【问题讨论】:

    标签: java jmeter activemq


    【解决方案1】:

    您需要稍微不同地配置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

    完整配置以防万一:

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

    演示:

    【讨论】:

    • 我似乎从其他来源找到了相同的信息。它具有确认解决方案的优势。谢谢
    【解决方案2】:

    我一直在寻找 https://www.tutorialspoint.com/jmeter/jmeter_jms_pointtopoint_test_plan.htm 以找到我的问题的解决方案。

    在本教程中,我设置:

    • 发送队列 = Q.REQ
    • 接收队列 = Q.RESP

    然后,我添加如下 JNDI 属性:

    • 名称 = queue.Q.REQ,值 = queue.MyApp.RequestQueue
    • 名称 = queue.Q.RESP,值 = queue.MyApp.RequestQueue

    还有,瞧!

    【讨论】:

      猜你喜欢
      • 2019-01-20
      • 1970-01-01
      • 2021-03-19
      • 2018-11-29
      • 2013-10-02
      • 1970-01-01
      • 2012-05-21
      • 1970-01-01
      • 2018-08-06
      相关资源
      最近更新 更多