Giter Site home page Giter Site logo

mqmeter's Introduction

mqmeter

MQ JMeter Extension.

A JMeter Plugin to put and get message on IBM MQ Queue, also publish message on Topic. It connect to MQ Server through server channel using ip address, port number, userID and password (if the channel has CHLAUTH rules).

Install

Build the extension:

mvn package

Install the extension mqmeter-x.y.z.jar into

`$JMETER_HOME/lib/ext`.

Also you can install it through JMeter Plugins, search "IBM MQ Support".

Screenshot

Usage

After installing mqmeter, you can choose two kind of Java Sampler, these are:

MQClientSampler

Use it to put and get message (optional) on MQ queue. On JMeter add a Java Request Sampler and select the MQClientSampler class name. The following parameter are necessary.

  • mq_manager: MQ Manager name. You can find it through IBM WebSphere MQ Explore or console.
  • mq_queue_put: MQ Queue name to put message. Could be Local or Remote queue.
  • mq_queue_get: MQ Queue name to get message. Could be Local or Remote queue. Leave it empty if you don't want get response message.
  • mq_correlate_msg: Correlate the response message with request message to get the right message from the queue. Put 'messageId' or 'correlationId' values. Leave it empty if you don't want get response message.
  • mq_wait_interval: Set wait interval that the get message call waits for a suitable message to arrive. Similar to time-out to get response message on queue.
  • mq_hostname: Host name or ip address where MQ Server is running.
  • mq_port: Port number of the MQ Server listener.
  • mq_channel: The Server channel name on MQ Server.
  • mq_user_id: The userID to connect to MQ server channel. Leave it empty if you don't need user id to connect to MQ.
  • mq_user_password: The user password to connect to MQ server channel. Leave it empty if you don't need user id and password to connect to MQ.
  • mq_use_mqcsp_authentication: The connection authentication used. Set false for Compatibility mode, or true for MQCSP authentication.
  • mq_encoding_message: Character encoding standard for your message: For EBCDIC put Cp1047. ASCII just put ASCII.
  • mq_message: The content of the message that you want.

Put & Get Message on Queue

Screenshot

Put Message on Queue

Screenshot

MQPublishSampler

MQ can manage topics also and you can publish and subscribe to it, use this class to publish message on MQ Topic. On JMeter add a Java Request Sampler and select the MQPublishSampler class name. The following parameters are necessary.

  • mq_manager: MQ Manager name. You can find it through IBM WebSphere MQ Explore or console.
  • mq_topic: MQ topic name to publish message.
  • mq_hostname: Host name or ip address where MQ Server is running.
  • mq_port: Port number of the MQ Server listener.
  • mq_channel: The Server channel name on MQ Server.
  • mq_user_id: The userID to connect to MQ server channel. Leave it empty if you don't need user id to connect to MQ.
  • mq_user_password: The user password to connect to MQ server channel. Leave it empty if you don't need user id and password to connect to MQ.
  • mq_encoding_message: Character encoding standard for your message: For EBCDIC put Cp1047. ASCII just put ASCII.
  • mq_message: The content of the message that you want.

Screenshot

IBM WebSphere MQ

The below images show where find the values for some of the above properties

  • MQ Manager

Screenshot

  • MQ Server channel

Screenshot

  • MQ Server listener

Screenshot

  • MQ Chlauth

You can find the steps to add users access to MQ Manager through Channel Authentication (CHLAUTH) with this tutorial IBM CHLAUTH

Screenshot

Troubleshooting

When use the MQPublishSampler Java Sampler is possible that you get the below exception:

java.lang.NoSuchMethodError: com.ibm.mq.MQQueueManager.accessTopic(Ljava/lang/String;Ljava/lang/String;II)Lcom/ibm/mq/MQTopic; at co.signal.mqmeter.MQPublishSampler.setupTest(MQPublishSampler.java:123) ~[mqmeter-1.4.jar:?] at org.apache.jmeter.protocol.java.sampler.JavaSampler.sample(JavaSampler.java:194) ~[ApacheJMeter_java.jar:3.3 r1808647] at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:498) ~[ApacheJMeter_core.jar:3.3 r1808647] at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:424) ~[ApacheJMeter_core.jar:3.3 r1808647] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255) ~[ApacheJMeter_core.jar:3.3 r1808647] at java.lang.Thread.run(Unknown Source) [?:?]

