qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robbie Gemmell (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (QPIDJMS-86) AMQP 1.0 prefetch policy set to 0 by the broker results in no messages processed
Date Wed, 15 Jul 2015 16:08:04 GMT

     [ https://issues.apache.org/jira/browse/QPIDJMS-86?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Robbie Gemmell resolved QPIDJMS-86.
-----------------------------------
    Resolution: Not A Problem

Hi Alex,

In AMQP 1.0 the 'receiver' end of a link grants the 'sender' end of the link an amount of
credit to transfer messages, and it is the receivers responsibility to replenish that credit
as it gets used by the sender. As such, the available 'prefetch' for a given consumer is entirely
controlled by the client, and it is this value which the clients configuration allows you
to configure.

I'm not sure where you see the broker reported prefetch, but the value is presumably for the
'internal consumer' within the ActiveMQ brokers AMQP protocol module, which itself has absolutely
no control over how much link credit the remote AMQP receiver grants (if it grants any).

There have been a number of improvements in the AMQP support for ActiveMQ 5.12 (which should
hopefully be released in near term), particularly in the area of credit handling, so I would
suggest trying the current snapshots to see how it works for you, if you havent already (I'm
unclear from the report which version you are using).

Robbie

> AMQP 1.0 prefetch policy set to 0 by the broker results in no messages processed
> --------------------------------------------------------------------------------
>
>                 Key: QPIDJMS-86
>                 URL: https://issues.apache.org/jira/browse/QPIDJMS-86
>             Project: Qpid JMS
>          Issue Type: Bug
>          Components: qpid-jms-client
>    Affects Versions: 0.3.0
>            Reporter: Alex Plischke
>
> My broker's default prefetch policy is set to 0 (using ActiveMQ).
> When my queue consumer connects to the broker, the broker reports that the consumer has
indeed a prefetch of 0.
> The qpid client however, just uses the defaults defined in the JmsPrefetchPolicy class
(ergo, 1000 for the queue).
> So when the qpid client tries to decide whether it needs to poll or not in JmsMessageConsumer...
> {noformat}
>     protected void sendPullCommand(long timeout) throws JMSException {
>         if (messageQueue.isEmpty() && (getPrefetchSize() == 0 || isBrowser()))
{
>             connection.pull(getConsumerId(), timeout);
>         }
>     }
> {noformat}
> ... the if condition will be false, since the prefetch size returned here is 1000. Qpid
will therefore not poll and the broker not push either, resulting in no messages processed.
> My current workaround is that I have to set the prefetch size on the client as well.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


Mime
View raw message