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/07/08 19:49:48 UTC

How can Dequeuecount == Enqueuecount == Dispatchcount and QueueSize != 0?

I am using ActiveMQ 5.1.0 and I can't explain the following in JConsole (I
never pressed resetStats()). This seems to happen to most of my topics:

http://www.nabble.com/file/p18345113/untitled.jpg 

Any ideas?
-- 
View this message in context: http://www.nabble.com/How-can-Dequeuecount-%3D%3D-Enqueuecount-%3D%3D-Dispatchcount-and-QueueSize-%21%3D-0--tp18345113p18345113.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: How can Dequeuecount == Enqueuecount == Dispatchcount and QueueSize != 0?

Posted by sparky2708 <da...@columbia.edu>.
Now I remember why this looks so familiar. I filed a bug report for this:
AMQ-1600. I filed it as a bug for the trunk of 5.1.0 before 5.1.0 was
released so I am not sure why it wasn't fixed before the release of 5.1.0.
It was a known bug in the trunk. I guess I am going back to the latest
stable version: 4.1.0-incubator (as all other version had critical bugs in
them). I included my code below (works great under 4.1.0-incubator). So
disappointed... was really looking forward to using 5.1.0. Really hoping 5.2
is going to be better...



rajdavies wrote:
> 
> be great if you could come up with a test case!
> On 8 Jul 2008, at 18:49, sparky2708 wrote:
> 
>>
>> I am using ActiveMQ 5.1.0 and I can't explain the following in  
>> JConsole (I
>> never pressed resetStats()). This seems to happen to most of my  
>> topics:
>>
>> http://www.nabble.com/file/p18345113/untitled.jpg
>>
>> Any ideas?
>> -- 
>> View this message in context:
>> http://www.nabble.com/How-can-Dequeuecount-%3D%3D-Enqueuecount-%3D%3D-Dispatchcount-and-QueueSize-%21%3D-0--tp18345113p18345113.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-can-Dequeuecount-%3D%3D-Enqueuecount-%3D%3D-Dispatchcount-and-QueueSize-%21%3D-0--tp18345113p18372398.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: How can Dequeuecount == Enqueuecount == Dispatchcount and QueueSize != 0?

Posted by sparky2708 <da...@columbia.edu>.
Not really doing anything fancy... just calling send many times: persistent =
false...

public void send(String name, DESTINATION_TYPE destination_type, Destination
reply_to, MessageIntf wrapper, boolean persistent) throws Exception {
		Destination dest = createDestination(name, destination_type);
		MessageProducer publisher = getProducer(dest, persistent);
                          
                          //wrapper.generateXMLMessage() just generates some
XML message.
		TextMessage msg =
_session.createTextMessage(wrapper.generateXMLMessage());
		msg.setJMSReplyTo(reply_to);
		log.debug(this.getClass().getName() + ">>>>>> SENDING MESSAGE TO '" + dest
+ "': " + wrapper.generateXMLMessage());
		publisher.send(msg);
}




	public MessageProducer getProducer(Destination dest, boolean persistent)
throws Exception {
		//just a little optimization so I don't have too many producing running
amock. Have 1 producer per destination

                         if (_producer_cache.containsKey(dest.toString()))
			return _producer_cache.get(dest.toString());
		
		MessageProducer publisher = _session.createProducer(dest);
		if(persistent)
			publisher.setDeliveryMode(DeliveryMode.PERSISTENT);
		else
			publisher.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
		
		_producer_cache.put(dest.toString(), publisher);
		return publisher;
	}


/********************************************************************
	 * Create a topic
	 * @param name
	 * @return
	 * @throws JMSException
	 * 
	 *******************************************************************/
	public Destination createDestination(String name, DESTINATION_TYPE
destination) throws JMSException {
		switch (destination) {
		case TOPIC:
			return _session.createTopic(name);
		case QUEUE:
			return _session.createQueue(name);
		default:
			return null;
		}
	}



rajdavies wrote:
> 
> be great if you could come up with a test case!
> On 8 Jul 2008, at 18:49, sparky2708 wrote:
> 
>>
>> I am using ActiveMQ 5.1.0 and I can't explain the following in  
>> JConsole (I
>> never pressed resetStats()). This seems to happen to most of my  
>> topics:
>>
>> http://www.nabble.com/file/p18345113/untitled.jpg
>>
>> Any ideas?
>> -- 
>> View this message in context:
>> http://www.nabble.com/How-can-Dequeuecount-%3D%3D-Enqueuecount-%3D%3D-Dispatchcount-and-QueueSize-%21%3D-0--tp18345113p18345113.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-can-Dequeuecount-%3D%3D-Enqueuecount-%3D%3D-Dispatchcount-and-QueueSize-%21%3D-0--tp18345113p18347115.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: How can Dequeuecount == Enqueuecount == Dispatchcount and QueueSize != 0?

Posted by sparky2708 <da...@columbia.edu>.
Could this be because the acknowledge/commit is not working correctly?


rajdavies wrote:
> 
> be great if you could come up with a test case!
> On 8 Jul 2008, at 18:49, sparky2708 wrote:
> 
>>
>> I am using ActiveMQ 5.1.0 and I can't explain the following in  
>> JConsole (I
>> never pressed resetStats()). This seems to happen to most of my  
>> topics:
>>
>> http://www.nabble.com/file/p18345113/untitled.jpg
>>
>> Any ideas?
>> -- 
>> View this message in context:
>> http://www.nabble.com/How-can-Dequeuecount-%3D%3D-Enqueuecount-%3D%3D-Dispatchcount-and-QueueSize-%21%3D-0--tp18345113p18345113.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-can-Dequeuecount-%3D%3D-Enqueuecount-%3D%3D-Dispatchcount-and-QueueSize-%21%3D-0--tp18345113p18370325.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: How can Dequeuecount == Enqueuecount == Dispatchcount and QueueSize != 0?

Posted by Rob Davies <ra...@gmail.com>.
be great if you could come up with a test case!
On 8 Jul 2008, at 18:49, sparky2708 wrote:

>
> I am using ActiveMQ 5.1.0 and I can't explain the following in  
> JConsole (I
> never pressed resetStats()). This seems to happen to most of my  
> topics:
>
> http://www.nabble.com/file/p18345113/untitled.jpg
>
> Any ideas?
> -- 
> View this message in context: http://www.nabble.com/How-can-Dequeuecount-%3D%3D-Enqueuecount-%3D%3D-Dispatchcount-and-QueueSize-%21%3D-0--tp18345113p18345113.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>