activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Giampaolo Tranchida (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AMQ-2323) purge in jconsole failed
Date Wed, 21 Apr 2010 14:39:18 GMT

    [ https://issues.apache.org/activemq/browse/AMQ-2323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59010#action_59010
] 

Giampaolo Tranchida commented on AMQ-2323:
------------------------------------------

This issue can be reproduce easly sending message to a duplicate composite destination.
In the test case, 100 messages are really in the queue but the queueSize indicate 200.
Purge cause infinite loop.

{code}
public class SendDuplicateMessage {

    public static void main(String[] args) {

        ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("smx", "smx", "tcp://localhost:50910");
        PooledConnectionFactory pool = new PooledConnectionFactory();
        pool.setConnectionFactory(cf);
        pool.start();

        JmsTemplate jt = new JmsTemplate(pool);

        StringBuffer text = new StringBuffer();
        for (int n=0; n<1000; n++) {
            text.append("0123456789");
        }

        final String body = text.toString();

        for (int i=0; i<100; i++) {
            final String messageNo = "message #" + i;
            System.out.println(messageNo);
            jt.send("testQueue,testQueue", new MessageCreator() {
                public Message createMessage(Session session) throws JMSException {
                    TextMessage m = session.createTextMessage();
                    m.setText(body);
                    m.setStringProperty("info", messageNo);
                    return m;
                }
            });
        }
        pool.stop();
    }

}

{code}

> purge in jconsole failed
> ------------------------
>
>                 Key: AMQ-2323
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2323
>             Project: ActiveMQ
>          Issue Type: Bug
>            Reporter: ying
>         Attachments: AMQ-2323.patch
>
>
> using queue purge in jconsole will create infinite loop because incorrect Statistics
whole loop

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


Mime
View raw message