You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by sparky2708 <da...@columbia.edu> on 2008/08/12 15:51:52 UTC

ACKs not being delivered correctly in ActiveMQ 5.1 (QueueSize growing)

I was using a C# client (NMS) to connect to the ActiveMQ 5.1 Broker and I am
noticing that the broker always sends me 11 messages and then stops sending
(am expecting to get about 200). I can reproduce this consistently - it
always sends me 11 messages. When I open JConsole it looks like the size of
the Queue (QueueSize in jconsole) on the broker keeps growing for the Queue
that I am subscribing to. When I make a connection in C# I call:

  IConnectionFactory connectionFactory = new ConnectionFactory(new
Uri(url));
            _connection = connectionFactory.CreateConnection();
            _connection.ExceptionListener += new
ExceptionListener(_connection_ExceptionListener);
            _connection.ClientId =
System.Environment.GetEnvironmentVariable("USERNAME") + "@" +
System.Environment.GetEnvironmentVariable("COMPUTERNAME") + "-" +
DateTime.Now + "--" + _connection.ClientId;
            _connection.AcknowledgementMode =
AcknowledgementMode.AutoAcknowledge;
            _connection.Start();

I tried to change the AcknowledgementMode to
            _connection.AcknowledgementMode =
AcknowledgementMode.ClientAcknowledge;

and acknowledge the messages myself when I receive them. Both
AutoAcknowledge and ClientAcknowledge (with my acknowledgments) consistently
receive only 11 messages out of 200 that I am expecting to receive. My
QueueSize in JConsole always increases in multiples of 11 when I start the
client. InFlightCount always says 11 also. It looks like the Producer that
sends those messages is throttling down or maybe ActiveMQ is throttling down
because it is not receiving ACKs [my theory]. Any ideas?

When I startup the broker 4.1.0-incubator which I was using before and
connect the same C# client to it then everything works as expected both when
I use ClientAcknowledge and AutoAcknowledge mode so this points to something
being wrong in the 5.1 broker that seems to be working correctly in 4.1.0.
-- 
View this message in context: http://www.nabble.com/ACKs-not-being-delivered-correctly-in-ActiveMQ-5.1-%28QueueSize-growing%29-tp18944691p18944691.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ACKs not being delivered correctly in ActiveMQ 5.1 (QueueSize growing)

Posted by Rob Davies <ra...@gmail.com>.
Hi Sateesh,

could you provide a JUnit test case ?

thanks,

Rob
On 15 Aug 2008, at 05:18, sparky2708 wrote:

>
> Rob,
>   what is the solution to use in the C# client. I don't believe it  
> has a
> PooledConnectionFactory and can you please shed some light on why  
> the way
> that it used to work in 4.1 doesn't work in 5.1? Why should we need to
> replace the way we establish a connection?
>
>
> rajdavies wrote:
>>
>> please use a PooledConnectionFactory - see
>> http://activemq.apache.org/jmstemplate-gotchas.html
>>
>> cheers,
>>
>> Rob
>> On 13 Aug 2008, at 22:20, sateesh wrote:
>>
>>>
>>> Hi,
>>>
>>> We are using the active MQ Version 5.1.0 and our Java Client app  
>>> uses
>>> Spring to Inject the jmsFactory and
>>>
>>> Here is the part of spring config where we inject the jmsFactory..
>>>
>>> [CODE]
>>> <bean id="jmsFactory"
>>> class="org.apache.activemq.ActiveMQConnectionFactory">
>>>   <property name="brokerURL">
>>>       <value>${jms.broker.url}</value>
>>>   </property>
>>>   </bean>
>>>   <bean id="messageProcessor"
>>>         class="com.app.MessageProcessorImplImpl"
>>>         init-method="init" >
>>>       <property name="jmsFactory">
>>>           <ref bean="jmsFactory" />
>>>       </property>
>>>   </bean>
>>> [/CODE]
>>>
>>> and MessageProcessorImpl overrides the onMessage() ...
>>>
>>> And by the way we switched back to ActiveMQ4.1 and everything works
>>> fine..The Spring version we are using is 2.0.6
>>>
>>> Sateesh
>>> -- 
>>> View this message in context:
>>> http://www.nabble.com/ACKs-not-being-delivered-correctly-in-ActiveMQ-5.1-%28QueueSize-growing%29-tp18944691p18971477.html
>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>
>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/ACKs-not-being-delivered-correctly-in-ActiveMQ-5.1-%28QueueSize-growing%29-tp18944691p18993573.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>


Re: ACKs not being delivered correctly in ActiveMQ 5.1 (QueueSize growing)

Posted by sparky2708 <da...@columbia.edu>.
Rob,
   what is the solution to use in the C# client. I don't believe it has a
PooledConnectionFactory and can you please shed some light on why the way
that it used to work in 4.1 doesn't work in 5.1? Why should we need to
replace the way we establish a connection?


