Hi Joe, I think problem is that your thread is blocked on producer send(), so no matter sessions and connections nothing else could be done until it is unblocked.
Cheers -- Dejan Bosanac Open Source Integration - http://fusesource.com/ ActiveMQ in Action - http://www.manning.com/snyder/ Blog - http://www.nighttale.net On Wed, May 27, 2009 at 5:22 PM, Joe Fernandez < joe.fernan...@ttmsolutions.com> wrote: > > I am running some exception tests against AMQ 5.2 that force producer > flow-control to occur and have a question regarding sessions and flow > control. Here's my set up. > > Te test app, which is using an 'embedded' broker, has an object (Ob1) that > implements MessageListener. Ob1 creates two AMQ connections (con1, con2), a > session (s1) from con1, a session (s2) from con2, a producer (p1) from s1 > and a consumer (c2) from s2. The c2 consumer is assigned Ob1's onMessage() > method via c2.setMessageListener(this). The onMessage() method has a built > in delay to simulate a slow consumer. The ack mode is set to > AUTO_ACKNOWLEDGE. The producer and consumer are producing to and consuming > from the same destination, respectively. The message that is produced by p1 > is a relatively small text message; maybe 30 characters in length. > > When the test starts, p1 floods the queue with messages and producer flow > control kicks in, at which point p1 gets blocked. However, the calls to the > onMessage method also stop so the test hangs. Given that p1 and c2 are > operating within their own separate connections and sessions, shouldn't the > AMQ client code continue to call the onMessage method with messages even > when p1 gets placed in flow control mode? > > Side note: if I place con2, s2, and c2 in a separate thread object, then > the > test runs just fine. That is, the p1 producer goes in and out of flow > control as c2's onMessage continues to get called. > > Thanks, > Joe > > > > -- > View this message in context: > http://www.nabble.com/Problem-With-Producer-Flow-Control--tp23744774p23744774.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > >