|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
JMS Selector Bug? |
« View previous topic :: View next topic » |
Author |
Message
|
garbagedook |
Posted: Mon May 15, 2006 8:49 am Post subject: JMS Selector Bug? |
|
|
Novice
Joined: 15 May 2006 Posts: 11
|
Hello all,
I have a BytesMessage that I am calling setLongProperty with the current timestamp in milliseconds.
long x = System.currentTimeMillis();
msg.setLongProperty("LASTMODDT", x);
I place this message on a queue.
I use a selector with a value that is LESS than x e.g. LASTMODDT >= 1146501224000
But it always returns me nothing!
Please note, I have the selector working on other properites, i.e. those using String equality. I also have the selector working with JMSTimestamp >=, but for my OWN long property it does not work.
Anyone seen this before? Thank you very much in advance. |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon May 15, 2006 12:07 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
JMS selectors have extremely poor performance (in the current MQ JMS Implementation).
You are strongly recommended not to use them for anything other than MsgID and CorrelationID.
What are you trying to accomplish with this selector?
Queues are not databases, also, please don't try to use them that way. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
lohitashwa |
Posted: Tue May 23, 2006 2:10 am Post subject: |
|
|
Newbie
Joined: 05 May 2005 Posts: 5
|
Hi,
I tried a sample program to put a BytesMessage setting the property and fetching the same with Message selectors and it worked fine...
BytesMessage bMsg = session.createBytesMessage();
long x = System.currentTimeMillis();
bMsg.setLongProperty("MYTIME", x);
sender.send(bMsg);
Thread.sleep(1000);
bMsg = null;
QueueReceiver receive = session.createReceiver(que, "MYTIME>=1000");
bMsg = (BytesMessage)receive.receive(5000);
System.out.println("The Msg is " + bMsg);
.
When i executed the above code , i got the message since the time millis was greater than 1000. Can you let me know if you are getting any kind of exception. What is the WMQ CSD version you are currently using.
Regards
Lohitashwa T |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue May 23, 2006 3:31 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
@garbagedook
Is it possible that your session is transacted and that your are trying to receive the message before having committed the send ?
Remember was transaction settings will superseed whatever transaction settings you put on the session...
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|