You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Dale Green <gr...@gmail.com> on 2016/06/22 09:00:22 UTC
Qpid JMS 0.9.0 and Service Bus: receive(timeout) blocks forever when
there are no messages
Hi,
I am trying to communicate with Service Bus for Windows Server via AMQP and
found this problem.
This was tried with Qpid JMS 0.9.0 and also with the latest snapshot. If
there are no messages on the queue when I call receive(timeout>0), the call
blocks forever. Sending a message to the same queue after the call does not
help either.
Here is the stack trace:
Unsafe.park(boolean, long) line: not available [native method]
LockSupport.park(Object) line: 186
CountDownLatch$Sync(AbstractQueuedSynchronizer).parkAndCheckInterrupt()
line: 834
CountDownLatch$Sync(AbstractQueuedSynchronizer).doAcquireSharedInterruptibly(int)
line: 994
CountDownLatch$Sync(AbstractQueuedSynchronizer).acquireSharedInterruptibly(int)
line: 1303
CountDownLatch.await() line: 236
ProviderFuture.sync() line: 97
JmsConnection.pull(JmsConsumerId, long, ProviderSynchronization) line:
766
JmsConnection.pull(JmsConsumerId, long) line: 755
JmsMessageConsumer.performPullIfRequired(long, boolean) line: 631
JmsMessageConsumer.dequeue(long, boolean) line: 263
JmsMessageConsumer.receive(long) line: 196
Receiver.main(String[]) line: 80
I used the Receiver class in the included examples. The connection string
is:
amqps://x.x.x.x:5671/?transport.verifyHost=false&amqp.idleTimeout=121000
I am setting this timeout, because Service Bus wants >=60 s timeout in AMQP
OPEN.
And just as reference, these combinations I already tried and
receive(timeout) returns null as expected:
- Qpid JMS 0.9.0 against AMQP ActiveMQ
- Qpid 0.32 (amqp-1-0-client) against AMQP ActiveMQ
- Qpid 0.32 (amqp-1-0-client) against AMQP Service Bus
So, is it a bug or I am missing something?
Thanks!
Re: Qpid JMS 0.9.0 and Service Bus: receive(timeout) blocks forever
when there are no messages
Posted by Robbie Gemmell <ro...@gmail.com>.
There are actually a lot of reasons this can happen, but a simple to
understand one would be to imagine it is a large message, or you have
a low bandwidth connection, or both, so it takes a certain period of
time for the server to send the message and the client recieve the
complete message then decode it and place it in the consumers buffer.
During that time, the consumer has no messages to give.
When not configured otherwise as I outlined below, the consumer
normally 'drains' the receieving link before returning null to ensure
that there are really no messages available/on their way. In this case
it would appear that Service Bus for Windows Server didnt respond as
expected to the drain request.
Robbie
On 22 June 2016 at 10:59, Dale Green <gr...@gmail.com> wrote:
> Hi Robbie,
>
> Thank you! Adding &jms.receiveLocalOnly=true to the connection string fixed
> the problem.
>
> As far as I understand, this options can lead to a situation when
> receive(timeout) returns null (because of an empty local buffer), but
> actually there is a message on the queue. Under what circumstances can this
> happen?
>
> Thanks!
>
>
>
> On Wed, Jun 22, 2016 at 11:16 AM, Robbie Gemmell <ro...@gmail.com>
> wrote:
>
>> The only case we have seen this is where the server fails to respond
>> as expected to the consumers attempt to drain its link credit when a
>> receive expires without a message being available. The 0.10.0 client
>> release adds a timeout that will close the consumer if this arises.
>>
>> If you add the "jms.receiveLocalOnly=true" option+value (from
>>
>> http://qpid.apache.org/releases/qpid-jms-0.9.0/docs/index.html#jms-configuration-options
>> )
>> to your connection URI it will configure the consumer to work out of
>> its local buffer without draining the link when nothing arrives. If
>> that helps, that would indicate the above is likely correct, but
>> looking at the protocol trace logging might confirm, see the bottom of
>> http://qpid.apache.org/releases/qpid-jms-0.9.0/docs/index.html#logging
>> for details of hwo to enable it.
>>
>> Robbie
>>
>> On 22 June 2016 at 10:00, Dale Green <gr...@gmail.com> wrote:
>> > Hi,
>> >
>> > I am trying to communicate with Service Bus for Windows Server via AMQP
>> and
>> > found this problem.
>> >
>> > This was tried with Qpid JMS 0.9.0 and also with the latest snapshot. If
>> > there are no messages on the queue when I call receive(timeout>0), the
>> call
>> > blocks forever. Sending a message to the same queue after the call does
>> not
>> > help either.
>> >
>> > Here is the stack trace:
>> >
>> > Unsafe.park(boolean, long) line: not available [native method]
>> > LockSupport.park(Object) line: 186
>> > CountDownLatch$Sync(AbstractQueuedSynchronizer).parkAndCheckInterrupt()
>> > line: 834
>> >
>> CountDownLatch$Sync(AbstractQueuedSynchronizer).doAcquireSharedInterruptibly(int)
>> > line: 994
>> >
>> CountDownLatch$Sync(AbstractQueuedSynchronizer).acquireSharedInterruptibly(int)
>> > line: 1303
>> > CountDownLatch.await() line: 236
>> > ProviderFuture.sync() line: 97
>> > JmsConnection.pull(JmsConsumerId, long, ProviderSynchronization) line:
>> > 766
>> > JmsConnection.pull(JmsConsumerId, long) line: 755
>> > JmsMessageConsumer.performPullIfRequired(long, boolean) line: 631
>> > JmsMessageConsumer.dequeue(long, boolean) line: 263
>> > JmsMessageConsumer.receive(long) line: 196
>> > Receiver.main(String[]) line: 80
>> >
>> > I used the Receiver class in the included examples. The connection string
>> > is:
>> > amqps://x.x.x.x:5671/?transport.verifyHost=false&amqp.idleTimeout=121000
>> >
>> > I am setting this timeout, because Service Bus wants >=60 s timeout in
>> AMQP
>> > OPEN.
>> >
>> > And just as reference, these combinations I already tried and
>> > receive(timeout) returns null as expected:
>> > - Qpid JMS 0.9.0 against AMQP ActiveMQ
>> > - Qpid 0.32 (amqp-1-0-client) against AMQP ActiveMQ
>> > - Qpid 0.32 (amqp-1-0-client) against AMQP Service Bus
>> >
>> > So, is it a bug or I am missing something?
>> >
>> > Thanks!
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
>> For additional commands, e-mail: users-help@qpid.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org
Re: Qpid JMS 0.9.0 and Service Bus: receive(timeout) blocks forever
when there are no messages
Posted by Dale Green <gr...@gmail.com>.
Hi Robbie,
Thank you! Adding &jms.receiveLocalOnly=true to the connection string fixed
the problem.
As far as I understand, this options can lead to a situation when
receive(timeout) returns null (because of an empty local buffer), but
actually there is a message on the queue. Under what circumstances can this
happen?
Thanks!
On Wed, Jun 22, 2016 at 11:16 AM, Robbie Gemmell <ro...@gmail.com>
wrote:
> The only case we have seen this is where the server fails to respond
> as expected to the consumers attempt to drain its link credit when a
> receive expires without a message being available. The 0.10.0 client
> release adds a timeout that will close the consumer if this arises.
>
> If you add the "jms.receiveLocalOnly=true" option+value (from
>
> http://qpid.apache.org/releases/qpid-jms-0.9.0/docs/index.html#jms-configuration-options
> )
> to your connection URI it will configure the consumer to work out of
> its local buffer without draining the link when nothing arrives. If
> that helps, that would indicate the above is likely correct, but
> looking at the protocol trace logging might confirm, see the bottom of
> http://qpid.apache.org/releases/qpid-jms-0.9.0/docs/index.html#logging
> for details of hwo to enable it.
>
> Robbie
>
> On 22 June 2016 at 10:00, Dale Green <gr...@gmail.com> wrote:
> > Hi,
> >
> > I am trying to communicate with Service Bus for Windows Server via AMQP
> and
> > found this problem.
> >
> > This was tried with Qpid JMS 0.9.0 and also with the latest snapshot. If
> > there are no messages on the queue when I call receive(timeout>0), the
> call
> > blocks forever. Sending a message to the same queue after the call does
> not
> > help either.
> >
> > Here is the stack trace:
> >
> > Unsafe.park(boolean, long) line: not available [native method]
> > LockSupport.park(Object) line: 186
> > CountDownLatch$Sync(AbstractQueuedSynchronizer).parkAndCheckInterrupt()
> > line: 834
> >
> CountDownLatch$Sync(AbstractQueuedSynchronizer).doAcquireSharedInterruptibly(int)
> > line: 994
> >
> CountDownLatch$Sync(AbstractQueuedSynchronizer).acquireSharedInterruptibly(int)
> > line: 1303
> > CountDownLatch.await() line: 236
> > ProviderFuture.sync() line: 97
> > JmsConnection.pull(JmsConsumerId, long, ProviderSynchronization) line:
> > 766
> > JmsConnection.pull(JmsConsumerId, long) line: 755
> > JmsMessageConsumer.performPullIfRequired(long, boolean) line: 631
> > JmsMessageConsumer.dequeue(long, boolean) line: 263
> > JmsMessageConsumer.receive(long) line: 196
> > Receiver.main(String[]) line: 80
> >
> > I used the Receiver class in the included examples. The connection string
> > is:
> > amqps://x.x.x.x:5671/?transport.verifyHost=false&amqp.idleTimeout=121000
> >
> > I am setting this timeout, because Service Bus wants >=60 s timeout in
> AMQP
> > OPEN.
> >
> > And just as reference, these combinations I already tried and
> > receive(timeout) returns null as expected:
> > - Qpid JMS 0.9.0 against AMQP ActiveMQ
> > - Qpid 0.32 (amqp-1-0-client) against AMQP ActiveMQ
> > - Qpid 0.32 (amqp-1-0-client) against AMQP Service Bus
> >
> > So, is it a bug or I am missing something?
> >
> > Thanks!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>
Re: Qpid JMS 0.9.0 and Service Bus: receive(timeout) blocks forever
when there are no messages
Posted by Robbie Gemmell <ro...@gmail.com>.
The only case we have seen this is where the server fails to respond
as expected to the consumers attempt to drain its link credit when a
receive expires without a message being available. The 0.10.0 client
release adds a timeout that will close the consumer if this arises.
If you add the "jms.receiveLocalOnly=true" option+value (from
http://qpid.apache.org/releases/qpid-jms-0.9.0/docs/index.html#jms-configuration-options)
to your connection URI it will configure the consumer to work out of
its local buffer without draining the link when nothing arrives. If
that helps, that would indicate the above is likely correct, but
looking at the protocol trace logging might confirm, see the bottom of
http://qpid.apache.org/releases/qpid-jms-0.9.0/docs/index.html#logging
for details of hwo to enable it.
Robbie
On 22 June 2016 at 10:00, Dale Green <gr...@gmail.com> wrote:
> Hi,
>
> I am trying to communicate with Service Bus for Windows Server via AMQP and
> found this problem.
>
> This was tried with Qpid JMS 0.9.0 and also with the latest snapshot. If
> there are no messages on the queue when I call receive(timeout>0), the call
> blocks forever. Sending a message to the same queue after the call does not
> help either.
>
> Here is the stack trace:
>
> Unsafe.park(boolean, long) line: not available [native method]
> LockSupport.park(Object) line: 186
> CountDownLatch$Sync(AbstractQueuedSynchronizer).parkAndCheckInterrupt()
> line: 834
> CountDownLatch$Sync(AbstractQueuedSynchronizer).doAcquireSharedInterruptibly(int)
> line: 994
> CountDownLatch$Sync(AbstractQueuedSynchronizer).acquireSharedInterruptibly(int)
> line: 1303
> CountDownLatch.await() line: 236
> ProviderFuture.sync() line: 97
> JmsConnection.pull(JmsConsumerId, long, ProviderSynchronization) line:
> 766
> JmsConnection.pull(JmsConsumerId, long) line: 755
> JmsMessageConsumer.performPullIfRequired(long, boolean) line: 631
> JmsMessageConsumer.dequeue(long, boolean) line: 263
> JmsMessageConsumer.receive(long) line: 196
> Receiver.main(String[]) line: 80
>
> I used the Receiver class in the included examples. The connection string
> is:
> amqps://x.x.x.x:5671/?transport.verifyHost=false&amqp.idleTimeout=121000
>
> I am setting this timeout, because Service Bus wants >=60 s timeout in AMQP
> OPEN.
>
> And just as reference, these combinations I already tried and
> receive(timeout) returns null as expected:
> - Qpid JMS 0.9.0 against AMQP ActiveMQ
> - Qpid 0.32 (amqp-1-0-client) against AMQP ActiveMQ
> - Qpid 0.32 (amqp-1-0-client) against AMQP Service Bus
>
> So, is it a bug or I am missing something?
>
> Thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org