简体   繁体   中英

Get message in MQ QUEUE with JMSTIMESTAMP

I have a problem when i try to get message with put date/time beetween two dates (beginDate and endDate). Here is my query receiveSelected("JMSTimestamp BETWEEN " + pBeginDate + "AND " + pEndDate). A message is in the queue and the timestamp is between the two values passed in argument. But nothing is returned by the query

I've tried on a recent WMQ version and this works correctly; I've output the 10 messages, the timestamp and the message id. Then only got some of the messages.

The correct ones are returned: have you confirmed the message is committed? and visible?
You do mention 'date' - is the selector in the correct format..

------------------------------------------------------------------------
0:1389200177672 ID:414d5120514d5f76385f62696c626f20ff30cd5220008002
1:1389200178874 ID:414d5120514d5f76385f62696c626f20ff30cd5220008003
2:1389200180076 ID:414d5120514d5f76385f62696c626f20ff30cd5220008004
3:1389200181277 ID:414d5120514d5f76385f62696c626f20ff30cd5220008005
4:1389200182477 ID:414d5120514d5f76385f62696c626f20ff30cd5220008006
5:1389200183677 ID:414d5120514d5f76385f62696c626f20ff30cd5220008007
6:1389200184877 ID:414d5120514d5f76385f62696c626f20ff30cd5220008008
7:1389200186078 ID:414d5120514d5f76385f62696c626f20ff30cd5220008009
8:1389200187279 ID:414d5120514d5f76385f62696c626f20ff30cd522000800a
9:1389200188479 ID:414d5120514d5f76385f62696c626f20ff30cd522000800b
-------------------------------------------------------------------------------
Receiving....
Selector is : JMSTimestamp BETWEEN 1389200181277 AND 1389200186078
--------------------------------
1389200181277 ID:414d5120514d5f76385f62696c626f20ff30cd5220008005
--------------------------------
1389200182477 ID:414d5120514d5f76385f62696c626f20ff30cd5220008006
--------------------------------
1389200183677 ID:414d5120514d5f76385f62696c626f20ff30cd5220008007
--------------------------------
1389200184877 ID:414d5120514d5f76385f62696c626f20ff30cd5220008008
--------------------------------
1389200186078 ID:414d5120514d5f76385f62696c626f20ff30cd5220008009
--------------------------------

Thank you Calanais for your response. Yes I use MQJexplorer and I can see that the message is sent and committed. So of course the dates are in Timestamp format, ie a Long returned by getTime() function.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM