Please could you add in the publisher JMS sample, the possibility to send a message text as ByteMessage. Like something like this : public BytesMessage publish(String text, String destinationName, Map<String, String> properties) throws JMSException, NamingException { byte[] bArray = text.getBytes("UTF-8"); BytesMessage bmsg = session.createTextMessage( bArray ); Utils.addJMSProperties(bmsg, properties); if (staticDest || destinationName == null) { producer.send(bmsg); } else { Destination dest = Utils.lookupDestination(ctx, destinationName); producer.send(dest, bmsg); } return bmsg; } Thx in advance.
Date: Fri Jan 4 21:06:46 2013 New Revision: 1429128 URL: http://svn.apache.org/viewvc?rev=1429128&view=rev Log: Bug 54182 - Support sending of ByteMessage for JMS Publisher. Bugzilla Id: 54182 Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/util/JLabeledRadioI18N.java jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/Publisher.java jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPublisherGui.java jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/PublisherSampler.java jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/SubscriberSampler.java jmeter/trunk/xdocs/changes.xml
Date: Fri Jan 4 21:14:14 2013 New Revision: 1429130 URL: http://svn.apache.org/viewvc?rev=1429130&view=rev Log: Bug 54182 - Support sending of ByteMessage for JMS Publisher. Default to text message Bugzilla Id: 54182 Modified: jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPublisherGui.java Date: Fri Jan 4 21:14:57 2013 New Revision: 1429131 URL: http://svn.apache.org/viewvc?rev=1429131&view=rev Log: Bug 54182 - Support sending of ByteMessage for JMS Publisher. Screenshots Bugzilla Id: 54182 Modified: jmeter/trunk/docs/images/screenshots/jmspublisher.png jmeter/trunk/xdocs/images/screenshots/jmspublisher.png jmeter/trunk/xdocs/usermanual/component_reference.xml Date: Fri Jan 4 21:21:19 2013 New Revision: 1429133 URL: http://svn.apache.org/viewvc?rev=1429133&view=rev Log: Bug 54182 - Support sending of ByteMessage for JMS Publisher. Update docs Bugzilla Id: 54182 Modified: jmeter/trunk/xdocs/usermanual/component_reference.xml
I've try this patch but it doesn't work, I obtain this message : java.lang.IllegalArgumentException: n must be positive JMeter expect to find directly in the file a byte message ?
Hello, Did you try the nightly build or applied the patch yourself ? Yes file is supposed to contain the bytes that will be put in BytesMessage. Can you show the full Stacktrace or attach jmeter.log ?
I've try the nightly build. I think the problem came from my message source. Indeed I thought that JMeter could transform my message text directly in byte message... Like SoapUI do, with the option "Send as ByteMessage" My message is a simple xml file like : <message> <VersionMsgMonitoring>V1.0</VersionMsgMonitoring> <TypeMsgMonitoring>1</TypeMsgMonitoring> <QueueManager>QTPATL</QueueManager> <Curdepth>0</Curdepth> </message>
Can you attach your Test Plan and test message, I am not sure to understand
Created attachment 29823 [details] Message to send
Created attachment 29824 [details] Test Plan
Hello, In the Test Plan you submitted you are not using Bytes Messages. You checked : - Random File from folder specified below - Text Message I tested, it works for me. I renamed the message file with extension .dat, and checked Bytes Messages and it also works.
Created attachment 29825 [details] Test plan showing it works
If issue is still here for you, please attach jmeter.log
Created attachment 29826 [details] Test plan showing it works
Created attachment 29827 [details] Test plan showing it works
Indeed the issue came from an old librairie which was lying in my lib directory. (i.e commons-io-1.4.jar )and that doesn't provide the "toByteArray(InputStream input, long size)" method Sorry again, and very thanks for adding this function which will be very usefull for me !
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2991