You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Noel O'Connor <no...@gmail.com> on 2012/06/17 09:34:00 UTC

Flow control in JMS Client (QPID 0.16)

Hi,
I'm currently writing a quick performance demo and I wanted to see how QPID handled producer flow control.
I'm using the C++ broker with the JMS client and the JMS client seems to ignore flow control. 

I have a queue configured using 

qpid-config add queue noc-large-fc-queue --durable --max-queue-count=1000 --flow-stop-count=800 --flow-resume-count=100 --limit-policy=flow-to-disk --file-size=40 --file-count=40

and I use the java spout example to add messages to the queue 

java -cp .:lib/* org.apache.qpid.example.Spout -c 50000 --content=teteetetet noc-large-fc-queue

I also use the java drain example to drain the Q.

However when I run the spout command I eventually get the exception

Exception in thread "main" javax.jms.JMSException: Error closing session: org.apache.qpid.AMQException: timed out waiting for sync: complete = 0, point = 50001 [error code 541: internal error]
	at org.apache.qpid.client.AMQSession.close(AMQSession.java:761)
	at org.apache.qpid.client.AMQSession.close(AMQSession.java:723)
	at org.apache.qpid.client.AMQSession.close(AMQSession.java:569)
	at org.apache.qpid.example.Spout.<init>(Spout.java:104)
	at org.apache.qpid.example.Spout.main(Spout.java:147)
Caused by: org.apache.qpid.AMQException: timed out waiting for sync: complete = 0, point = 50001 [error code 541: internal error]
	at org.apache.qpid.client.AMQSession_0_10.setCurrentException(AMQSession_0_10.java:1054)
	at org.apache.qpid.client.AMQSession_0_10.sendClose(AMQSession_0_10.java:406)
	at org.apache.qpid.client.AMQSession.close(AMQSession.java:755)
	... 4 more

and I notice that the qpid log files contain the lines
2012-06-17 17:24:45 info Threshold event triggered for noc-large-fc-queue, count=800, size=8000
2012-06-17 17:24:45 info Queue "noc-large-fc-queue": has reached 800 enqueued messages. Producer flow control activated.
2012-06-17 17:24:45 info Queue message count exceeded policy for noc-large-fc-queue

At no stage does the JMS spout output pause as if it were limited by flow control.

However when I try this with the python versions of spout/drain I can see spout pause when flow control is enabled and I see multiple occurrences of 

2012-06-17 17:30:35 info Threshold event triggered for noc-large-fc-queue, count=800, size=0
2012-06-17 17:30:35 info Threshold event triggered for noc-large-fc-queue, count=800, size=0
2012-06-17 17:30:35 info Queue "noc-large-fc-queue": has reached 800 enqueued messages. Producer flow control activated.
2012-06-17 17:30:37 info Queue "noc-large-fc-queue": has drained below the flow control resume level. Producer flow control deactivated.

Does the JMS client support flow control in 0.16 ? or am I missing some obvious ?

regards
Noel





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


Re: Flow control in JMS Client (QPID 0.16)

Posted by Noel O'Connor <no...@gmail.com>.
Done, 

https://issues.apache.org/jira/browse/QPID-4073

cheers
Noel


On 19/06/2012, at 6:25 PM, Gordon Sim wrote:

> On 06/19/2012 12:26 AM, Noel OConnor wrote:
>> Thanks for this Gordon,
>> 
>> I managed to get around this by call ((AMQSession) session).sync(); every
>> few messages.
> 
> Actually, thats a good point... you can also have the library do that for you by setting the qpid.session.command_limit system property. This limits the number of outstanding commands (i.e. commands waiting for 'completion'). It is not quite the same thing as messages as there are some other commands, but setting it to a value similar to the frequency at which you are manually calling sync should also work.
> 
>> Do you know if there are any plans to fix this or should I raise a BZ ?
> 
> Raising a JIRA would be great, 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: Flow control in JMS Client (QPID 0.16)

Posted by Gordon Sim <gs...@redhat.com>.
On 06/19/2012 12:26 AM, Noel OConnor wrote:
> Thanks for this Gordon,
>
> I managed to get around this by call ((AMQSession) session).sync(); every
> few messages.

Actually, thats a good point... you can also have the library do that 
for you by setting the qpid.session.command_limit system property. This 
limits the number of outstanding commands (i.e. commands waiting for 
'completion'). It is not quite the same thing as messages as there are 
some other commands, but setting it to a value similar to the frequency 
at which you are manually calling sync should also work.

> Do you know if there are any plans to fix this or should I raise a BZ ?

Raising a JIRA would be great, thanks!

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


Re: Flow control in JMS Client (QPID 0.16)

Posted by Noel OConnor <no...@gmail.com>.
Thanks for this Gordon,

I managed to get around this by call ((AMQSession) session).sync(); every
few messages.
Do you know if there are any plans to fix this or should I raise a BZ ?

regards
Noel

On Mon, Jun 18, 2012 at 7:23 PM, Gordon Sim <gs...@redhat.com> wrote:

> On 06/17/2012 08:34 AM, Noel O'Connor wrote:
>
>> Does the JMS client support flow control in 0.16 ?
>>
>
> Unfortunately not.
>
> (At least not in any usable form. The flow control works by delaying
> 'completions' - i.e. acknowledgements - form the broker to the publisher.
> The JMS client has a buffer of incomplete commands and when this fills up
> it will block for a short time - I believe the actual value may be
> hardcoded - then fail).
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.**org<us...@qpid.apache.org>
> For additional commands, e-mail: users-help@qpid.apache.org
>
>

Re: Flow control in JMS Client (QPID 0.16)

Posted by Gordon Sim <gs...@redhat.com>.
On 06/17/2012 08:34 AM, Noel O'Connor wrote:
> Does the JMS client support flow control in 0.16 ?

Unfortunately not.

(At least not in any usable form. The flow control works by delaying 
'completions' - i.e. acknowledgements - form the broker to the 
publisher. The JMS client has a buffer of incomplete commands and when 
this fills up it will block for a short time - I believe the actual 
value may be hardcoded - then fail).

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