Bug 54434 - Add possibility to save ByteMessage content in the sample result.
Summary: Add possibility to save ByteMessage content in the sample result.
Status: REOPENED
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: unspecified
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-16 14:07 UTC by mchassagneux
Modified: 2016-08-05 15:27 UTC (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mchassagneux 2013-01-16 14:07:58 UTC
Since Bug 54182, JMeter is able to handle ByteMessage for JMS sample. 
But when I read a message in this format, the content is not save, I can just read this message : 

 "XX bytes received in BytesMessage"

So, could you please add in the sample result object, the real content of the ByteMessage like this :

// copy data into a byte[] array
int dataSize = (int) msg.getBodyLength();
byte[] array = new byte[dataSize];
msg.readBytes(array , dataSize);

[...]

result.setResponseData( array );

The goal of this, is to send later the message (or save into a file )

Thanks  !
Comment 1 mchassagneux 2015-07-24 08:27:42 UTC
Fix in 2.11
Comment 2 dan.dg 2015-09-28 23:28:07 UTC
(In reply to maxime.chassagneux from comment #1)
> Fix in 2.11

Hi maxime,

Was this issue fixed? I can't seem to see the commit for this ticket in GIT. I am currently using Jmeter to subscribe to Websphere MQ and getting that "xx bytes received in BytesMessage" response data.

Thanks in advance for the reply mate.

Cheers!
Dan
Comment 3 Sebb 2015-09-29 10:10:01 UTC
Have you enabled the "Read Response" checkbox?

This is badly named and not well documented, but it controls whether or not the response data ia saved in the sample result.
Comment 4 dan.dg 2015-09-29 23:31:55 UTC
(In reply to Sebb from comment #3)
> Have you enabled the "Read Response" checkbox?
> 
> This is badly named and not well documented, but it controls whether or not
> the response data ia saved in the sample result.

Hi Sebb,

Yes it is enabled, if i disable it , response data shows blank.
Comment 5 Sebb 2015-09-30 09:14:39 UTC
OK, I see now.

A BytesMessage is a stream of uninterpreted bytes; it is up to the sender and receiver to agree on what the interpretation is. There's no way that JMeter can know this.

JMeter currently does not attempt to store the response.

It could just store the raw bytes as a binary response, but the data would not be stored in any log file (only text responses are stored).

You would need to provide a Post-Processor or Listener to handle the data.
Comment 6 Sebb 2015-09-30 10:32:44 UTC
Note that the SubscriberSampler can aggregate multiple messages.
These are currently appended to the response.

It would not make sense to mix binary responses, so storing a binary response would only be possible if the aggregate count is set to 1.