You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Andreas Welchlin <an...@welchlin.de> on 2015/08/07 10:11:13 UTC

QpidSender::send() blocks

Hello,

I am using the C++ messaging API 0.28 to send AMQP 1.0 messages to an 
ActiveMQ message broker.

Everything worked fine for days but one time the QpidSender::send() 
command blocked. The sync flag was set to true.

The docu says that the send call blocks until the server confirms 
receipt of the messages. I assume that no receipt came in.

I would like my process to warn the user somehow so it should not block 
for two hours (what it actually did).

Could you suggest what I can do to avoid blocking for hours. Ssetting a 
timout would be nice but I see no possibility to set one for send().

Regards,
Andreas



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: QpidSender::send() blocks

Posted by Gordon Sim <gs...@redhat.com>.
On 08/07/2015 12:27 PM, Andreas Welchlin wrote:
> I asked myself if it would be a reasonable workaround to
>
> 1.) set sync to false
> 2.) always call getUnsettled() before sending a message out.
>
> So I could maybe determine that there is a problem before send() blocks
> forever?

Yes, you can send asynchronously and test that the getUnsettled() count 
is less than half the senders capacity, and that way you know that the 
next call will not block.

Of course when sending asynchronously, the return of the send() call 
doesn't mean that the message reached the broker yet. However that will 
be checked on the next send even if async and you can all call check() 
or even sync(false) at any time.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: QpidSender::send() blocks

Posted by Andreas Welchlin <an...@welchlin.de>.
Thank you, Gordon!


I asked myself if it would be a reasonable workaround to

1.) set sync to false
2.) always call getUnsettled() before sending a message out.

So I could maybe determine that there is a problem before send() blocks 
forever?



Andreas



Am 07.08.2015 um 12:45 schrieb Gordon Sim:
> On 08/07/2015 09:11 AM, Andreas Welchlin wrote:
>> Hello,
>>
>> I am using the C++ messaging API 0.28 to send AMQP 1.0 messages to an
>> ActiveMQ message broker.
>>
>> Everything worked fine for days but one time the QpidSender::send()
>> command blocked. The sync flag was set to true.
>>
>> The docu says that the send call blocks until the server confirms
>> receipt of the messages. I assume that no receipt came in.
>>
>> I would like my process to warn the user somehow so it should not block
>> for two hours (what it actually did).
>>
>> Could you suggest what I can do to avoid blocking for hours. Ssetting a
>> timout would be nice but I see no possibility to set one for send().
>
> There is a JIRA for that 
> https://issues.apache.org/jira/browse/QPID-4648, but I have not got 
> round to working on a fix. Patches are always welcome of course, but I 
> will try and take another look at it before too long. (It should be 
> relatively straightforward on the 1.0 path, a little more invasive on 
> the 0-10 path).
>
>
> ---------------------------------------------------------------------
> 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: QpidSender::send() blocks

Posted by Gordon Sim <gs...@redhat.com>.
On 08/07/2015 09:11 AM, Andreas Welchlin wrote:
> Hello,
>
> I am using the C++ messaging API 0.28 to send AMQP 1.0 messages to an
> ActiveMQ message broker.
>
> Everything worked fine for days but one time the QpidSender::send()
> command blocked. The sync flag was set to true.
>
> The docu says that the send call blocks until the server confirms
> receipt of the messages. I assume that no receipt came in.
>
> I would like my process to warn the user somehow so it should not block
> for two hours (what it actually did).
>
> Could you suggest what I can do to avoid blocking for hours. Ssetting a
> timout would be nice but I see no possibility to set one for send().

There is a JIRA for that 
https://issues.apache.org/jira/browse/QPID-4648, but I have not got 
round to working on a fix. Patches are always welcome of course, but I 
will try and take another look at it before too long. (It should be 
relatively straightforward on the 1.0 path, a little more invasive on 
the 0-10 path).


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org