qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robbie Gemmell <robbie.gemm...@gmail.com>
Subject Re: Qpid JMS 0.9.0 and Service Bus: receive(timeout) blocks forever when there are no messages
Date Thu, 23 Jun 2016 09:33:22 GMT
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 <green.dale1924@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 <robbie.gemmell@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 <green.dale1924@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


Mime
View raw message