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 4059172
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:10:27+00:00 2026-05-20T15:10:27+00:00

I have the following scenario : I’m pushing 100 messages to a queue shared

  • 0

I have the following scenario :

I’m pushing 100 messages to a queue shared by 2 consumers. Both subscribers subscribe to the queue in pre-acquire mode and explicit mode. After each message is handled, each subscriber accepts the message to remove it from the queue. The pseudo codes look likes that :

OnMessageTransfer(message) :
    DoSomethingWithMessage(message)
    Session.MessageAccept(message)

The messages are load balanced correctly, each message is processed once and only once, but we discovered that it doesn’t take into account the processing time for each consumer. For instance, let’s assume that consumer A is taking 50ms to process a message and consumer B is taking 5seconds. Ideally, consumer B should start processing 1 message and in the meantime, consumer A should process the 99 others. However, what happens is that consumer B will actually process 25 messages in 50 seconds while consumer A will process the 75 others in ~4 seconds and will idle. The client api seems to prefetch the messages, which is clearly non optimal in this situation.

How can we solve this problem?

We’re using Qpid cpp 0.5 and the fully managed c# 0-10 client API, not the cpp bindings (but my understanding is that this behavior is not linked to the implementation of the API)

Regards,

Julien

  • 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-20T15:10:27+00:00Added an answer on May 20, 2026 at 3:10 pm

    This behaviour can be changed by configuring the message flow for the queue. To avoid prefetching of messages, it should be set to a credit of 1 message and updated after handling each message. The pseudo code would looks like that :

    InitSubscription(queue) : 
        MessageSubscribe(queue, AcceptMode.Explicit, AcquireMode.PreAcquired)
        MessageSetFlowMode(queue, FlowMode.Credit)
        MessageFlow(queue, CreditUnit.Byte, MAX_BYTES)
        MessageFlow(queue, CreditUit.Message, 1) // will disable prefetch
    
    OnMessageTransfer(message) :
        DoSomethingWithMessage(message)
        MessageAccept(message)
        MessageFlow(queue, CreditUit.Message, 1) // reissue a credit for 1 and only 1 message
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following scenario I have a main form as MDI parent and
Due to company constraints out of my control, I have the following scenario: A
I want to accomplish the following scenario in Drupal: You have 2 content-types. Lets
How could I best implement the following scenario? I have a Next Period... button
Hi I need some help with the following scenario in php. I have a
i have following scenario and can't seem to find anything on the net, or
I have following scenario: alt text http://static.zooomr.com/images/7579022_e64808b855_o.png We have a WebService which poses as
I have following scenario: I have a XML-Document, e.g. like this <someRootElement> <tag1> <tag2
I have following scenario - I am displaying a list of product names as
I have the following scenario: procedure SomeMethod(SomeList: array of string); I have to call

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.