Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 15945 invoked from network); 21 Nov 2008 19:04:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Nov 2008 19:04:27 -0000 Received: (qmail 50529 invoked by uid 500); 21 Nov 2008 19:04:35 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 50508 invoked by uid 500); 21 Nov 2008 19:04:35 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 50497 invoked by uid 99); 21 Nov 2008 19:04:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Nov 2008 11:04:35 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Nov 2008 19:03:20 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id AFF38234C297 for ; Fri, 21 Nov 2008 11:04:05 -0800 (PST) Message-ID: <2102882402.1227294245719.JavaMail.jira@brutus> Date: Fri, 21 Nov 2008 11:04:05 -0800 (PST) From: "Sharath Komarla (JIRA)" To: dev@activemq.apache.org Subject: [jira] Issue Comment Edited: (AMQ-1126) The Resource Adapter ignores the JMSXGroupID when dispatching to MDBs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/AMQ-1126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=47564#action_47564 ] skomarla edited comment on AMQ-1126 at 11/21/08 11:02 AM: ----------------------------------------------------------------- Here is a zip of a mvn project using spring. It has a junit test with two tests in it. Both tests start out with sending some message to a same queue split across three different group ids (20 to group A, 10 to group B, 5 to group C). My understanding of message groups leads me to believe that the messages within a group are delivered sequentially, but across the groups they are delivered in parallel. If you look at the output of the unit tests, it does not seem to be the case. in many cases, it seems the messages get delivered in FIFO order ignoring groups entirely... in the listeners, I have setup various sleeps to simulate slow consumers.. When the message is from group C, the sleep time is small, and thus all 5 messages from group C should be delivered before the second message from group is delivered.. it does not seem to be the case 1 test uses the connection factory directly to setup message consumers, and another uses spring's listener container. Neither seem to do what I expect. Maybe I just have something setup horribly incorrectly, but I've seen the exact same bahaviour using the RA. some sample output... (Sorry for the poorly configured logging) {noformat} ------------------------------------------------------- T E S T S ------------------------------------------------------- Running com.test.MessageSenderServiceTest Nov 21, 2008 1:58:01 PM org.apache.activemq.broker.BrokerService start INFO: Using Persistence Adapter: AMQPersistenceAdapter(activemq-data\localhost) Nov 21, 2008 1:58:02 PM org.apache.activemq.broker.BrokerService getBroker INFO: ActiveMQ 5.1.0 JMS Message Broker (localhost) is starting Nov 21, 2008 1:58:02 PM org.apache.activemq.broker.BrokerService getBroker INFO: For help or more information please see: http://activemq.apache.org/ Nov 21, 2008 1:58:02 PM org.apache.activemq.store.amq.AMQPersistenceAdapter start INFO: AMQStore starting using directory: activemq-data\localhost Nov 21, 2008 1:58:02 PM org.apache.activemq.broker.jmx.ManagementContext$1 run INFO: JMX consoles can connect to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi Nov 21, 2008 1:58:02 PM org.apache.activemq.kaha.impl.KahaStore initialize INFO: Kaha Store using data directory activemq-data\localhost\kr-store\state Nov 21, 2008 1:58:02 PM org.apache.activemq.store.amq.AMQPersistenceAdapter start INFO: Active data files: [] Nov 21, 2008 1:58:02 PM org.apache.activemq.kaha.impl.KahaStore initialize INFO: Kaha Store using data directory activemq-data\localhost\kr-store\data Nov 21, 2008 1:58:02 PM org.apache.activemq.broker.TransportConnector start INFO: Connector vm://localhost Started Nov 21, 2008 1:58:02 PM org.apache.activemq.broker.BrokerService start INFO: ActiveMQ JMS Message Broker (localhost, ID:skomarla-2752-1227293882509-0:0) started Nov 21, 2008 1:58:02 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1be0f0a: display name [org.springframework.context.support.ClassPathXmlA i Nov 21 13:58:02 EST 2008]; root of context hierarchy Nov 21, 2008 1:58:03 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from file [C:\workspace\msg-group-test\target\classes\META-INF\springcontext-jms-listener.xml] Nov 21, 2008 1:58:04 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from file [C:\workspace\msg-group-test\target\classes\META-INF\springcontext-jms-sender.xml] Nov 21, 2008 1:58:04 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from file [C:\workspace\msg-group-test\target\classes\META-INF\springcontext-jms.xml] Nov 21, 2008 1:58:04 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory INFO: Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@1be0f0a]: org.springframework.beans.factory.s Nov 21, 2008 1:58:04 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@16f144c: defining beans [org.springframework.jms. estListener,jmsTemplate,messageSenderService,jmsFactory]; root of factory hierarchy Nov 21, 2008 1:58:05 PM com.test.MessageSenderServiceTest testDirectConnection INFO: 20 messages sent to group A Nov 21, 2008 1:58:05 PM com.test.MessageSenderServiceTest testDirectConnection INFO: 10 messages sent to group B Nov 21, 2008 1:58:05 PM com.test.MessageSenderServiceTest testDirectConnection INFO: 5 messages sent to group C Nov 21, 2008 1:58:05 PM com.test.MessageSenderServiceTest$Worker run INFO: worker3 received msg A remaining 17 Nov 21, 2008 1:58:05 PM com.test.MessageSenderServiceTest$Worker run INFO: worker1 received msg A remaining 19 Nov 21, 2008 1:58:05 PM com.test.MessageSenderServiceTest$Worker run INFO: worker2 received msg A remaining 18 Nov 21, 2008 1:58:10 PM com.test.MessageSenderServiceTest$Worker run INFO: worker2 received msg A remaining 16 Nov 21, 2008 1:58:10 PM com.test.MessageSenderServiceTest$Worker run INFO: worker1 received msg A remaining 15 Nov 21, 2008 1:58:10 PM com.test.MessageSenderServiceTest$Worker run INFO: worker3 received msg A remaining 14 Nov 21, 2008 1:58:15 PM com.test.MessageSenderServiceTest$Worker run INFO: worker2 received msg A remaining 13 Nov 21, 2008 1:58:15 PM com.test.MessageSenderServiceTest$Worker run INFO: worker1 received msg A remaining 12 Nov 21, 2008 1:58:15 PM com.test.MessageSenderServiceTest$Worker run INFO: worker3 received msg A remaining 11 Nov 21, 2008 1:58:20 PM com.test.MessageSenderServiceTest$Worker run INFO: worker2 received msg A remaining 10 Nov 21, 2008 1:58:20 PM com.test.MessageSenderServiceTest$Worker run INFO: worker3 received msg A remaining 9 Nov 21, 2008 1:58:20 PM com.test.MessageSenderServiceTest$Worker run INFO: worker1 received msg A remaining 8 Nov 21, 2008 1:58:25 PM com.test.MessageSenderServiceTest$Worker run INFO: worker2 received msg A remaining 7 Nov 21, 2008 1:58:25 PM com.test.MessageSenderServiceTest$Worker run INFO: worker1 received msg A remaining 6 Nov 21, 2008 1:58:25 PM com.test.MessageSenderServiceTest$Worker run INFO: worker3 received msg A remaining 5 Nov 21, 2008 1:58:30 PM com.test.MessageSenderServiceTest$Worker run INFO: worker2 received msg A remaining 4 Nov 21, 2008 1:58:30 PM com.test.MessageSenderServiceTest$Worker run INFO: worker1 received msg A remaining 3 Nov 21, 2008 1:58:30 PM com.test.MessageSenderServiceTest$Worker run INFO: worker3 received msg A remaining 2 Nov 21, 2008 1:58:35 PM com.test.MessageSenderServiceTest$Worker run INFO: worker2 received msg A remaining 1 Nov 21, 2008 1:58:35 PM com.test.MessageSenderServiceTest$Worker run INFO: worker1 received msg A remaining 0 Nov 21, 2008 1:58:35 PM com.test.MessageSenderServiceTest$Worker run INFO: worker3 received msg B remaining 9 Nov 21, 2008 1:58:36 PM com.test.MessageSenderServiceTest$Worker run INFO: worker3 received msg B remaining 8 Nov 21, 2008 1:58:37 PM com.test.MessageSenderServiceTest$Worker run INFO: worker3 received msg B remaining 7 Nov 21, 2008 1:58:38 PM com.test.MessageSenderServiceTest$Worker run INFO: worker3 received msg B remaining 6 Nov 21, 2008 1:58:39 PM com.test.MessageSenderServiceTest$Worker run INFO: worker3 received msg B remaining 5 Nov 21, 2008 1:58:40 PM com.test.MessageSenderServiceTest$Worker run INFO: worker2 received msg B remaining 4 Nov 21, 2008 1:58:40 PM com.test.MessageSenderServiceTest$Worker run INFO: worker1 received msg B remaining 3 Nov 21, 2008 1:58:40 PM com.test.MessageSenderServiceTest$Worker run INFO: worker3 received msg B remaining 2 Nov 21, 2008 1:58:41 PM com.test.MessageSenderServiceTest$Worker run INFO: worker2 received msg B remaining 1 Nov 21, 2008 1:58:41 PM com.test.MessageSenderServiceTest$Worker run INFO: worker1 received msg B remaining 0 Nov 21, 2008 1:58:41 PM com.test.MessageSenderServiceTest$Worker run worker3 received msg C remaining 4 INFO: 100 Nov 21, 2008 1:58:41 PM com.test.MessageSenderServiceTest$Worker run worker3 received msg C remaining 3 INFO: 100 Nov 21, 2008 1:58:41 PM com.test.MessageSenderServiceTest$Worker run worker3 received msg C remaining 2 INFO: 100 worker2 received msg C remaining 1 Nov 21, 2008 1:58:42 PM com.test.MessageSenderServiceTest$Worker run INFO: 100 worker1 received msg C remaining 0 Nov 21, 2008 1:58:42 PM com.test.MessageSenderServiceTest$Worker run INFO: 100 Nov 21, 2008 1:58:42 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:42 EST 2008 group: A Nov 21, 2008 1:58:42 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:42 EST 2008 group: A Nov 21, 2008 1:58:42 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:42 EST 2008 group: A Nov 21, 2008 1:58:42 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:42 EST 2008 group: A Nov 21, 2008 1:58:42 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:42 EST 2008 group: A Nov 21, 2008 1:58:42 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:42 EST 2008 group: A Nov 21, 2008 1:58:42 PM com.test.MessageSenderServiceTest testSpringListenerContainer INFO: 20 messages sent to group A Nov 21, 2008 1:58:42 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:42 EST 2008 group: A Nov 21, 2008 1:58:42 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:42 EST 2008 group: A Nov 21, 2008 1:58:42 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:42 EST 2008 group: A Nov 21, 2008 1:58:42 PM com.test.MessageSenderServiceTest testSpringListenerContainer INFO: 10 messages sent to group B Nov 21, 2008 1:58:42 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:42 EST 2008 group: A Nov 21, 2008 1:58:42 PM com.test.MessageSenderServiceTest testSpringListenerContainer INFO: 5 messages sent to group C Nov 21, 2008 1:58:47 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:47 EST 2008 group: A Nov 21, 2008 1:58:47 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:47 EST 2008 group: A Nov 21, 2008 1:58:47 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:47 EST 2008 group: A Nov 21, 2008 1:58:47 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:47 EST 2008 group: A Nov 21, 2008 1:58:47 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:47 EST 2008 group: A Nov 21, 2008 1:58:47 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:47 EST 2008 group: A Nov 21, 2008 1:58:47 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:47 EST 2008 group: A Nov 21, 2008 1:58:47 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:47 EST 2008 group: A Nov 21, 2008 1:58:47 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:47 EST 2008 group: A Nov 21, 2008 1:58:47 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:47 EST 2008 group: A Nov 21, 2008 1:58:52 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:52 EST 2008 group: B Nov 21, 2008 1:58:52 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:52 EST 2008 group: C Nov 21, 2008 1:58:52 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:52 EST 2008 group: B Nov 21, 2008 1:58:52 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:52 EST 2008 group: B Nov 21, 2008 1:58:52 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:52 EST 2008 group: B Nov 21, 2008 1:58:52 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:52 EST 2008 group: C Nov 21, 2008 1:58:52 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:52 EST 2008 group: C Nov 21, 2008 1:58:52 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:52 EST 2008 group: C Nov 21, 2008 1:58:52 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:52 EST 2008 group: C Nov 21, 2008 1:58:53 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:53 EST 2008 group: B Nov 21, 2008 1:58:53 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:53 EST 2008 group: B Nov 21, 2008 1:58:53 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:53 EST 2008 group: B Nov 21, 2008 1:58:54 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:54 EST 2008 group: B Nov 21, 2008 1:58:54 PM com.test.impl.TestListenerImpl onMessage INFO: Fri Nov 21 13:58:54 EST 2008 group: B and on and on .... {noformat} If I get the time today, I'll try to set something up that uses the RA directly (using the junit tests under activemq-ra as inspiration) to see if i can recreate a unit test dirctly using the RA code that exhibits the problem. Thanks was (Author: skomarla): Here is a zip of a mvn project using spring. It has a junit test with two tests in it. Both tests start out with sending some message to a same queue split across three different group ids (20, 10, 5) across groups A, B, C respectively. My understanding of message groups leads me to believe that the messages within a group are delivered sequentially, but across the groups they are delivered in parallel. If you look at the output of the unit tests, it does not seem to be the case. 1 test uses the connection factory directly to setup message consumers, and another uses spring's listener container. Neither seem to do what I expect. Maybe I just have something setup horribly incorrectly, but I've seen the exact same bahaviour using the RA. If I get the time today, I'll try to set something up that uses the RA directly (using the junit tests under activemq-ra as inspiration) to see if i can recreate a unit test dirctly using the RA code that exhibits the problem. Thanks > The Resource Adapter ignores the JMSXGroupID when dispatching to MDBs > --------------------------------------------------------------------- > > Key: AMQ-1126 > URL: https://issues.apache.org/activemq/browse/AMQ-1126 > Project: ActiveMQ > Issue Type: Bug > Components: JCA Container > Affects Versions: 4.0.1 > Environment: Java 1.4.2_08 > JBoss 4.0.4 > ActiveMQ 4.0.1 > Reporter: John Robinson > Fix For: 5.3.0 > > Attachments: msg-group-test.zip > > > Integrate AMQ into JBoss using the data source, and resource adapter. Create an outbound queue and an MDB with a pool size of 100. Dispatch several messages to the outbound queue, setting the JMSXGroupID property on the message to be the same value each time. In the MDB's onMessage method print out the MDBs toString (don't override toString) and you should see something that looks like: > OutQueueProcessorBean@19a7266 > Observe two things: > a) Many messages are processed in parallel > b) Many different values will occur after the @ in the above message, denoting that more than on MDB instance is being handed messages. > The correct behavior would be to dispatch messages with the same group id to the same MDB instance in sequence. This would allow messages from different groups to be processed in parallel, but messages in any one group would be processed serially, in the order in which they were placed into the queue. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.