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

  • SEARCH
  • Home
  • 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 7169337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:58:07+00:00 2026-05-28T14:58:07+00:00

Is there a way to consume messages from a WebSphere MQ queue in batches?

  • 0

Is there a way to consume messages from a WebSphere MQ queue in batches? e.g.

messages = queue.receiveBatch( BATCH_SIZE )

Where it would return a collection of messages ( e.g. List[Message] ) up to a BATCH_SIZE in a single “receive”?

( I can call receive BATCH_SIZE times within a transaction, but that is not what I am looking for )

If message groups can solve it, what would it look like? Although it does not seem to be the right solution as “message groups” seem to be reading messages one by one.

  • 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-28T14:58:09+00:00Added an answer on May 28, 2026 at 2:58 pm

    No. WMQ has read-ahead in which non-persistent messages are streamed to the client but even there the client executes a single GET (or language equivalent) per message.

    One of the attributes of async messaging is supposed to be that messages are atomic. Any dependency of messages on other messages is called an affinity and message affinities break the async model. (However every transport makes some accommodation for affinities and message grouping is an example of that.) So a GET is the atomic unit of work which has a 1:1 correspondence to a message.

    WMQ messages can be of arbitrary size up to 100MB and messages larger than that can be segmented where one logical message is split across multiple physical messages. In the case of a segmented message, one GET will result in consumption of multiple messages, however to the app only one logical message is returned.

    WMQ Channels use batches and until recently these were constructed strictly by message count. However the aforementioned variability in message sizes made tuning channels extremely difficult if both large and small messages traversed the same channel. In v7.1 of WMQ channel batches now are bounded by a message count or a byte count, whichever is hit first. Any notion of message GET batching would require similar tuning functionality in order to prevent severe impacts to memory. There would be additional interactions with logging, queue sizes, etc. Note also that if one message failed, the entire batch would have to be rolled back.

    If the intent is to improve performance, use transactions. When receiving messages under syncpoint you can tune the number of messages to GET between COMMIT calls. You can considerably improve performance with COMMIT intervals > 1, however this falls off above a threshold which you can determine with a bit of trial and error. The Performance Reports can help determine the best number for your platform. These are available from the SupportPacs main page. Look for the entries with names like MPxx.

    If the messages are non-persistent and you can afford to lose some of them on disconnect, then you can use read-ahead – assuming you have a modern version of WMQ. This will stream messages to the application’s WMQ client so that the next message is already in the local buffer when GET is called.

    By the way, the link in the original post was to the WMB docs. The WMQ docs can be found here.

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

Sidebar

Related Questions

Is there a way to immediately print the message received from the client without
Is there a way to consume a web service using JavaScript? I'm Looking for
is there way how to get name ov event from Lambda expression like with
Is there way that I can read the file from remote server using fopen
I need to return a list of objects from a restful webservice. each object
We have an application that uses the window message queue to pass data from
do you have idea, if there would be some nice way to browse/log JMS
I would like to put messages onto a queue with a date/time as a
Is there a tool or a way to find out how much memory consumed
Is there way in next piece of code to only get the first record?

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.