Disable prefetch and local message cache

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Disable prefetch and local message cache

jxz024000
Hello,

We are using qpid-jms-client 0.46.0 with Azure Service Bus. We use a poll
loop to receive and process messages. In Service Bus we have message lock
timeout default to 30 seconds. The message processing logic can vary in
time. Sometimes it can take more than much longer than 30 seconds to
complete. If prefetch is enabled (by default), it is possible the prefetched
message is unlocked on Service Bus side before the message is actually being
picked up by consumer. We would like to only receive one message when call
session.receive and no prefetch. In this case, we also don't need local
message buffer to hold the prefetched messages. Can we disable prefetch and
local message buffer? I checked the document here
https://qpid.apache.org/releases/qpid-jms-0.41.0/docs/index.html.
Should we just need to add the following to connection string?

jms.prefetchPolicy.all = 0
jms.receiveLocalOnly = false
jms.receiveNoWaitLocalOnly = false

amqps://xxx.servicebus.windows.net?amqp.idleTimeout=24000&jms.prefetchPolicy.all=0&jms.receiveLocalOnly=false&jms.receiveNoWaitLocalOnly
= false&transport.enabledProtocols=TLSv1.2



--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

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

Reply | Threaded
Open this post in threaded view
|

Re: Disable prefetch and local message cache

Timothy Bish
On 1/6/21 3:37 PM, jxz024000 wrote:

> Hello,
>
> We are using qpid-jms-client 0.46.0 with Azure Service Bus. We use a poll
> loop to receive and process messages. In Service Bus we have message lock
> timeout default to 30 seconds. The message processing logic can vary in
> time. Sometimes it can take more than much longer than 30 seconds to
> complete. If prefetch is enabled (by default), it is possible the prefetched
> message is unlocked on Service Bus side before the message is actually being
> picked up by consumer. We would like to only receive one message when call
> session.receive and no prefetch. In this case, we also don't need local
> message buffer to hold the prefetched messages. Can we disable prefetch and
> local message buffer? I checked the document here
> https://qpid.apache.org/releases/qpid-jms-0.41.0/docs/index.html.
> Should we just need to add the following to connection string?
>
> jms.prefetchPolicy.all = 0
> jms.receiveLocalOnly = false
> jms.receiveNoWaitLocalOnly = false
>
> amqps://xxx.servicebus.windows.net?amqp.idleTimeout=24000&jms.prefetchPolicy.all=0&jms.receiveLocalOnly=false&jms.receiveNoWaitLocalOnly
> = false&transport.enabledProtocols=TLSv1.2

Setting a zero prefetch means that the client will request a message on
each call to receive or if setting a MessageListener the client will
request one at a time as it calls the onMessage and that method returns.



>
>
> --
> Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

--
Tim Bish


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

Reply | Threaded
Open this post in threaded view
|

Re: Disable prefetch and local message cache

Robbie Gemmell
Administrator
In reply to this post by jxz024000
To follow up on Tims reply, that setting prefetch 0 seems to be what
you want, you should also just remove the jms.receiveLocalOnly and
jms.receiveNoWaitLocalOnly options. You would just be setting them to
their existing default value of false.

The local data structure always gets used to source messages to pass
to the application, those settings only govern what happens after it
doesn't yield a message for a receive call, i.e whether remote
operations then occur to really ensure nothing is available or was
in-flight. Those settings also have no bearing on whether prefetch
occurs, thats what the prefetch settings control. Setting a prefetch
of 0 also requires that remote operations always occur during receive
calls.

On Wed, 6 Jan 2021 at 20:38, jxz024000 <[hidden email]> wrote:

>
> Hello,
>
> We are using qpid-jms-client 0.46.0 with Azure Service Bus. We use a poll
> loop to receive and process messages. In Service Bus we have message lock
> timeout default to 30 seconds. The message processing logic can vary in
> time. Sometimes it can take more than much longer than 30 seconds to
> complete. If prefetch is enabled (by default), it is possible the prefetched
> message is unlocked on Service Bus side before the message is actually being
> picked up by consumer. We would like to only receive one message when call
> session.receive and no prefetch. In this case, we also don't need local
> message buffer to hold the prefetched messages. Can we disable prefetch and
> local message buffer? I checked the document here
> https://qpid.apache.org/releases/qpid-jms-0.41.0/docs/index.html.
> Should we just need to add the following to connection string?
>
> jms.prefetchPolicy.all = 0
> jms.receiveLocalOnly = false
> jms.receiveNoWaitLocalOnly = false
>
> amqps://xxx.servicebus.windows.net?amqp.idleTimeout=24000&jms.prefetchPolicy.all=0&jms.receiveLocalOnly=false&jms.receiveNoWaitLocalOnly
> = false&transport.enabledProtocols=TLSv1.2
>
>
>
> --
> Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

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

Reply | Threaded
Open this post in threaded view
|

Re: Disable prefetch and local message cache

jxz024000
Thank you Tim and Rob.



--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

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