Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6635873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:06:42+00:00 2026-05-25T23:06:42+00:00

Using JMS & WebSphere MQ, if I use a message selector to selectively dequeue,

  • 0

Using JMS & WebSphere MQ, if I use a message selector to selectively dequeue, and there are several messages with the same selection criteria, am I guaranteed to dequeue the first message that matches?

e.g. given a queue with messages

  1. {color: pink, name: alice}
  2. {color: blue, name: bob}
  3. {color: red, name: charlie}
  4. {color: blue, name: doug}

if I dequeue with the selector color='blue', am I guaranteed to dequeue {color: blue, name: bob}? Or is there a chance I could get {color: blue, name: doug} instead, even though it is further into the queue depth?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:06:43+00:00Added an answer on May 25, 2026 at 11:06 pm

    Please refer to the RESCANINT property of the different WMQ Connection Factory implementations. From the manual:

    When a message consumer in the point-to-point domain uses a message
    selector to select which messages it wants to receive, the WebSphere
    MQ JMS client searches the WebSphere MQ queue for suitable messages in
    the sequence determined by the MsgDeliverySequence attribute of the
    queue. When the client finds a suitable message and delivers it to the
    consumer, the client resumes the search for the next suitable message
    from its current position in the queue. The client continues to search
    the queue in this way until it reaches the end of the queue, or until
    the interval of time in milliseconds, as determined by the value of
    this property, has expired. In each case, the client returns to the
    beginning of the queue to continue its search, and a new time interval
    commences.

    The idea is that in a very busy queue with priority delivery, some messages of a higher priority may appear higher in the queue then the current position of the selector. Theoretically a higher priority message should be consumed first but the consumer won’t see it unless it seeks from the head of the queue. The cursor is reset to the head of the queue either when it gets to the end or when RESCANINT is reached. The setting of RESCANINT allows for tuning of how responsive you want the selector to be in finding these higher priority messages.

    RESCANINT isn’t specific to FIFO delivery. The other case in which this can happen is if there are multiple threads with overlapping selection criteria. In this case one thread can hold a message under lock and then release it. Although the message may be eligible for the second thread, if that thread has already passed that position in the queue then it takes hitting the end of the queue or RESCANINT elapsing to restart the cursor to find the message.

    Rescan interval is in milliseconds and defaults to 5000. Any positive integer value is accepted, although too low a value will cause thrashing as the cursor is continually reset before any messages can be consumed.

    As a practical matter, you will receive the messages in order if the queue is FIFO and you have only one reader on the queue for which the messages are eligible, regardless of what RESCANINT is set to. If message order is to be strictly preserved, there are some additional considerations as described in Sequential retrieval of messages. These boil down to messages having only one path from producer to consumer when considering channels, syncpoints, etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to load balance JMS messages using message selectors. A message has a
I am using Spring on Tomcat. I want to use JMS Timer. Is there
I am using JMS Messaging in my java program. My messages are coming from
I'm using Oracle Advanced Queues via JMS from within Websphere App Server. Does anyone
We have an application that processes JMS message using a message driven bean. This
Is it possible to send message to particular receiver using JMS Queue(HornetQ)? Among so
We are using Spring JMS to read messages from an Oracle AQ queue. When
greetings all I am using the JMS with the following configuration to send messages
Using Spring-JMS it is possible to receive messages within an external transaction context via
We are using TIBCO JMS 4.3.3 with the same version of .Net TIBCO.EMS.dll for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.