[ 
https://issues.apache.org/jira/browse/QPIDJMS-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15929750#comment-15929750
 ] 

Robbie Gemmell commented on QPIDJMS-273:
----------------------------------------

The client blocks on send if the producer link has no credit, however it doesnt 
have specific insight of the session window and may buffer messages in Proton 
if there is link credit but not enough session window to send them. Proton 
checks that it doesnt send the link detach when closing the producer until 
after any buffered messages have been sent, which is why you see that closing 
the producer before the connection has a different effect in this case. Proton 
does also have a check that it doesnt send a connection close while there are 
buffered messages to be sent, however it is ineffective in this case due to the 
way it has been done. We would either have to change Proton to handle that 
situation better, or change the client not to get itself into that situation to 
begin with, or a bit of both.

In the mean time, as Rob suggested, closing the producer first will ensure the 
async sends get completed before the connection close. Alternatively, using the 
JMS 2.0 async send CompletionListener support you could ensure you wait for 
messages to actually be received and acknowledged by the broker before closing 
your connection or producer.

> Unable to send more than 2048 messages (async + persistent)
> -----------------------------------------------------------
>
>                 Key: QPIDJMS-273
>                 URL: https://issues.apache.org/jira/browse/QPIDJMS-273
>             Project: Qpid JMS
>          Issue Type: Bug
>          Components: qpid-jms-client
>            Reporter: Antonin Vyborny
>            Priority: Minor
>
> When I use jms.forceAsyncSend=True flag along with DeliveryMode.PERSISTENT I 
> am unable to receive more than 2048 messages in the queue. I am not receiving 
> any warning/error so from client it looks like all messages are sent, but 
> only 2048 messages are actually found in the queue.
> There is unfortunately nothing in the log either.
> Steps to reproduce: 
> 1) Use the Sender example (org.apache.qpid.jms.example.Sender)
> 2) Set the following in Sender class:
>     private static final int DEFAULT_COUNT = 3000;
>     private static final int DELIVERY_MODE = DeliveryMode.PERSISTENT;
> 3) Set async sending in jndi.properties:
>     amqp://localhost:5672?jms.forceAsyncSend=True
> 4) run the example...



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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

Reply via email to