Hello Max, thank you for you videos and your effort! I have make the set up with the docker and the simple example works fine. I want to go a bit further to use JNDI. At the past i have used Active MQ and the process to use the JNDI is straight forward. I am not sure how to use the JNDI with the IBM MQ and i am struggling with the documentation. With the Active MQ the queue or the topic you use if not exists created on the fly, can we do the same with the IBM MQ also. Thank's in advance.
Hi Manolis, glad the docker setup is working for you. You can create MQ objects on the fly as you say, like with ActiveMQ. IBM MQ supports AMQP, like ActiveMQ, so you can use the same API to send your messages. UA-cam won't let me send a link but you can search for for a tutorial that offers some help with doing that in Java: "ibm developer mq jms quarkus" and the tutorial is the one on the IBM Developer site. The quarkus project also have a tutorial on using JMS with AMQP, the example uses ActiveMQ but it's an easy swap to change the ActiveMQ container out for the MQ one you just set up. There's a lot to dig into your question so I would suggest that if you need more help, please raise this question on stackoverflow with the tag [ibm-mq] and show us some of your code. Good luck!
Hi Prasanth, it seems Max's reply to you was not published. We apologize for the delay. This tutorial should help you: developer.ibm.com/tutorials/configuring-mutual-tls-authentication-java-messaging-app/
Hi Vishal, it could be that your queue manager isn't running, or you haven't set the destination to be one of your existing queues. If you want more help, please raise your question on StackOverflow, share your code and give it the tag [ibm-mq] and we will be able to help you out some more!
Hello Max nice tutorial Thanks!! Can you please help me - I want to read messages from queue so I need to use createconsumer method so how should I read messages asynchronously?
Hi Ganesh, good question. Typically you'd put messages with one application, then get them with another application. This process in MQ is asynchronous because you can put the messages whenever you like, and the application that gets them can get them whenever it wants to as well - so this is taken care of. After you've used the createConsumer method, you might follow it with a call to the consumer.receiveBody() method. If you want some example code in Java, have a look at the link in the description or at our mq-dev-patterns repo (it doesn't like my links). Good luck with it!
Hello Max. Thanks for your video. Could you please explain how can I get some specific messages from the queue? For example, I have 10 messages in the queue and I want to get the fifth message. I use Java (maybe you have a code example on GitHub? ). Thanks in advance.
Hi Serhii, Thanks for watching. I'm not sure of your use case exactly, as looking for a specific-numbered message wouldn't typically be what we see in production. MQ does provide options to specify which messages you want to get, usually using the message ID or correlation ID (see here for more info www.ibm.com/docs/en/ibm-mq/9.2?topic=queue-getting-particular-message). You can also get messages by the group ID of the application that put the message. The default is first-in, first-out but setting these properties on your MQ message descriptor will change the behaviour. The other option if you want your application to get specific messages meant for it would be to put those messages onto a different queue, and have your app get those messages from the other queue. This is another valid and realistic use case that we see. Hopefully some of this helps, if not and you have a specific problem to solve, please raise it on stackoverflow.com with the tag [ibm-mq] and some of our experts will be able to help you there! Good luck with it!
Thx for the answer Max. This is helpful. But I have another question :) I am not able to send messages to the topic, I used your instructions and run the docker image. I am able to send messages to the queue DEV.QUEUE.1 (context.createQueue("queue:///" + DEV.QUEUE.1 )), but I am not able to send messages to the topic DEV.BASE.TOPIC (I use context.createTopic("topic://" + DEV.BASE.TOPIC);)
Hi again. Without seeing your code it's hard to know exactly what you're doing, but we have some sample code which implements a publisher with JMS in a similar way. I can't link it here because UA-cam thinks I'm posting spam so I will get my colleague at IBM Developer to link it below. Start with that code and see if you can find where things are going wrong. If you need more help, please show us your code by asking a question on Stackoverflow!
Hello Max, thank you for you videos and your effort!
I have make the set up with the docker and the simple example works fine.
I want to go a bit further to use JNDI. At the past i have used Active MQ
and the process to use the JNDI is straight forward.
I am not sure how to use the JNDI with the IBM MQ and i am struggling with the documentation.
With the Active MQ the queue or the topic you use if not exists created on the fly, can we do the same
with the IBM MQ also.
Thank's in advance.
Hi Manolis, glad the docker setup is working for you. You can create MQ objects on the fly as you say, like with ActiveMQ. IBM MQ supports AMQP, like ActiveMQ, so you can use the same API to send your messages. UA-cam won't let me send a link but you can search for for a tutorial that offers some help with doing that in Java: "ibm developer mq jms quarkus" and the tutorial is the one on the IBM Developer site. The quarkus project also have a tutorial on using JMS with AMQP, the example uses ActiveMQ but it's an easy swap to change the ActiveMQ container out for the MQ one you just set up.
There's a lot to dig into your question so I would suggest that if you need more help, please raise this question on stackoverflow with the tag [ibm-mq] and show us some of your code. Good luck!
Hi, I need to add truststore certs to the above code. How to add?
Hi, I replied to your other comment with a link!
Hi, I want to use this jms but in my case I need ssl to connect to queue. So what extra lines I need to add it to above code?
Hi Prasanth, it seems Max's reply to you was not published. We apologize for the delay.
This tutorial should help you: developer.ibm.com/tutorials/configuring-mutual-tls-authentication-java-messaging-app/
I'm getting an exception on the JMSDestination once I put the message..
What might be the reason.?
Hi Vishal, it could be that your queue manager isn't running, or you haven't set the destination to be one of your existing queues. If you want more help, please raise your question on StackOverflow, share your code and give it the tag [ibm-mq] and we will be able to help you out some more!
Hello Max nice tutorial Thanks!!
Can you please help me - I want to read messages from queue so I need to use createconsumer method so how should I read messages asynchronously?
Hi Ganesh, good question. Typically you'd put messages with one application, then get them with another application. This process in MQ is asynchronous because you can put the messages whenever you like, and the application that gets them can get them whenever it wants to as well - so this is taken care of.
After you've used the createConsumer method, you might follow it with a call to the consumer.receiveBody() method.
If you want some example code in Java, have a look at the link in the description or at our mq-dev-patterns repo (it doesn't like my links).
Good luck with it!
Good video, clear and practical. Thanks. 👍🏼
Thanks for watching! Hope it was helpful.
Hello Max. Thanks for your video. Could you please explain how can I get some specific messages from the queue? For example, I have 10 messages in the queue and I want to get the fifth message. I use Java (maybe you have a code example on GitHub? ). Thanks in advance.
Hi Serhii, Thanks for watching. I'm not sure of your use case exactly, as looking for a specific-numbered message wouldn't typically be what we see in production. MQ does provide options to specify which messages you want to get, usually using the message ID or correlation ID (see here for more info www.ibm.com/docs/en/ibm-mq/9.2?topic=queue-getting-particular-message). You can also get messages by the group ID of the application that put the message. The default is first-in, first-out but setting these properties on your MQ message descriptor will change the behaviour.
The other option if you want your application to get specific messages meant for it would be to put those messages onto a different queue, and have your app get those messages from the other queue. This is another valid and realistic use case that we see.
Hopefully some of this helps, if not and you have a specific problem to solve, please raise it on stackoverflow.com with the tag [ibm-mq] and some of our experts will be able to help you there! Good luck with it!
Thx for the answer Max. This is helpful. But I have another question :) I am not able to send messages to the topic, I used your instructions and run the docker image. I am able to send messages to the queue DEV.QUEUE.1 (context.createQueue("queue:///" + DEV.QUEUE.1 )), but I am not able to send messages to the topic DEV.BASE.TOPIC (I use context.createTopic("topic://" + DEV.BASE.TOPIC);)
Hi Serhii! Here is the link Max was referencing 👉 ibm.co/3jvbjQM
Hi again. Without seeing your code it's hard to know exactly what you're doing, but we have some sample code which implements a publisher with JMS in a similar way. I can't link it here because UA-cam thinks I'm posting spam so I will get my colleague at IBM Developer to link it below.
Start with that code and see if you can find where things are going wrong.
If you need more help, please show us your code by asking a question on Stackoverflow!