ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » Browse without deletefrom Q.?(JAVA)

Post new topic  Reply to topic
 Browse without deletefrom Q.?(JAVA) « View previous topic :: View next topic » 
Author Message
paatchu
PostPosted: Sat Feb 03, 2007 3:45 am    Post subject: Browse without deletefrom Q.?(JAVA) Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Sat Feb 03, 2007 5:04 am    Post subject: Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Sat Feb 03, 2007 5:23 am    Post subject: Reply with quote

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
View user's profile Send private message
paatchu
PostPosted: Mon Feb 05, 2007 12:36 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Mon Feb 05, 2007 1:12 am    Post subject: Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Mon Feb 05, 2007 1:29 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Mon Feb 05, 2007 1:35 am    Post subject: Reply with quote

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
View user's profile Send private message
palbornoz
PostPosted: Wed Nov 21, 2007 9:27 pm    Post subject: is not work :( Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Thu Nov 22, 2007 1:41 am    Post subject: Reply with quote

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
View user's profile Send private message
bower5932
PostPosted: Thu Nov 22, 2007 5:13 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

Look at amqsbcg.java at:

http://www-304.ibm.com/jct09002c/isv/tech/sampmq.html
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Browse without deletefrom Q.?(JAVA)
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.