The prefetch value limits the number of messages pre-fetched, beyond
those for messages being processed, so a prefetch of 1 allows
prefetching a further message while another is being processed.
Replenishment of used message credit is batched (also taking existing
prefetched messages into account), so for higher prefetch numbers the
message credit outstanding will vary somewhat.

Setting it to zero effectively turns the client into poller, yes. For
JMS MessageListeners a credit is still granted immediately, otherwise
no message would ever be received. Spring 'listeners' tend to still
use polled receive(timeout) calls under the covers, so credit will be
repeatedly granted and drained for those as it does so.

The AMQP 0-8/0-9/0-9-1 prefetch is per-session (for the same client
AMQP 0-10 is per-consumer, IIRC), while the AMQP 1.0 clients prefetch
is per-consumer, so a lot of discussion of issues around that simply
dont apply. General prefetch related points would be around competing
consumers, special queues on a given broker, or a *varying* number of
cached consumers in use.

Robbie

On 13 August 2018 at 21:28, Dan Langford <[email protected]> wrote:
> 1) when i configure a qpid-jms-client (AMQP1.0) PREFETCH to 1 via the uri
> like this: ?jms.prefetchPolicy.all=1 is that going to prefetch 1 while I
> process 1 for a total of 2 messages having been acquired or does the
> prefetch number include messages currently being processed by my
> application logic?
> 2) does setting the prefetch to 0 turn the client into a "polling" client
> (for some reason i was under the impression it did)?
> 3) if a client wanted to never acquire any message it was not currently
> processing would the correct value be 1 or 0?
>
> 4) the documentation for qpid-client (AMQP0.x) has some great sections like
> one on Sessions. This section talks about client ack modes, prefetch, and
> other session behavior with notes and tips.
> https://qpid.apache.org/releases/qpid-java-6.1.6/jms-client-0-8/book/JMS-Client-0-8-Client-Understanding-Session.html
> it
> even goes to describe certain scenarios which will cause your consumer to
> "hang". the qpid-jms-client (AMQP1.0) documentation doesnt seem to have any
> documentation that is as deep that i can find. Is it likely that statements
> made about qpid-jms (AMQP0.x) Sessions are the same for qpid-jms-client
> (AMQP1.0) session, for example the note below?
>
>>Setting maxprefetch to 0 is recommended in Spring-JMS based applications
> whenever DefaultMassgeListenerContainer is configured with a
> CachingConnectionFactory that has cacheLevel set to either CACHE_CONSUMER
> or CACHE_SESSION.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to