It is throw because there is com.ibm.mq* jar file that is upload by JMeter and it does not have the methods related with topic or other MQ objects. It jar file isn't related with mqmeter plugin but JMeter calls it first.

Checking JMeter lib and ext folders to remove com.ibm.mq* jar files that do not have methods or mq topic objects.

mqmeter's People

Contributors

joseluissr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mqmeter's Issues

How I can send Named Paramaters

Is there a way I can send Named parameters with mq message. Someting that can be send through code like
msg.setStringProperty("test", "testname").

Thanks for this Plugin

binary message

Hi,
I follow your Put example however within mq web console the messages are shown as 'binary messages'. Interesting, within MQ Explorer they are shown as text.

Thanks Tom.

Setting Connection Factory Properties

Great Library - Just what we are looking for.

Could you add a possibility to set the SSL_CIPHER_SUITE_PROPERTY property for the connection factory?

mqmeter - read messages

Hi Jose,

Hope you are well.

Thanks for the awesome plugin. Is there any way I could just read the messages from the queue. If I understand it correctly the mq_queue_put, mq_message fields are mandatory even just for reading the messages. Is there any alternate approach to this?

Thanks,
Saviour

Confused about jar install

Hi Jose,

I think I’m confused about your mqmeter install.
What am I supposed to install in ./lib/ext?

When I unzip contents, I don’t find any jar files to place into ext folder, just some java.

In any event, jmeter complains about script...
Error creating class:’co.signal.mqmeter.MQClientSampler’ in JavaSampler Put/Get message, check for a missing jar in your jmeter ‘search paths’ and ‘plugin_dependency_paths’ properties.........classnotfoundexception: co.signal.mqmeter.MQClientSampler...

Windows userId is used instead the configured userId in the plugin

When I execute the script with the configured plugin for putting a message on a queue, I get the error:
2020-01-13 16:52:19,443 INFO c.s.m.MQClientSampler: setupTest MQJE001: Completion Code '2', Reason '2035'. MQRC_NOT_AUTHORIZED

I pulled your code and added console logging for username and password and I see that the correct ones are used.
However, I installed Wireshark to see what the traffic is, and then I suddenly see that my Windows username is used.
Any ideas?

re-use queue opened to send multiple messages without open/close queue each time

Thanks for a great plugin. It saves a lot of time for playing with what was available so far.
Here goes my request for improvement of existing solution: can you implement re-using queues instead open/close for each sample? That will make sending/receiving messages over same queue faster.

It can be smth. like "open queue sampler", that gives the reference to the queue as a variable, that can be re-used by other samplers for sending messages and for sampler closing the queue when scenario is done.

So it could be flow similar to:

  • use 1st sampler to open communication:

     mqQueue = mqMgr.accessQueue(mq_Queue, MQConstants.MQOO_OUTPUT); 
    

    then pass mqQueue as variable (object)

  • use it for sending messages

  • use it to conclude and close in the scenario end

     mqQueue.close();  
    

MQ_encoding_Message

Hello, sir, I used this plug-in to put a message from windows system to AIX system which is installed MQ server,I knew the remote MQ server of AIX was implemented encoding 273 and charset 819,but I always get a wrong response.It seems like I didn't set appropriate parameter in ${MQ_ENCONDING_MESSAGE},do you have any idea about solving this condition?

thank you in advance

MQRC_NOT_AUTHORIZED

When trying to execute the sampler I get the following error:
MQJE001: Completion Code '2', Reason '2035'. MQRC_NOT_AUTHORIZED

I tried with other IBM MQ clients and the message is correctly posted, no authorization errors.
Have you any idea why is this happening?

Plugin is not registered

Hi,
I built the jar, included it in lib/ext and restarted jmeter but I do not see it included it in the list of samplers - am i missing something ? thanks Tom
ps tried on both pc and mac (jmeter 5.3)

Not able to provide format

hello i want to add a custom parameter mq_Format but its not working i seea open PR as well. how can we do that

Queue manager connections not getting automatically closed

I was able to successfully connect to MQ Queue manager using MQClientSampler but I observed connection count on queue manager keeps going up and in my case it end up in queue manager becoming unresponsive. Hence it seems connection is not getting closed while using this sampler.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.