Asanke
Asanke

Reputation: 601

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.

I was using JMS subscriber and Publisher for this.

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.

My sampler looks like follows.

enter image description here

When I run this I can receive the message from the topic.

enter image description here enter image description here enter image description here

This says that there is a ByteMessage of 212 bytes, how can I capture this message , and use it to build my next request ?

Upvotes: 0

Views: 789

Answers (1)

Dmitri T
Dmitri T

Reputation: 168122

If you want to capture full response of the sampler into a JMeter Variable go for the next steps:

  1. Add Regular Expression Extractor as a child of your request
  2. Configure it as follows:

    • Reference Name: anything meaningful, i.e. response
    • Regular expression: (?s)(^.*)
    • Template: $1$

      Explanation:

      () = grouping

      (?s) = single line modifier

      ^ = 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

More information:

Upvotes: 1

Related Questions