activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "xinfang.yuan (JIRA)" <>
Subject [jira] Created: (AMQ-2164) The MaximumPendingMessageLimit option is doesn't work in .Net
Date Mon, 16 Mar 2009 16:59:39 GMT
The MaximumPendingMessageLimit option is doesn't work  in .Net

                 Key: AMQ-2164
             Project: ActiveMQ
          Issue Type: Bug
          Components: JMS client
    Affects Versions: 5.2.0
         Environment:  ActiveMQ 5.2, XP 64,NMS, NMS.ActiveMQ, vs2008 ,java1.6 ant build the
            Reporter: xinfang.yuan
            Priority: Critical

I tried to test the MaximumPendingMessageLimit property in donet . But it doesn't work. i
tried to setup it in Code, and  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 keeping 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!-td22447336r0.html

By the way there have another people test it , it also doesn't work for Java.


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)
ActiveMQTextMessage msg = message as ActiveMQTextMessage; Console.WriteLine("Message received:"
+ "Id = " + msg.NMSMessageId + ", Content:" + msg.Text); Thread.sleep(1000);//block here message.Acknowledge();


---- running another console to send message
IMessageProducer producer = this.session.CreateProducer(this.topic);
while (true)
 publisher.SendMessage("Message:" + DateTime.Now.ToString("yyyy-mm-dd HH:MM:ss") + "---" +
i.ToString() );

And both setup it into activemq.xml
                   <policyEntry topic=">">
                             <strictOrderDispatchPolicy />
              <constantPendingMessageLimitStrategy limit="10"/>


This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message