简体   繁体   English

JMeter JMS订阅者如何从主题读取BytesMessage

[英]JMeter JMS subscriber how to read a BytesMessage from the topic

In my Jmeter scenario have to receive a BytesMessage from a JMS tpoic in ActiveMQ and alter it a bit and push back to another topic ans a BytesMessage. 在我的Jmeter场景中,必须从ActiveMQ中的JMS tpoic接收BytesMessage并对其进行一些更改,然后再推回另一个主题,然后再返回BytesMessage。

I was using JMS subscriber and Publisher for this. 我为此使用了JMS订阅服务器和发布服务器。

Using JMS Subscriber I was able to receve the message from the topic, but could not find a way to read it so that I can work on it to alter. 使用JMS订阅服务器,我可以从主题中接收消息,但是找不到读取消息的方法,因此可以对其进行更改。

My sampler looks like follows. 我的采样器如下所示。

在此处输入图片说明

When I run this I can receive the message from the topic. 当我运行此程序时,我会收到来自该主题的消息。

在此处输入图片说明 在此处输入图片说明 在此处输入图片说明

This says that there is a ByteMessage of 212 bytes, how can I capture this message , and use it to build my next request ? 这表示有一个212字节的ByteMessage,如何捕获此消息,并使用它构建下一个请求?

If you want to capture full response of the sampler into a JMeter Variable go for the next steps: 如果要将采样器的完整响应捕获到JMeter变量中,请继续以下步骤:

  1. Add Regular Expression Extractor as a child of your request 正则表达式提取器添加为您的请求的子代
  2. Configure it as follows: 如下配置:

    • Reference Name: anything meaningful, ie response 参考名称:任何有意义的,即response
    • Regular expression: (?s)(^.*) 正则表达式:( (?s)(^.*)
    • Template: $1$ 模板: $1$

      Explanation: 说明:

      () = grouping () =分组

      (?s) = single line modifier (?s) =单行修饰符

      ^ = line start ^ =行首

      . = wild-card character =通配符

      * = repetition * =重复

  3. That's it, now you will have the whole response saved into a JMeter Variable , you will be able to refer it as ${response} or ${__V(response)} where required 就是这样,现在您将整个响应保存到JMeter变量中 ,可以在需要时将其引用为${response}${__V(response)}

More information: 更多信息:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从JMeter JMS用户响应主体中提取和比较字节 - How to extract and compare bytes from JMeter JMS Subscriber Response Body 如何使用 JMS Publisher 和 JMS Subscriber 为 JMeter 中的订阅者过滤来自 ActiveMQ 的响应消息 - How to filter response messages from ActiveMQ for subscribers in JMeter using JMS Publisher and JMS Subscriber 如何在带有JMeter JMS订阅服务器的JMS选择器中使用随机变量 - How to use Random Variables in JMS Selector with JMeter JMS Subscriber JMeter JMS订户:如何计算每个样本所花费的时间? - JMeter JMS Subscriber : How is the time taken by each sample is calculated? JMeter无法使用JMS订阅服务器读取消息,给我404状态代码作为响应 - JMeter cannot read messages using JMS Subscriber, giving me 404 status code as a response 尝试在jmeter中使用jms发布者/订阅者连接到IBM MQ - Trying to use jms publisher/subscriber in jmeter to connect to IBM MQ Jmeter - JMS Publisher - 如何从 XML 请求中获取值 - Jmeter - JMS Publisher - How to get the value from XML request 具有Websphere MQ的JMeter JMS发布者/订阅者遇到javax.naming.NamingException - JMeter JMS Publisher/Subscriber with Websphere MQ experiencing javax.naming.NamingException 如何使用 JMeter 发送 MQ 消息 (JMS) - How to send MQ messages (JMS) using JMeter 如何从jmeter的标题中读取值? - How to read a value from header in jmeter?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM