You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Kevin Burton <bu...@spinn3r.com> on 2015/10/31 18:49:22 UTC
Better documentation for usePrefetchExtension? How do I disable
prefetch until I commit()?
I'm finding the documentation for usePrefetchExtension to be rather lacking
What exactly does it do?
The documentation says:
> the prefetch extension is used when a message is delivered but not acked,
such that the broker can dispatch another message (e.g., prefetch == 0),
the idea being that there will always be prefetch num messages pending. It
also allows a transaction batch to exceed the prefetch value.
What I want to do is figure out a way for the broker to NOT send another
message into the prefetch until the session I'm onhas either commit() or
rollback().
This way I am not sitting on a message doing nothing with it...
We're using normal transacted sessions.. AKA:
Session session = connection.createSession( true,
Session.SESSION_TRANSACTED );
I *think* what is supposed to happen, is that normally, it extends the
prefetch to be the number of messages read but unacknowledged PLUS the
prefetch value.
I would assume that if I disabled it and I haven't yet called session
commit that I shouldn't get prefetched values.
But that doesn't appear to be the case. If I use a MessageListener or just
manually receive I get a new MessageDispatch event after I receive the
message.
--
We’re hiring if you know of any awesome Java Devops or Linux Operations
Engineers!
Founder/CEO Spinn3r.com
Location: *San Francisco, CA*
blog: http://burtonator.wordpress.com
… or check out my Google+ profile
<https://plus.google.com/102718274791889610666/posts>
Re: Better documentation for usePrefetchExtension? How do I disable
prefetch until I commit()?
Posted by Kevin Burton <bu...@spinn3r.com>.
Nevermind! I had a weird bug in my test. Turns out it does exactly what I
expected it to do. New messages aren't dispatched until you call
acknowledge() or commit.. which is just what I want!
KEvin
On Sat, Oct 31, 2015 at 10:49 AM, Kevin Burton <bu...@spinn3r.com> wrote:
> I'm finding the documentation for usePrefetchExtension to be rather
> lacking
>
> What exactly does it do?
>
> The documentation says:
>
> > the prefetch extension is used when a message is delivered but not
> acked, such that the broker can dispatch another message (e.g., prefetch ==
> 0), the idea being that there will always be prefetch num messages pending.
> It also allows a transaction batch to exceed the prefetch value.
>
> What I want to do is figure out a way for the broker to NOT send another
> message into the prefetch until the session I'm onhas either commit() or
> rollback().
>
> This way I am not sitting on a message doing nothing with it...
>
> We're using normal transacted sessions.. AKA:
>
> Session session = connection.createSession( true,
> Session.SESSION_TRANSACTED );
>
> I *think* what is supposed to happen, is that normally, it extends the
> prefetch to be the number of messages read but unacknowledged PLUS the
> prefetch value.
>
> I would assume that if I disabled it and I haven't yet called session
> commit that I shouldn't get prefetched values.
>
> But that doesn't appear to be the case. If I use a MessageListener or
> just manually receive I get a new MessageDispatch event after I receive the
> message.
>
>
>
> --
>
> We’re hiring if you know of any awesome Java Devops or Linux Operations
> Engineers!
>
> Founder/CEO Spinn3r.com
> Location: *San Francisco, CA*
> blog: http://burtonator.wordpress.com
> … or check out my Google+ profile
> <https://plus.google.com/102718274791889610666/posts>
>
>
--
We’re hiring if you know of any awesome Java Devops or Linux Operations
Engineers!
Founder/CEO Spinn3r.com
Location: *San Francisco, CA*
blog: http://burtonator.wordpress.com
… or check out my Google+ profile
<https://plus.google.com/102718274791889610666/posts>