I don't know what the best way is, but I just threw together a simple
debugging program which uses a QueueBrowser to display all the messages in a
queue.

Here is a code snippet you might be able to use.

        try {
            if (queueConnection == null) {
                queueConnection = new REIQueueConnection(queueName,
username, password);
                queueConnection.connect();
                queueSession = queueConnection.queueSession();
                queueBrowser =
queueSession.createBrowser(queueConnection.queue());
            }
            long msgNumber = 1;
            for (Enumeration e = queueBrowser.getEnumeration() ;
e.hasMoreElements() ;) {
                System.out.println("Message " + msgNumber + ":");
                StringTokenizer st = new
StringTokenizer(e.nextElement().toString(), newline);
                while (st.hasMoreTokens()) {
                    System.out.println("  " + st.nextToken());
                }
                System.out.println();
                msgNumber++;
            }
        } catch (Exception e) {
            System.out.println("Exception occurred: " + e.toString());
        }

Geoffrey A. Lowney
Senior Software Development Engineer
Recreational Equipment, Inc.
Phone 253-395-8164 Fax 253-437-7291
Pager 206-625-8477 [EMAIL PROTECTED]
[EMAIL PROTECTED] http://www.rei.com/
In order to draw a limit to thinking, we should have to think both sides
of this limit.
-- Ludwig Wittgenstein, Tractatus Logico-Philosophicus 



> -----Original Message-----
> From: HariNam Singh [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 10, 2001 12:57 PM
> To: [EMAIL PROTECTED]
> Subject: [developers] looking at the contents of a queue
> 
> 
> Hi,
> 
> I'm just getting started with Swift-MQ. The explorer seems to 
> have lots of
> tabs. But, how do I get to see the contents of a message in a 
> queue. I'm
> debugging a proof of concept application, and would like to just peak
> through the queue content to check for error or success of 
> the application.
> How do I do it?
> 
> 
> Thanks,
> HariNam
> 
> 
> ------------------------------------------------------
> SwiftMQ developers mailing list * http://www.swiftmq.com
> To unsubscribe from this list, send an eMail to 
> [EMAIL PROTECTED] and write in the body of your message:
> UNSUBSCRIBE developers <your-email-address>
> Archive: http://www.mail-archive.com/developers@mail.iit.de/
> 
> 
> 
> 

------------------------------------------------------
SwiftMQ developers mailing list * http://www.swiftmq.com
To unsubscribe from this list, send an eMail to 
[EMAIL PROTECTED] and write in the body of your message:
UNSUBSCRIBE developers <your-email-address>
Archive: http://www.mail-archive.com/developers@mail.iit.de/




Reply via email to