rajdavies wrote:
> 
> please use a PooledConnectionFactory - see
> http://activemq.apache.org/jmstemplate-gotchas.html
> 
> cheers,
> 
> Rob
> On 13 Aug 2008, at 22:20, sateesh wrote:
> 
>>
>> Hi,
>>
>>  We are using the active MQ Version 5.1.0 and our Java Client app uses
>> Spring to Inject the jmsFactory and
>>
>>  Here is the part of spring config where we inject the jmsFactory..
>>
>> [CODE]
>> <bean id="jmsFactory"  
>> class="org.apache.activemq.ActiveMQConnectionFactory">
>>    <property name="brokerURL">
>>        <value>${jms.broker.url}</value>
>>    </property>
>>    </bean>
>>    <bean id="messageProcessor"
>>          class="com.app.MessageProcessorImplImpl"
>>          init-method="init" >
>>        <property name="jmsFactory">
>>            <ref bean="jmsFactory" />
>>        </property>
>>    </bean>
>> [/CODE]
>>
>> and MessageProcessorImpl overrides the onMessage() ...
>>
>> And by the way we switched back to ActiveMQ4.1 and everything works
>> fine..The Spring version we are using is 2.0.6
>>
>> Sateesh
>> -- 
>> View this message in context:
>> http://www.nabble.com/ACKs-not-being-delivered-correctly-in-ActiveMQ-5.1-%28QueueSize-growing%29-tp18944691p18971477.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/ACKs-not-being-delivered-correctly-in-ActiveMQ-5.1-%28QueueSize-growing%29-tp18944691p18993573.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ACKs not being delivered correctly in ActiveMQ 5.1 (QueueSize growing)

Posted by Rob Davies <ra...@gmail.com>.
please use a PooledConnectionFactory - see http://activemq.apache.org/jmstemplate-gotchas.html

cheers,

Rob
On 13 Aug 2008, at 22:20, sateesh wrote:

>
> Hi,
>
>  We are using the active MQ Version 5.1.0 and our Java Client app uses
> Spring to Inject the jmsFactory and
>
>  Here is the part of spring config where we inject the jmsFactory..
>
> [CODE]
> <bean id="jmsFactory"  
> class="org.apache.activemq.ActiveMQConnectionFactory">
>    <property name="brokerURL">
>        <value>${jms.broker.url}</value>
>    </property>
>    </bean>
>    <bean id="messageProcessor"
>          class="com.app.MessageProcessorImplImpl"
>          init-method="init" >
>        <property name="jmsFactory">
>            <ref bean="jmsFactory" />
>        </property>
>    </bean>
> [/CODE]
>
> and MessageProcessorImpl overrides the onMessage() ...
>
> And by the way we switched back to ActiveMQ4.1 and everything works
> fine..The Spring version we are using is 2.0.6
>
> Sateesh
> -- 
> View this message in context: http://www.nabble.com/ACKs-not-being-delivered-correctly-in-ActiveMQ-5.1-%28QueueSize-growing%29-tp18944691p18971477.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>


Re: ACKs not being delivered correctly in ActiveMQ 5.1 (QueueSize growing)

Posted by sateesh <sk...@dpfuture.biz>.
Hi,

  We are using the active MQ Version 5.1.0 and our Java Client app uses
Spring to Inject the jmsFactory and 

  Here is the part of spring config where we inject the jmsFactory..

 [CODE]
<bean id="jmsFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL">
        <value>${jms.broker.url}</value>
    </property>
    </bean>
    <bean id="messageProcessor" 
          class="com.app.MessageProcessorImplImpl"
          init-method="init" >
        <property name="jmsFactory">
            <ref bean="jmsFactory" />
        </property>
    </bean>
[/CODE]

 and MessageProcessorImpl overrides the onMessage() ...

 And by the way we switched back to ActiveMQ4.1 and everything works
fine..The Spring version we are using is 2.0.6

Sateesh
-- 
View this message in context: http://www.nabble.com/ACKs-not-being-delivered-correctly-in-ActiveMQ-5.1-%28QueueSize-growing%29-tp18944691p18971477.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ACKs not being delivered correctly in ActiveMQ 5.1 (QueueSize growing)

Posted by Rob Davies <ra...@gmail.com>.
Hi Sateesh - can you share some more details of your setup ?

cheers,

Rob

On 13 Aug 2008, at 19:45, sateesh wrote:

>
> Hi,
>
>  I am also having the same Issue ..Our Application worked fine with  
> 4.1
> version and after switching to 5.1.0 the JMS Client will pick up few
> messages ( i am not sure it is exactly 11) the messges are not  
> dispatched to
> the Consumers..!!!
>
>
> Regards
> Sateesh
>
>
>
>
>
> sparky2708 wrote:
>>
>> I was using a C# client (NMS) to connect to the ActiveMQ 5.1 Broker  
>> and I
>> am noticing that the broker always sends me 11 messages and then  
>> stops
>> sending (am expecting to get about 200). I can reproduce this  
>> consistently
>> - it always sends me 11 messages. When I open JConsole it looks  
>> like the
>> size of the Queue (QueueSize in jconsole) on the broker keeps  
>> growing for
>> the Queue that I am subscribing to. When I make a connection in C#  
>> I call:
>>
>>  IConnectionFactory connectionFactory = new ConnectionFactory(new
>> Uri(url));
>>            _connection = connectionFactory.CreateConnection();
>>            _connection.ExceptionListener += new
>> ExceptionListener(_connection_ExceptionListener);
>>            _connection.ClientId =
>> System.Environment.GetEnvironmentVariable("USERNAME") + "@" +
>> System.Environment.GetEnvironmentVariable("COMPUTERNAME") + "-" +
>> DateTime.Now + "--" + _connection.ClientId;
>>            _connection.AcknowledgementMode =
>> AcknowledgementMode.AutoAcknowledge;
>>            _connection.Start();
>>
>> I tried to change the AcknowledgementMode to
>>            _connection.AcknowledgementMode =
>> AcknowledgementMode.ClientAcknowledge;
>>
>> and acknowledge the messages myself when I receive them. Both
>> AutoAcknowledge and ClientAcknowledge (with my acknowledgments)
>> consistently receive only 11 messages out of 200 that I am  
>> expecting to
>> receive. My QueueSize in JConsole always increases in multiples of  
>> 11 when
>> I start the client. InFlightCount always says 11 also. It looks  
>> like the
>> Producer that sends those messages is throttling down or maybe  
>> ActiveMQ is
>> throttling down because it is not receiving ACKs [my theory]. Any  
>> ideas?
>>
>> When I startup the broker 4.1.0-incubator which I was using before  
>> and
>> connect the same C# client to it then everything works as expected  
>> both
>> when I use ClientAcknowledge and AutoAcknowledge mode so this  
>> points to
>> something being wrong in the 5.1 broker that seems to be working  
>> correctly
>> in 4.1.0.
>>
>
> -- 
> View this message in context: http://www.nabble.com/ACKs-not-being-delivered-correctly-in-ActiveMQ-5.1-%28QueueSize-growing%29-tp18944691p18968885.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>


Re: ACKs not being delivered correctly in ActiveMQ 5.1 (QueueSize growing)

Posted by sateesh <sk...@dpfuture.biz>.
Hi,

  I am also having the same Issue ..Our Application worked fine with 4.1
version and after switching to 5.1.0 the JMS Client will pick up few
messages ( i am not sure it is exactly 11) the messges are not dispatched to
the Consumers..!!!


Regards
Sateesh

 



sparky2708 wrote:
> 
> I was using a C# client (NMS) to connect to the ActiveMQ 5.1 Broker and I
> am noticing that the broker always sends me 11 messages and then stops
> sending (am expecting to get about 200). I can reproduce this consistently
> - it always sends me 11 messages. When I open JConsole it looks like the
> size of the Queue (QueueSize in jconsole) on the broker keeps growing for
> the Queue that I am subscribing to. When I make a connection in C# I call:
> 
>   IConnectionFactory connectionFactory = new ConnectionFactory(new
> Uri(url));
>             _connection = connectionFactory.CreateConnection();
>             _connection.ExceptionListener += new
> ExceptionListener(_connection_ExceptionListener);
>             _connection.ClientId =
> System.Environment.GetEnvironmentVariable("USERNAME") + "@" +
> System.Environment.GetEnvironmentVariable("COMPUTERNAME") + "-" +
> DateTime.Now + "--" + _connection.ClientId;
>             _connection.AcknowledgementMode =
> AcknowledgementMode.AutoAcknowledge;
>             _connection.Start();
> 
> I tried to change the AcknowledgementMode to
>             _connection.AcknowledgementMode =
> AcknowledgementMode.ClientAcknowledge;
> 
> and acknowledge the messages myself when I receive them. Both
> AutoAcknowledge and ClientAcknowledge (with my acknowledgments)
> consistently receive only 11 messages out of 200 that I am expecting to
> receive. My QueueSize in JConsole always increases in multiples of 11 when
> I start the client. InFlightCount always says 11 also. It looks like the
> Producer that sends those messages is throttling down or maybe ActiveMQ is
> throttling down because it is not receiving ACKs [my theory]. Any ideas?
> 
> When I startup the broker 4.1.0-incubator which I was using before and
> connect the same C# client to it then everything works as expected both
> when I use ClientAcknowledge and AutoAcknowledge mode so this points to
> something being wrong in the 5.1 broker that seems to be working correctly
> in 4.1.0.
> 

-- 
View this message in context: http://www.nabble.com/ACKs-not-being-delivered-correctly-in-ActiveMQ-5.1-%28QueueSize-growing%29-tp18944691p18968885.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.