Details
Description
i tried to test the MaximumPendingMessageLimit property in donet . but it doesn't work. i tried to setup it in Code, or ActiveMQ.XML ,it both doesn't work
1. create a durable consumer
2. create a producer and send message in topic (persistent send)
3. consumer get message and try to block the consumer speed. (speed is slow )
4 Go to web console check the pendingmessage number
The number should be keep the maxpendingmessage number. my consumer is slow the producer is faster. but i found out the number is still grow.
i will create another test poster and attach the test file in there
http://www.nabble.com/pendingmessagelimit-option-seems-doesn%27t-work!-td22447336r0.html
by the way there have another people test it , it also doesn't work for Java.
http://www.nabble.com/Fast-producers%2Cslow-consumer...-queue-growing-forever-td22373306.html
thanks
sample code---- include connection ,session ,consumer and producer
---------
public TopicConnection(IConnectionFactory connectionFactory, string clientId, string topicName)
{
this.connection = connectionFactory.CreateConnection() as Connection ;
this.connection.ClientId = clientId;
if (!this.connection.IsStarted)
{ this.connection.Start(); } this.session = this.connection.CreateSession(AcknowledgementMode.ClientAcknowledge) as Session;
session.MaximumPendingMessageLimit = 10;
session.PrefetchSize = 20;
this.topic = new ActiveMQTopic(topicName);
}
-------------------------------
----- running another console to get message--
IMessageConsumer consumer = this.session.CreateDurableConsumer(this.topic, consumerId, "2 > 1", false);
consumer.Listener += new MessageListener(consumer_Listener);
void consumer_Listener(IMessage message)
---- running another console to send message
IMessageProducer producer = this.session.CreateProducer(this.topic);
while (true)
-------------