Author |
Message
|
wilfred |
Posted: Wed May 11, 2016 12:38 pm Post subject: Browsing message from IBM MQ - output hold/inhibited |
|
|
Novice
Joined: 11 May 2016 Posts: 12
|
Hello All,
I am kind of new to IBM MQ management. I have 2 queries. I request you to kindly throw some light on them.
1. Is it possible to read/browse/Get message from a Queue, which is inhibited/Output set on hold?
Please give me a sample java code to do it.
2. How to handle the above scenario in an application where an related MDB is running and we do not want the MDB to consume the same message being read/browsed.
Please give your inputs. I will be very thankful.
Thanks. |
|
Back to top |
|
 |
hughson |
Posted: Wed May 11, 2016 2:02 pm Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
Hi Wilfred,
Welcome to the MQ forum.
I'm not sure if I'm understanding exactly what you meant by "output set on hold" but I'm going to answer your question assuming you mean GET(DISABLED). If that's not what you meant, please post another comment and I'll try to understand better.
If a QLOCAL is set to GET(DISABLED) there is no way around that. You cannot successfully browse or get messages from that queue.
However, you can stop one application from getting from a queue (for example your MDB) while another application can get, by using alias queues.
If the queue your MDB was configured to use was a QALIAS that pointed at your QLOCAL, then the QALIAS could be set to GET(DISABLED) whilst the QLOCAL was still GET(ENABLED) therefore allowing you to take a look at the messages without the MDB getting in there at the same time.
Cheers
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
 |
wilfred |
Posted: Wed May 11, 2016 10:59 pm Post subject: |
|
|
Novice
Joined: 11 May 2016 Posts: 12
|
Hi Hughson,
Thanks a lot for your reply.
Yes, your were right about the point GET(DISABLED) on the Queue.
I really appreciate your suggestion here Hughson. But we have a limitation in our application. We cannot make use of an QALIAS option due to other client specific reasons.
You also rightly mentioned about the requirement that the MDB should not be able to access this queue during my browse process.
Can we not have some kind of LOCK on the QLOCAL queue during the browse process so that the MDB designed for this queue does not process it during my GET activity?
Thanks,
Wilfred. |
|
Back to top |
|
 |
hughson |
Posted: Thu May 12, 2016 2:01 am Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
You can make use of MQOO_INPUT_EXCLUSIVE but that does leave you battling with the MDB to get that lock. If the MDB already has the queue open, you can't get the exclusive lock. is it not possible to stop the MDB running?
I cannot imagine what your reasons for being unable to use alias queues are. It is rare for an application to care.
Could you elaborate on the problem you are trying to solve? Perhaps there are other solutions this group can offer that don't require you locking out the MDB.
Cheers
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
 |
wilfred |
Posted: Thu May 12, 2016 2:54 am Post subject: |
|
|
Novice
Joined: 11 May 2016 Posts: 12
|
Hi Hughson,
Yes, Please find the below problem I am trying to resolve.
1. There are 300+ QLOCALs queues existing in the IBM MQ configured for this application.
2. All these are also accessible through the application through a GUI. Which simply means, an end user of the app will be able to see list of Queues in his web page.
3. As per the requirement, after the user post a message to a particular queue, he/she should be able to browse it before the MDB processes it.
4. Since the MDB's are also configured and running in the server, the user is provided with a UI feature to put a output hold (Get disabled) on a particular queue.
5. The user will browse the message, and then release the output hold (GET enabled) so that the same can be processed by the MDB.
6. In the current code, during the time the user browses the message, programmatically the GET is enabled and disabled.
7. Within this small fraction of a second, the MDB starts processing this message and the message is removed from the queue. Which the User does not want this to happen.
8. In short the user wants to have the control on the messages as explained above.
To answer your question regarding alias queue:
We have around 300+ queues. The client will not accept to create alias queues for all of them.
Hughson, Please let me know if you have any further clarifications required on the above points.
Thanks,
Wilfred |
|
Back to top |
|
 |
