receiveNoWait() - not receiving messages

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

receiveNoWait() - not receiving messages

akabhishek1
Hi Team,

We need to consume message based on polling duration. So i did testing for
"receive(long timeout)" and "receiveNoWait()".

So far "receive(long timeout)" is working perfectly but there is an issue in
"receiveNoWait()" operation.

Issue - "receiveNoWait()" operation not consuming message

Please find attached class. I am publishing message continuously and
consuming as well. Publishing is working perfectly but i am not able to
receive message.

If you change operation name from "receiveNoWait()" to "receive(long
timeout)", then we will start receiving message continuously.

Am i doing any mistake? Could you please take a look on this issue.

Broker - Azure ServiceBus
Qpid - qpid-jms-client-0.43.0
Java - JDK8+

Regards,
Abhishek Kumar

TestQpidRcvrNoWait.java
<http://qpid.2158936.n2.nabble.com/file/t396358/TestQpidRcvrNoWait.java>  



--
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: receiveNoWait() - not receiving messages

Robbie Gemmell
Administrator
If receiveNoWait returns null it means the client didnt have a message
locally yet and the server didnt send the client a message when it
'drained' the link to provoke any possible delivery, so it has no
message to give you. I suggest running with the protocol trace enabled
to see if thats whats happening.

On Tue, 18 Jun 2019 at 17:05, akabhishek1
<[hidden email]> wrote:

>
> Hi Team,
>
> We need to consume message based on polling duration. So i did testing for
> "receive(long timeout)" and "receiveNoWait()".
>
> So far "receive(long timeout)" is working perfectly but there is an issue in
> "receiveNoWait()" operation.
>
> Issue - "receiveNoWait()" operation not consuming message
>
> Please find attached class. I am publishing message continuously and
> consuming as well. Publishing is working perfectly but i am not able to
> receive message.
>
> If you change operation name from "receiveNoWait()" to "receive(long
> timeout)", then we will start receiving message continuously.
>
> Am i doing any mistake? Could you please take a look on this issue.
>
> Broker - Azure ServiceBus
> Qpid - qpid-jms-client-0.43.0
> Java - JDK8+
>
> Regards,
> Abhishek Kumar
>
> TestQpidRcvrNoWait.java
> <http://qpid.2158936.n2.nabble.com/file/t396358/TestQpidRcvrNoWait.java>
>
>
>
> --
> 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: receiveNoWait() - not receiving messages

akabhishek1
Hi Robbie,

Please find the attached log. I kept the application idle for 9m, but
consumer doesn't receive any message.

As i am consuming message on demand, so client should receive message if
message available on broker. I checked broker and i can confirm that,
messages are avalaible on queue.

 Please suggest me if i am missing anything or is this a defect?

Regards,
Abhishek Kumar

ReceiveNoWaitLogs.txt
<http://qpid.2158936.n2.nabble.com/file/t396358/ReceiveNoWaitLogs.txt>  



--
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: receiveNoWait() - not receiving messages

Robbie Gemmell
Administrator
From the protocol trace I dont see anything suggesting that you are
missing something, it appears to be a bug in Service Bus. It doesnt
send the consumer a message, therefore the consumer cant give you one.

The trace shows a repeating pattern of 3 messages being sent
synchronously, the application logging it has sent a message, the
client issuing a 'draining' flow with 1 message credit for the
zero-prefetch consumer, and the server reacting by responding that it
has consumed the credit, without sending a message.

If there are messages available it would be expected it instead sent a
message using the credit, and not a 'response flow' indicating some or
all credit was consumed/drained without transferring messages (which
happens if there aren't enough messages to consume/drain it all by
sending them).

Robbie

On Wed, 19 Jun 2019 at 10:56, akabhishek1
<[hidden email]> wrote:

>
> Hi Robbie,
>
> Please find the attached log. I kept the application idle for 9m, but
> consumer doesn't receive any message.
>
> As i am consuming message on demand, so client should receive message if
> message available on broker. I checked broker and i can confirm that,
> messages are avalaible on queue.
>
>  Please suggest me if i am missing anything or is this a defect?
>
> Regards,
> Abhishek Kumar
>
> ReceiveNoWaitLogs.txt
> <http://qpid.2158936.n2.nabble.com/file/t396358/ReceiveNoWaitLogs.txt>
>
>
>
> --
> 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: receiveNoWait() - not receiving messages

akabhishek1
Hi Robbie,

Thanks a lot for quick reply. I replaced only "consumer.receiveNoWait()"
operation to "consumer.receive(100)" is source code and kept everything
same.

Please find the attached updated log. As you can see that, I am able to
receive messages continuously.

It will be very difficult for me to justify ServiceBus team for this issue,
as One operation "receive(100)" is working fine, but other operation
"receiveNoWait()" is not working fine.

Please take a look on attached log, if you still feel that there is no issue
from Qpid side then please let me know, so I can raise ticket against
ServiceBus team.

Regards,
Abhishek Kumar
ReceiveWaitDurationLogs.txt
<http://qpid.2158936.n2.nabble.com/file/t396358/ReceiveWaitDurationLogs.txt>  



--
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: receiveNoWait() - not receiving messages

Robbie Gemmell
Administrator
I dont need to look at the new trace to know that the old trace shows
an issue which is not in the client. The consumer asked for one
message be sent or the credit discarded, and the server discarded the
credit without sending a message (at least three of which were just
sent to and accepted by it immediately prior, and which you indicate
are visible on your queue).

The "consumer.receiveNoWait()" and "consumer.receive(100)" do
different things under the cover (unless a message is already locally
available at the client when the call is made, something you are
deliberately preventing from happening by configuring zero prefetch)
so it isnt surprising things might behave differently against a
server. The former grants 1 credit in a draining flow in this case,
requesting it either gets a message if available or an indication none
are available (here its getting such an indication). The latter grants
a credit, leaves it outstanding as you provided a receive time period,
returns any message arriving within the timeout, or drains the credit
upon timeout (thus ensuring your requested zero-prefetch behaviour)
and either returns a message if it arrives or null if one does not.

The difference with the receive(100) is likely that the server sends
the message due to the credit being outstanding for a period, and not
due to any subsequent drain attempts, which may no longer even occur
if the message is sent sufficiently quickly. The new logs show they
mostly dont happen at all and only sometimes do, but I'd guess even in
those cases the arriving message was probably still put in-flight
before the draining flows were received.

Robbie

On Wed, 19 Jun 2019 at 13:03, akabhishek1
<[hidden email]> wrote:

>
> Hi Robbie,
>
> Thanks a lot for quick reply. I replaced only "consumer.receiveNoWait()"
> operation to "consumer.receive(100)" is source code and kept everything
> same.
>
> Please find the attached updated log. As you can see that, I am able to
> receive messages continuously.
>
> It will be very difficult for me to justify ServiceBus team for this issue,
> as One operation "receive(100)" is working fine, but other operation
> "receiveNoWait()" is not working fine.
>
> Please take a look on attached log, if you still feel that there is no issue
> from Qpid side then please let me know, so I can raise ticket against
> ServiceBus team.
>
> Regards,
> Abhishek Kumar
> ReceiveWaitDurationLogs.txt
> <http://qpid.2158936.n2.nabble.com/file/t396358/ReceiveWaitDurationLogs.txt>
>
>
>
> --
> 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: receiveNoWait() - not receiving messages

akabhishek1
Thanks a lot for confirmation Robbie. I raised an issue with ServiceBus. I
will update you if i got any information from them.

Regards,
Abhishek Kumar



--
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]