How to send JMSType in jmeter - jms

I am trying to send jms message with JMeter (Publisher or Point-to-point), but I am not able to send JMSType.
If I put it to JMS properties with name JMSType it finishes with error:
Response message: The property name 'JMSType' is illegal since it starts with JMS

By default Jmeter does not include any JMS implementation jars in its distribution. This must be downloaded from the JMS provider and put in the lib directory of Jmeter.
I have tested this in Jmeter 2.9 and 2.13. You can set JMS header properties including JMSType in the JMS properties tab and publish a message successfully without any errors.

So the answer is no it is not possible. I've changed it in jMeter sources for me. It is probably specific for queue vendors. Any of them allow setting properties as text property the others requires to set it directly to message as there is the JMSType parameter and when you try to set the string 'JMS*' parameter tou got exception.

Related

How to send MQ messages (JMS) using JMeter

I have to put messages in a queue for which I have all the connection details (host, port, channel, manager, queuename and username). I never worked on implementing JMeter for sending MQ. Can anyone let me know where can I get (blog or reference) step by step procedure to perform this? I tried referring to official site, can't really understand those JNDI, connection Factory settings
Man, your MQ statement is too general as there are too many possible message queue system providers like Apache ActiveMQ, RabbitMQ, IBM MQ, TIBCO, etc. and the values for all these JNDI/JMS properties, connection factory names, queue names, etc. will be different.
To get an overview of Java communication with "MQ" get familiarized with Getting Started with Java Message Service (JMS)
Download .jar files for your MQ system and put them to JMeter Classpath
Perform configuration as per your MQ system connection settings, example setup for Apache ActiveMQ is here: Building a JMS Testing Plan - Apache JMeter

WSO2 ESB JMS listener configuration at runtime

