Author |
Message
|
paatchu |
Posted: Sat Feb 03, 2007 3:45 am Post subject: Browse without deletefrom Q.?(JAVA) |
|
|
Apprentice
Joined: 07 Sep 2006 Posts: 32
|
Whenever we use,
queue.get(message, getOptions);
The Contents inside the Q gets cleared.
Is there any way to see the Messages without clearing it.
There's a program q.exe , in MA01.zip which does it.
But is there any way around in JAVA to implement this.?
I know there's a parameter MQC.MQOO_BROWSE in MQGetMessageOptions class.
Is this is the only parameter does the trick.?
pls help _________________ Poetry with Programming |
|
Back to top |
|
 |
jefflowrey |
Posted: Sat Feb 03, 2007 5:04 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can also use Syncpoint. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
zpat |
Posted: Sat Feb 03, 2007 5:23 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
MQC.MQOO_BROWSE is an OPEN option
MQC.MQGMO_BROWSE might work with a GET! |
|
Back to top |
|
 |
paatchu |
Posted: Mon Feb 05, 2007 12:36 am Post subject: |
|
|
Apprentice
Joined: 07 Sep 2006 Posts: 32
|
Is that MQC.MQGMO_BROWSE ??.
I think it's MQC.MQGMO_BROWSE_FIRST . _________________ Poetry with Programming |
|
Back to top |
|
 |
Vitor |
Posted: Mon Feb 05, 2007 1:12 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
paatchu wrote: |
Is that MQC.MQGMO_BROWSE ??.
I think it's MQC.MQGMO_BROWSE_FIRST . |
Yes and no. It is MQGMO_BROWSE_FIRST, but the queue must be opened with MQOO_BROWSE before it'll be allowed. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
zpat |
Posted: Mon Feb 05, 2007 1:29 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
BROWSE_NEXT works well, it will start at the first message anyway, you only need to use BROWSE_FIRST to reset the browse cursor. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Feb 05, 2007 1:35 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
zpat wrote: |
BROWSE_NEXT works well, it will start at the first message anyway, you only need to use BROWSE_FIRST to reset the browse cursor. |
Point taken  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
palbornoz |
Posted: Wed Nov 21, 2007 9:27 pm Post subject: is not work :( |
|
|
 Newbie
Joined: 21 Nov 2007 Posts: 1
|
zpat wrote: |
BROWSE_NEXT works well, it will start at the first message anyway, you only need to use BROWSE_FIRST to reset the browse cursor. |
i try with you solution, but is not work
Part of my code is:
Code: |
System.out.println("Before the gmo");
gmo = new MQGetMessageOptions();
gmo.options = MQC.MQGMO_BROWSE_FIRST;
System.out.println("Before the while");
while(i<lineas){//MQC.MQGMO_BROWSE_NEXT i<lineas
msg = new MQMessage();
System.out.println("before the queue.get");
queue.get(msg,gmo);
System.out.println("after the queue.get");
msgID = new String(msg.messageId);
System.out.println("Before the if");
if(archivo.equalsIgnoreCase(msgID)){
System.out.println("In the if");
gmo.options = MQC.MQGMO_BROWSE_MSG_UNDER_CURSOR;
msg = new MQMessage();
queue.get(msg);
bw.write(msg.readString(msg.getMessageLength()));
bw.newLine();
i++;
System.out.println("message write in file");
}
System.out.println("Out the if");
gmo.options = MQC.MQGMO_BROWSE_NEXT;
}
|
But when i execute this code for get message the error is:
Generando Archivo
Before the gmo
Before the while
before the queue.get
Unable to load message catalog - mqji
Error MQException
Completio code: 2
Reason code: 2036
I hope so you can help me please!!
Thanks!
pd. my english it's so so becouse i spoke spanish |
|
Back to top |
|
 |
Vitor |
Posted: Thu Nov 22, 2007 1:41 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Vitor wrote: |
Yes and no. It is MQGMO_BROWSE_FIRST, but the queue must be opened with MQOO_BROWSE before it'll be allowed. |
Code: |
2036 0x000007f4 MQRC_NOT_OPEN_FOR_BROWSE |
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Nov 22, 2007 5:13 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
|
Back to top |
|
 |
|