mqjeff |
Posted: Thu May 12, 2016 4:12 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
wilfred wrote: |
3. As per the requirement, after the user post a message to a particular queue, he/she should be able to browse it before the MDB processes it. |
The MDB will process it immediately. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
Vitor |
Posted: Thu May 12, 2016 5:01 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
wilfred wrote: |
Please find the below problem I am trying to resolve. |
The problem is your design is trying to use MQ as a workflow and it just isn't a workflow solution. It's messaging software.
The user performs some kind of process which results in a message on a queue, which then needs to be reviewed by the same or a different user before being released for processing. That's a workflow process. MQ is intended, designed and written to move messages and make them available as fast as possible. So once they've been committed to the queue, MQ believes that they are to be processed and presents them to the first authorized process that asks for them.
What you need is to write the messages to a separate queue and for this GUI to move them to the queue the MDB is processing once the user indicates he's reviewed the message and is happy with it.
This is going to be less popular that using alias queues.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
wilfred |
Posted: Thu May 12, 2016 8:09 am Post subject: |
|
|
Novice
Joined: 11 May 2016 Posts: 12
|
Vitor wrote: |
wilfred wrote: |
Please find the below problem I am trying to resolve. |
What you need is to write the messages to a separate queue and for this GUI to move them to the queue the MDB is processing once the user indicates he's reviewed the message and is happy with it.
This is going to be less popular that using alias queues.  |
Thanks Vitor.
This verification process is not mandatory. If the user feels he/she needs to verify, the option will be given to them. So I do not consider this like a workflow. It may not be technically possible, but the requirement is very simple. "The user will want to browse a message in MQ which is already configured for an MDB"
One strange point I would like to mention here is, This specific requirement or the scenario is working perfectly fine in an legacy environment where the IBM MQ version is 7.0, EJB 2.x, Weblogic 10 combination. Today we have migrated the same application to IBM MQ 7.5, EJB 3.2 and Weblogic 12.1.3. Application is not working as expected on this new STACK.
Thanks and Regards,
Wilfred. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu May 12, 2016 8:14 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
wilfred wrote: |
"The user will want to browse a message in MQ which is already configured for an MDB" |
The user will have to stop the MDB. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
Vitor |
Posted: Thu May 12, 2016 9:23 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
wilfred wrote: |
This specific requirement or the scenario is working perfectly fine in an legacy environment where the IBM MQ version is 7.0, EJB 2.x, Weblogic 10 combination. |
It shouldn't be. There's certainly no changes in this very basic MQ behavior between 7.0 & 7.5.
wilfred wrote: |
This verification process is not mandatory. If the user feels he/she needs to verify, the option will be given to them. |
So what do you do if the message is put to a near-empty queue and then a few moments later (overcome with uncertainty) the user feels they need to verify it? The MDB has almost certainly already consumed the message so it can't be browsed because it's just plain gone. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu May 12, 2016 9:35 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Perhaps the message should be put to the queue in a UofW, but not committed until the user verifies it. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
Vitor |
Posted: Thu May 12, 2016 10:10 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
bruce2359 wrote: |
Perhaps the message should be put to the queue in a UofW, but not committed until the user verifies it. |
Can you browse an uncommitted message? From an application separate to the one doing the put?
How is this working under v7.0? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu May 12, 2016 11:33 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
|
Back to top |
|
 |
bruce2359 |
Posted: Thu May 12, 2016 11:41 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Vitor wrote: |
bruce2359 wrote: |
Perhaps the message should be put to the queue in a UofW, but not committed until the user verifies it. |
Can you browse an uncommitted message? From an application separate to the one doing the put?
How is this working under v7.0? |
The OP is not very clear about which bean is doing what. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
wilfred |
Posted: Thu May 12, 2016 11:58 am Post subject: |
|
|
Novice
Joined: 11 May 2016 Posts: 12
|
Hi All,
I thank all of you for thinking through this issue i am facing.
I just want to know if I can get this resolved with the options we have in hand.
Can one of you let me know the usage of MQGMO_LOCK and MQC.MQOO_INPUT_EXCLUSIVE. Can one of these help me in this case?
Can I paste the code here to see if we can integrate one of these?
Regards,
Rajan.S |
|
Back to top |
|
 |
|