Author |
Message
|
Goodfellas |
Posted: Mon Feb 22, 2010 3:29 pm Post subject: any |
|
|
Acolyte
Joined: 26 Feb 2009 Posts: 70
|
Hello,
Last edited by Goodfellas on Tue May 28, 2013 12:03 pm; edited 2 times in total |
|
Back to top |
|
 |
PeterPotkay |
Posted: Mon Feb 22, 2010 3:34 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Look at the source code, which comes with the MQ product if you install the Samples. There are good comment blocks throughout the code.
Of course you can tweak the sample and recompile so it does what you want.
There are a number of support packs that have a lot more options and flexability. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
bruce2359 |
Posted: Mon Feb 22, 2010 4:19 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9470 Location: US: west coast, almost. Otherwise, enroute.
|
Quote: |
We all know that when we do 5 or 6 different puts to a queue....and later when we do get....we get all the 6 puts at time.. |
No you don't. Each MQPUT delivers one message to a queue; each MQGET call retrieves one message from a queue. _________________ 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 |
|
 |
mvic |
Posted: Mon Feb 22, 2010 5:08 pm Post subject: Re: amqsget---any parameters |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
Goodfellas wrote: |
Are there any options/parametsers along with amqsget where we can pull the message from the queue 1 by 1.
Something which can be developed at the Shell script level not at the Programming level. |
amqsget only exists to demonstrate a few details of how to use MQ's C API.
If used unaltered, it is not a good basis for a production application. Firstly, it gets messages outside syncpoint. This is a generally unsound way of getting messages. If your messages are at all important, you should get them inside syncpoint.
Secondly, it does not deal with messages larger than 64 Kb. Thirdly, it always attempts to convert the messages it receives. These can be valid specifications, but not in every situation.
If possible, please tell us some details of what you are trying to develop, what languages your team has experience in (NB. programming in shell probably doesn't give enough flexibility, but we'll see) and the relevant requirements. No sensitive details please. |
|
Back to top |
|
 |
Goodfellas |
Posted: Mon Feb 22, 2010 9:18 pm Post subject: |
|
|
Acolyte
Joined: 26 Feb 2009 Posts: 70
|
The
Last edited by Goodfellas on Sun May 26, 2013 3:32 pm; edited 1 time in total |
|
Back to top |
|
 |
Vitor |
Posted: Mon Feb 22, 2010 9:24 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Goodfellas wrote: |
So I want to know by using amqsget can we pull specified number of messages from queue. For Example there are 10 msgs in a queue and I jst want to pull 5 messages using amqsget.
|
As my worthy associates have said, amqsget is only a sample. You can change the code to do whatever you want.
As they have also said, you might find some of the support pacs more suited to your needs. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Feb 22, 2010 9:37 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Talking about support packs ... If MQExplorer does not satisfy your needs have a look at MO71. It is an excellent support pack and allows for a lot of flexibility.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mvic |
Posted: Tue Feb 23, 2010 12:51 am Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
Goodfellas wrote: |
The App team want the messages to be pulled 1 by 1 from the queue. And they want MQ admins to do that.... |
In my very humble opinion, the app team should write their own code running in their own process to do something that is required by their application suite.
If you are comfortable with developing part of the application suite, (or perhaps operating it manually from a GUI like MO71 or MQ Explorer), that's fine. But as soon as you are signed up for that, you have to support it 24x7.
(What times of the day does the application need specific messages to be removed from queues?)
I may have misunderstood, YMMV, etc. etc. Hope this helps.  |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Feb 23, 2010 6:58 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9470 Location: US: west coast, almost. Otherwise, enroute.
|
Quote: |
The App team want the messages to be pulled 1 by 1 from the queue. And they want MQ admins to do that.... |
WMQ offers a robust set of Application Programming Interfaces (APIs) to process messages. Programmers write applications in one or more of the supported programming languages.
Quote: |
So I want to know by using amqsget can we pull specified number of messages from queue. For Example there are 10 msgs in a queue and I jst want to pull 5 messages using amqsget. |
Amqsget is a sample utility program used to demonstrate WMQ functionality. It does not process messages. It merely gets them from a queue, and displays them on STDOUT.
And, as written, amqsget consumes ALL messages in the queue. Source code (in C) is provided. Your application developers can use it as a model for writing business applications.
Your developers need to read the WMQ Application Programming Reference and WMQ Application Programming Guide. _________________ 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 |
|
 |
mvic |
Posted: Tue Feb 23, 2010 7:34 am Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
bruce2359 wrote: |
And, as written, amqsget consumes ALL messages in the queue. |
As long as each is less than 64 Kb and convertible. Upon arrival of any that is not both of these, amqsget will either give up, or produce results unlikely to be of much use.
Quote: |
Source code (in C) is provided. Your application developers can use it as a model for writing business applications. |
Business applications should typically get messages inside syncpoints, which amqsget does not do.
I agree the app team should write the application suite. This seems obvious, though, so I wonder what are the reasons why 'Goodfellas' is under pressure to write this part of the application.
Last edited by mvic on Tue Feb 23, 2010 7:42 am; edited 1 time in total |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Feb 23, 2010 7:39 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9470 Location: US: west coast, almost. Otherwise, enroute.
|
as a follow-on:
amqsput and amqsget (or amqsbcg or amqsbcgc) are paired to demonstrate (validate) that a message can be successfully put to a queue, and then successfully consumed from the queue.
These, and other supplied sample programs, are not business applications - in that they do no business processing.
Is the requirement that some messages need to be purged from the queue AND not processed? _________________ 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 |
|
 |
gbaddeley |
Posted: Tue Feb 23, 2010 5:18 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
mvic wrote: |
Goodfellas wrote: |
The App team want the messages to be pulled 1 by 1 from the queue. And they want MQ admins to do that.... |
In my very humble opinion, the app team should write their own code running in their own process to do something that is required by their application suite. |
I completely agree. MQ admins should not be dealing with app messages at all. The app team should have all the appropriate programs and tools to move, clear, reprocess, get messages on their queues. _________________ Glenn |
|
Back to top |
|
 |
RogerLacroix |
Posted: Wed Feb 24, 2010 1:13 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Feb 24, 2010 1:22 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9470 Location: US: west coast, almost. Otherwise, enroute.
|
Goodfellas: what processing are you supposed to do with the messages in the queue? _________________ 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 |
|
 |
|