I am trying to add new parameter from WSO2 admin console Transport Management -> JMS Listener screen (don't want to use axis2.xml as I want updates to be used by proxy services without re-starting servers - hope this is possible ?). While adding new parameter I am getting following error -
Error while initializing JMS listener
java.lang.String cannot be cast to org.apache.axiom.om.OMElement
Can you please advise what should be the format of parameter value. I am trying to add similar value as available under "default" or "myQueueConnectionFactory".
I tested your scenario and this seems to be a bug with ESB. Go to JMS Listener Configuration and click on Update without any change to the default parameter values. Even then the same error is thrown. So I have reported this issue at https://wso2.org/jira/browse/ESBJAVA-2412.
Unfortunately for now you will have to configure the parameters through axis2.xml until this issue is fixed. You can enable/disable the listeners through management console without any issue.

jms point to point or JMS publisher and subscriber

I am a novice user for jmeter.
In my company i need to do load testing. I am using Hermes JMS to send request and response using the queues. So what should I use in jmeter, jms point to point or JMS publisher and subscriber. And I also want to set up the ftp location to get the files.
I tried both of those but getting the error in jndi properties:
"ERROR - jmeter.protocol.jms.sampler.JMSSampler: org.apache.activemq.jndi.ActiveMQInitialContextFactory javax.naming.NameNotFoundException: org.apache.activemq.jndi.ActiveMQInitialContextFactory"
I am not exactly sure how can I set up the queues that I am using in hermes.
How can I setup the JNDI settings? Or its default because I was reading online and everyone has Initial Context Factory as org.apache.activemq.jndi.ActiveMQInitialContextFactory and what about the queues do I need to provide my own queues or that's the default as well?
If you are using queues, you'll want to use JMS point to point. JMS publisher and subscriber uses JMS topics. If the queues already exist in ActiveMQ (and they appear to since you can see them in Hermes), you'll need to configure JMeter to use those. It sounds like your JNDI settings are incorrect and JMeter cannot find the JNDI name you're telling it to look for.
Regarding the 2nd part of your question: when using a JMS Publisher, you can use the dynamicQueues/ prefix for your destination when creating queues, dynamicTopics/ for topics, e.g. dynamicQueues/my.testqueue
You need to make sure that you have the 'activemq-all-[version].jar' file in the lib folder of JMeter so that when you set the 'Initial Context Factory' property to 'org.apache.activemq.jndi.ActiveMQInitialContextFactory' (as well as the 'QueueConnection Factory' resource to 'ConnectionFactory') in the JMS Sampler the latter is found and initiated by JMeter.

Websphere equivalent for Weblogic bridge level message filter

In weblogic it is possible to create a message bridge between two JMS message queues. While configuring this bridge, a message filter can be applied so that the bridge will route messages that match the filter only.
Is it possible to achieve the same with Websphere?
Specifically I'm trying to achieve this scenario.
I have one source queue on which messages are received. Each message will have a custom JMS property set up. I would like to forward the messages on the source queue, to separate queues based on the JMS property and its value. This is easily configured in WLS using message bridges with filtering. How can I do the same in WAS?
Thanks
Savio
You need to use SIB Mediation.
The WAS info center have an example called writing a routing mediation which seems like what you need.
At the bottom of the example there is a link to what to do next which also explains how to configure WAS to use that mediation.
Without writing custom code (as per your comment on Aviram's answer), it is not possible to achieve the exact same thing, but nonetheless it is possible to achieve same effect;
You say that a 'source queue' distributes messages to other 'separate queues' according to a custom JMS property. I'm assume that you have MDBs (message driven beans) configured to process messages in these separate queues.
What you can do with WebSphere is distribute messages to these MDBs directly from the 'source queue', without having to filter/distribute them to separate queues.
This is managed by using JMS Message Selectors. You can point all your MDBs to the source queue using activation specification definitions, and for each (one for each type of message) MDB, define a JMS Message Selector that matches the ones you use in WLS. This way each message is only delivered the MDB whose filter matches the message's properties. This effectively filters/distributes messages to different MDB's as in WLS.
You may read details on configuring message selectors (during development in RAD, or at/after deploy time) at infocenter. Below is a quote to give you an idea about what it look like;
messageSelector
This attribute determines the JMS message selector
that is used to select which messages the message-driven bean
receives. For example:
JMSType='car' AND color='blue' AND weight>2500
The selector string can refer to fields in the JMS message header and
fields in the message properties. Message selectors cannot reference
message body values.
For the record, we finally ended up writing our own routing algorithm within the application to ensure that messages are sent to separate queues for each client. This way we are independent of app server implementations and the integration effort is the same across app servers, viz., adding custom queues per integrating client.
In brief, We published a JMS custom property that must be set. Using a published convention, we look up for a queue and send responses to the queue. If the property is not set, a default queue is created to route all messages. If the property is set, and the queue cannot be found an exception is raised and processing halted.
This suited our purpose. Hope it helps...

JMS Point-to-Point in jmeter

Reg: JMeter Point-to-Point
Could you please tell how to get the QueueConnnectionFaction
And ContextConnectionFactory
Can anyone help me in configuring JNDI properties in JMS POINT-TO-POINT of JMETER
ERROR - jmeter.protocol.jms.sampler.JMSSampler: progress/message/jclient/TopicConnectionFactory java.lang.NoClassDefFoundError: progress/message/jclient/TopicConnectionFactory
Please provide some solution.
It seems you didn't put a dependency jar from your jms provider, see:
java.lang.NoClassDefFoundError: progress/message/jclient/TopicConnectionFactory
The QueueConnnectionFactory is the container of the queues that is created before the queues. I used to use the Hermes JMS application to get this information but you could get it from WebLogic too.
For example, the next image shows my configuration, using the information of binding for the QueueConnectionFactory field, and using the information of initialContextFactory for the InitialContextFactory field, and do not forget to use the providerURL in the ProviderURL field.
In this example I am not getting the response. For this reason, I am only putting the name of my requester queue.
Ensure that the information is correct. In the JMS Properties you could use Headers for the request.

Resources