Author |
Message
|
vasilev |
Posted: Fri Oct 25, 2019 1:59 am Post subject: pcf read all messages in a givven queue - put date/time |
|
|
 Acolyte
Joined: 31 Oct 2014 Posts: 71 Location: Germany
|
Hello dear colleagues,
I am trying to read all the messages in a queue and get only put date/time.
I cannot find similar info and that is why i am opening a post here.
Can you help me with this. Should i Inquire the queue status and make some loop or i have to specify different attributes.
or i need a jms client to read the messages?
thank you! |
|
Back to top |
|
 |
hughson |
Posted: Fri Oct 25, 2019 2:33 pm Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
You cannot use the PCF interface to obtain the putdate and puttime fields of all the messages on a queue.
You must use the messaging API. You will likely want to have a loop to browse all the messages, and in it read the PutDate and PutTime fields from the MQMD.
You can use any language you want, Java or not Java, entirely up to your own skill set, that's the beauty of the MQ API.
It may be wise to step back for a moment and review whether or not the provided samples can give you what you need, or whether another already written program can give you what you need. You don't say why you need to obtain all the PutDates and Times so we can't guess.
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
 |
RogerLacroix |
Posted: Fri Oct 25, 2019 2:47 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Years ago, IBM posted a Java sample equivalent of the C sample called "amqsbcg". You can find it here.
Just delete all of the MQMessage attributes you don't want then it will do exactly what you want.
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
vasilev |
Posted: Fri Oct 25, 2019 11:01 pm Post subject: |
|
|
 Acolyte
Joined: 31 Oct 2014 Posts: 71 Location: Germany
|
Thank you.
I thought the same but wanted to ask , because cannot find info for this.
I am using java, checking the code now.
Have a nice weekend  |
|
Back to top |
|
 |
RogerLacroix |
Posted: Sat Oct 26, 2019 9:01 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
vasilev wrote: |
I thought the same but wanted to ask , because cannot find info for this. |
You are going about this backwards. If you want to be a top notch programmer then you need to change how you think.
Your new philosophy should be:
- First do reearch - in this day and age that means lots & lots of Google searches
- Read and reread what you find
- Search the MQ Knowledge Center for topics that you are having problems with
- Download sample code and test
- If/when you get stuck, post a question with code showing the problem
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
vasilev |
Posted: Sat Oct 26, 2019 11:29 am Post subject: |
|
|
 Acolyte
Joined: 31 Oct 2014 Posts: 71 Location: Germany
|
Thank you Roger.
I hope someday each of us to become top notch programmers
Cheers |
|
Back to top |
|
 |
|