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 Java / JMS » Browsing by JMSMessageID fails.. Is it not possible?

Post new topic  Reply to topic Goto page 1, 2  Next
 Browsing by JMSMessageID fails.. Is it not possible? « View previous topic :: View next topic » 
Author Message
wbintegrator
PostPosted: Tue Jul 25, 2006 2:12 am    Post subject: Browsing by JMSMessageID fails.. Is it not possible? Reply with quote

Voyager

Joined: 08 Feb 2006
Posts: 83

Hi,

I'm trying to browse a queue with MQQueueBrowser with a JMSMessageID selector - it fails, but get works perfect.

also when I m browsing , by for ex. JMSPriority , it works.

Does that mean that I can't browse by msgid and have to do the searching on the enumeration I get?

Thanks
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Tue Jul 25, 2006 2:26 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi wbintegrator,

Can we see the snippet where ur using the messageId selector....pick by messageId is supposed to work.

Regards.
Back to top
View user's profile Send private message Send e-mail
wbintegrator
PostPosted: Tue Jul 25, 2006 5:26 am    Post subject: Reply with quote

Voyager

Joined: 08 Feb 2006
Posts: 83

OK, our network is not connected to the Internet so I can't copy paste the code.. I hope I don't make some stupid mistypes. Here is approximately what I'm doing:

Code:

public Enumeration getBySelector( String QMgr, String queue, String selector ){
   MQqueue q = (MQMueue)session.getQueue("queue://" + QMgr + "/" + queue + "");
   QueueBrowser b = q.getBrowser(q, selector");
   return b.getEnumeration();
}

in Main:

getBySelector("",TEST,"JMSMessageID = ID:*")

where * is an existing ID (can't copy-paste a real one)

Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Jul 25, 2006 11:49 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

check out the manual. I think you might be missing some quotes. I believe it should look like this:
Code:

Selector = "JMSMessageId = 'ID:*'";

As ID:* is not a variable but a value assignment.

Enjoy
[edit]replaced double with single quotes[/edit]
_________________
MQ & Broker admin


Last edited by fjb_saper on Tue Jul 25, 2006 1:50 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
bower5932
PostPosted: Tue Jul 25, 2006 1:36 pm    Post subject: Reply with quote

Jedi Knight

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

Look at CorrelExample.java at:

http://www-304.ibm.com/jct09002c/isv/tech/sampmq.html

It might help you.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
wbintegrator
PostPosted: Tue Jul 25, 2006 9:30 pm    Post subject: Reply with quote

Voyager

Joined: 08 Feb 2006
Posts: 83

fjb_saper wrote:
check out the manual. I think you might be missing some quotes. I believe it should look like this:
Code:

Selector = "JMSMessageId = 'ID:*'";

As ID:* is not a variable but a value assignment.


I was afraid I would make a stupid mistale .
I'm indeed trying to browse with 'ID: *' - to be more precise I do it exactly as when using receiver and it doesn't work.. Any ideas?

bower5932: thanks for the examples, I'll check them out.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jul 26, 2006 1:25 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

When you browse is your connection started or stopped ?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
wbintegrator
PostPosted: Thu Jul 27, 2006 5:33 am    Post subject: Reply with quote

Voyager

Joined: 08 Feb 2006
Posts: 83

Thank you for your efforts man.

Let me explain myself:

I start the connection of course and in the same session I try to do the following:

Get | Get by msgid/correlid | Browse | Browse by msgid/correlid |
----------------------------------------------------------------------------------
OK | OK | OK | fails |
----------------------------------------------------------------------------------

It's very strange as the syntax for getting/browsing by selector is exactly the same and get more and more convinced that it is a bug or smthing..

I've read the whole chapter about using selectors and have searched the net for browsing. Nothing special about it and yet browsing by an ID fails for me. I tried to browse by priority(JMSPriority) and it worked.. ????

Have you tried browsing by msgid/correlid? Is anyone that has done that using JMS ?

Thanks again,
Joseph
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Jul 27, 2006 2:00 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Well.... If you get the message by correlId it is no longer there for you to browse isn't it?

Reverse the order of your test and do the browse before you do the get.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
bower5932
PostPosted: Thu Jul 27, 2006 4:52 pm    Post subject: Reply with quote

Jedi Knight

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

I thought he was doing two gets (both working) followed by 2 browses (first works, second fails). Shouldn't this be correct?
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
jefflowrey
PostPosted: Thu Jul 27, 2006 6:19 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

bower5932 wrote:
I thought he was doing two gets (both working) followed by 2 browses (first works, second fails). Shouldn't this be correct?


I guess FJ's point is that this is correct only if there are at least three messages on the queue, all with the same msgid.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
wbintegrator
PostPosted: Sat Jul 29, 2006 11:33 pm    Post subject: Reply with quote

Voyager

Joined: 08 Feb 2006
Posts: 83

bower5932 wrote:
I thought he was doing two gets (both working) followed by 2 browses (first works, second fails). Shouldn't this be correct?


Friends... My point is that I fail to browsae by msgid/correlid..
I'm not doing all of those operations at once in one run and I know that if I GET a message it is no longer there. Just this:

Put a message to a queue -> Copy its msgid -> try to browse it using JMS selector (and I assure you that the syntax is correct) -> the browse returns no message -> fails. OK?

I hope we'll understand each other this time

Thanks
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Sat Jul 29, 2006 11:57 pm    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi wbintegrator,
wbintegrator wrote:
Put a message to a queue -> Copy its msgid -> try to browse it using JMS selector (and I assure you that the syntax is correct) -> the browse returns no message -> fails. OK?

Are you doing all these operations using one application ?

Do u see the message in the queue(with the correct id) till the end ?

Please post the code snippets of your put, copy of msgId, and browse...

Regards.
Back to top
View user's profile Send private message Send e-mail
wbintegrator
PostPosted: Sun Jul 30, 2006 2:48 am    Post subject: Reply with quote

Voyager

Joined: 08 Feb 2006
Posts: 83

Ok, as I told you I have no possibility to copy-paste code as our network is not connected to the WWW, so don't catch me on syntax errors that I might make. I do it analogically to the QueueReceiver which works with any selector I have tried so far..

So here we go:

Code:

public Enumeration getBySelector( String QMgr, String queue, String selector ){
   Queue q = session.getQueue("queue://" + QMgr + "/" + queue + "");
   QueueBrowser b = q.getBrowser(q, selector");
   return b.getEnumeration();
}

in Main:

getBySelector("",TEST,"JMSMessageID = ID:*")


where * is an existing ID that I have copied from the Windows MqExplorer after having put the message (can't copy-paste a real one)

As I wrote earlier, if I substitute the QueueBrowser with a QueueReceiever, (with all the necessary changes of course) the receiver returns the message that I requested(another message with its id taht I also copied from the MQExlorer).

If I still am not qite clear, just try to browse for a message with an id selector please. If you have a jms apllication it won't take you more than 5 minutes.

I need it to work badly, thanks so much,

Joseph
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Jul 30, 2006 12:10 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Don't cut and paste. You do not know that the format is correct. You might need to use lower case letters ('a-f') or upper case ('A-F') where you are using the other. The only way to get it right is to put the message, get it's JMSMessageId (see method on the message) and then use this information in your selector...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ Java / JMS » Browsing by JMSMessageID fails.. Is it not possible?
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.