Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 55239 invoked from network); 11 Aug 2009 16:43:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Aug 2009 16:43:56 -0000 Received: (qmail 8678 invoked by uid 500); 11 Aug 2009 16:24:27 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 8664 invoked by uid 500); 11 Aug 2009 16:24:27 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 8653 invoked by uid 99); 11 Aug 2009 16:24:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Aug 2009 16:24:27 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [209.85.219.219] (HELO mail-ew0-f219.google.com) (209.85.219.219) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Aug 2009 16:24:16 +0000 Received: by ewy19 with SMTP id 19so2703521ewy.20 for ; Tue, 11 Aug 2009 09:23:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.211.168.4 with SMTP id v4mr1132423ebo.82.1250007832375; Tue, 11 Aug 2009 09:23:52 -0700 (PDT) In-Reply-To: <24918802.post@talk.nabble.com> References: <56b1dfc30908100918y71cf343ftc6d7b0f82c67860@mail.gmail.com> <24904788.post@talk.nabble.com> <56b1dfc30908101254j70c62150x2cc1bebba63157f8@mail.gmail.com> <4A80C57D.1030301@gmail.com> <56b1dfc30908101859n65cbf0bbp6c36cf223b24d542@mail.gmail.com> <24918802.post@talk.nabble.com> Date: Tue, 11 Aug 2009 12:23:52 -0400 Message-ID: <56b1dfc30908110923p6ed9e10ah685d555ddc80b057@mail.gmail.com> Subject: Re: anyone have AMQ VirtualTopic's working in Camel Test? From: Mick Knutson To: users@camel.apache.org Content-Type: multipart/alternative; boundary=0015174bdcd8d0b19c0470e020a3 X-Virus-Checked: Checked by ClamAV on apache.org --0015174bdcd8d0b19c0470e020a3 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable I tried what you suggested with this Broker: ** ** And then I was sending messages to both the Topic, and the resulting que to determin what was getting through: //Send message to producer.sendBody(body+"XXXXXXXXXXXXXXX"+body); producer.sendBodyAndHeader("activemq:VirtualTopic.TEST", body+body+body, "foo", "bar"); *producer.sendBodyAndHeader("activemq:Consumer.A.VirtualTopic.TEST"= , body+"OOOOOOOOOOOO"+body, "foo", "bar");* But only the last message arrives at my MDP which is the one directly to th= e Consumer itself. The 1st 2 did not arrive as expected: *[myproject] INFO [org.springframework.jms.listener.DefaultMessageListenerContainer#0-1] StatusUpdateService.onMessage(17) | //-----------------------------* *------------------------------//* *[myproject] INFO [org.springframework.jms.listener.DefaultMessageListenerContainer#0-1] StatusUpdateService.onMessage(18) | //-----------------------------* *------------------------------//* *[myproject] INFO [org.springframework.jms.listener.DefaultMessageListenerContainer#0-1] StatusUpdateService.onMessage(19) | //-----------------------------* *------------------------------//* *[myproject] INFO [org.springframework.jms.listener.DefaultMessageListenerContainer#0-1] StatusUpdateService.onMessage(20) | //-----------------------------* *------------------------------//* *[myproject] INFO [org.springframework.jms.listener.DefaultMessageListenerContainer#0-1] StatusUpdateService.onMessage(21) | //-----------------------------* *------------------------------//* *[myproject] INFO [org.springframework.jms.listener.DefaultMessageListenerContainer#0-1] StatusUpdateService.onMessage(22) | //-----------------------------* *------------------------------//* *ActiveMQTextMessage {commandId =3D 5, responseRequired =3D true, messageId= =3D ID:L83601HY-3296-1250007358494-2:4:1:1:1, originalDestination =3D null, originalTran* *sactionId =3D null, producerId =3D ID:L83601HY-3296-1250007358494-2:4:1:1, destination =3D queue://Consumer.A.VirtualTopic.TEST, transactionId =3D nul= l, expiration* * =3D 0, timestamp =3D 1250007383823, arrival =3D 0, brokerInTime =3D 12500= 07383823, brokerOutTime =3D 1250007383823, correlationId =3D null, replyTo =3D null, persistent* * =3D true, type =3D null, priority =3D 4, groupID =3D null, groupSequence = =3D 0, targetConsumerId =3D null, compressed =3D false, userID =3D null, content = =3D null, marshall* *edProperties =3D org.apache.activemq.util.ByteSequence@16d3536, dataStruct= ure =3D null, redeliveryCounter =3D 0, size =3D 0, properties =3D {foo=3Dbar}, readOnlyProper* *ties =3D true, readOnlyBody =3D true, droppable =3D false, text =3D 33OOOOOOOOOOOO33}* I actually zipped up the source here: http://baselogic.com/temp/services.zip It should run on its own if you want to see my issue. I cd into the * table-service-su* DIR and run: mvn camel:run -e in one cmd prompt. Then in another one, I run mvn verify -e to run the unit tests. --- Thank You=85 Mick Knutson, President BASE Logic, Inc. Enterprise Architecture, Design, Mentoring & Agile Consulting p. (866) BLiNC-411: (254-6241-1) f. (415) 685-4233 Website: http://baselogic.com Linked IN: http://linkedin.com/in/mickknutson Vacation Rental: http://tahoe.baselogic.com --- On Tue, Aug 11, 2009 at 10:33 AM, Ashwin Karpe wrote= : > > Hi, > > Looks like you used the little snippet I sent in an as-is mode. I intende= d > this to be an example. > > In any case, you could use something like this in your broker > > > > > > > > > > > > > > > > > Notice in this example that the real queue is a queue named FOO and a rea= l > topic is a topic named BAR. > > Your consumers should listen on the topic named BAR and your clients shou= ld > send to the topi named MY.TOPIC which is a virtual topic. > > All messages sent to MY.TOPIC will be forwarded to subscribers to the top= ic > named BAR. > > Hope this clarifies things. My previous example showed a virtual topic > which > had a second level of indirection to a collection of topics which in turn > may have been connected to real topics. > > Cheers, > > Ashwin... > > > Mick Knutson-3 wrote: > > > > I changed the Topic to *activemq:VirtualTopic.TEST* and the consumer > queue > > to *activemq:Consumer.A.VirtualTopic.TEST* > > > > I see that the MDP and Topic get created: > > > > [myproject] DEBUG [main] > > DefaultInstrumentationAgent.registerMBeanWithServer(293) | Registered > > MBean > > with objectname: > > > org.apache.camel:context=3Dmick-knutsons-macbook.local/camel-2,type=3Dpro= cessors,nodeid=3Dto1,name=3D" > > *To[activemq:VirtualTopic.TEST]"* > > [myproject] DEBUG [main] DefaultComponentResolver.resolveComponent(77) = | > > Found component: activemq via type: > > org.apache.activemq.camel.component.ActiveMQComponent via: > > META-INF/services/org/apache/camel/component/activemq > > *[myproject] DEBUG [main] DefaultComponent.createEndpoint(77) | Creatin= g > > endpoint uri=3D[activemq://VirtualTopic.TEST]*, path=3D[VirtualTopic.TE= ST], > > parameters=3D[{}] > > *[myproject] DEBUG [main] DefaultCamelContext.getEndpoint(387) | > > activemq://VirtualTopic.TEST converted to endpoint: > > Endpoint[activemq://VirtualTopic.TEST] by component: > > org.apache.activemq.camel.component.ActiveMQComponent@47b7c1b7* > > [myproject] DEBUG [main] > > DefaultInstrumentationAgent.registerMBeanWithServer(293) | Registered > > MBean > > with objectname: > > > org.apache.camel:context=3Dmick-knutsons-macbook.local/camel-2,type=3Dend= points,name=3D"activemq://VirtualTopic.TEST\?id=3D0x5cab2ebd" > > [myproject] DEBUG [main] DefaultComponent.createEndpoint(77) | Creating > > endpoint uri=3D[activemq://Consumer.A.VirtualTopic.TEST], > > path=3D[Consumer.A.VirtualTopic.TEST], parameters=3D[{}] > > *[myproject] DEBUG [main] DefaultCamelContext.getEndpoint(387) | > > activemq://Consumer.A.VirtualTopic.TEST converted to endpoint: > > Endpoint[activemq://Consumer.A.VirtualTopic.TEST] by component: > > org.apache.activemq.camel.component.ActiveMQComponent@47b7c1b7* > > [myproject] DEBUG [main] > > DefaultInstrumentationAgent.registerMBeanWithServer(293) | Registered > > MBean > > with objectname: > > > org.apache.camel:context=3Dmick-knutsons-macbook.local/camel-2,type=3Dend= points,name=3D"activemq://Consumer.A.VirtualTopic.TEST\?id=3D0x561756a4" > > > > > > > > Each was converted to a AMQ Component. Is that correct? > > > > The MDP gets initialized as the client gets initialized. Then AFTER the > > client and server are both running, then I send a message to the server= , > > to > > have the server create a message to the VirtualTopic.TEST > > > > > > > > --- > > Thank You=85 > > > > Mick Knutson, President > > > > BASE Logic, Inc. > > Enterprise Architecture, Design, Mentoring & Agile Consulting > > p. (866) BLiNC-411: (254-6241-1) > > f. (415) 685-4233 > > > > Website: http://baselogic.com > > Linked IN: http://linkedin.com/in/mickknutson > > Vacation Rental: http://tahoe.baselogic.com > > --- > > > > > > > > On Mon, Aug 10, 2009 at 6:12 PM, Willem Jiang > > wrote: > > > >> According to AMQ's document > >> "The out-of-the-box defaults are described above. Namely that the only > >> virtual topics available must be within the VirtualTopic.> namespace a= nd > >> that the consumer queues are named Consumer.*.VirtualTopic.>." > >> > >> The support is out of box, and there is no addition configuration file > >> for > >> the unit test. > >> > >> BTW, did you start to listen the Consumer.A.VirtualTopic.TEST queue > >> before > >> you send the message to VirtualTopic.TEST ? > >> > >> Willem > >> > >> > >> Mick Knutson wrote: > >> > >>> I thought this was already PART of ActiveMQ not a rule that needed to > be > >>> added. > >>> But then again, I am just using an embedded broker for these tests. > >>> > >>> --- > >>> Thank You=85 > >>> > >>> Mick Knutson, President > >>> > >>> BASE Logic, Inc. > >>> Enterprise Architecture, Design, Mentoring & Agile Consulting > >>> p. (866) BLiNC-411: (254-6241-1) > >>> f. (415) 685-4233 > >>> > >>> Website: http://baselogic.com > >>> Linked IN: http://linkedin.com/in/mickknutson > >>> Vacation Rental: http://tahoe.baselogic.com > >>> --- > >>> > >>> > >>> > >>> On Mon, Aug 10, 2009 at 2:20 PM, Ashwin Karpe > >>> wrote: > >>> > >>> Hi, > >>>> > >>>> Do you have the rule for the virtual topic setup on the broker. I > >>>> wonder > >>>> if > >>>> this is the issue. This suspiciously sounds like the case. The virtu= al > >>>> queue/topic is like any other queue or topic from a broker perspecti= ve > >>>> and > >>>> only gets interpreted when a payload arrive with the destination nam= e > >>>> set > >>>> to > >>>> a virtual queue/topic. > >>>> > >>>> If a rule is not found the destination name is treated as a > normal/real > >>>> queue into which the message is dropped which is why your consumer > >>>> seems > >>>> to > >>>> get the message when it listens on the queue. > >>>> > >>>> You may want to add a virtual topic rule to the Actiemq broker being > >>>> used > >>>> using activemq.xml > >>>> > >>>> > >>>> Mick Knutson-3 wrote: > >>>> > >>>>> from the AMQ list, they suggested I use this JUnit test as an > example: > >>>>> > >>>>> > >>>> > https://svn.apache.org/repos/asf/activemq/trunk/activemq-core/src/test/ja= va/org/apache/activemq/broker/virtual/VirtualTopicPubSubTest.java > >>>> > >>>>> In the above test, the Producer sends a message to the VirtualTopic > >>>>> and > >>>>> 2 > >>>>> Consumers get this message in individual Durable Queue's. > >>>>> > >>>>> When I created this, I publish to: > >>>>> > >>>>> activemq:VirtualTopic.TEST > >>>>> > >>>>> and then I Consume on: > >>>>> > >>>>> activemq:Consumer.A.VirtualTopic.TEST > >>>>> > >>>>> > >>>>> > >>>>> But nothing arrives to my Client. When I change my client to listen > on > >>>>> > >>>>> activemq:VirtualTopic.TEST > >>>>> > >>>>> > >>>>> > >>>>> The messages are Consumed by the client. This is not what I want. > Does > >>>>> anyone have a working Camel AMQ VirtualTopic JUnit Test that can he= lp > >>>>> me > >>>>> out > >>>>> please? > >>>>> > >>>>> --- > >>>>> Thank You=85 > >>>>> > >>>>> Mick Knutson, President > >>>>> > >>>>> BASE Logic, Inc. > >>>>> Enterprise Architecture, Design, Mentoring & Agile Consulting > >>>>> p. (866) BLiNC-411: (254-6241-1) > >>>>> f. (415) 685-4233 > >>>>> > >>>>> Website: http://baselogic.com > >>>>> Linked IN: http://linkedin.com/in/mickknutson > >>>>> Vacation Rental: http://tahoe.baselogic.com > >>>>> --- > >>>>> > >>>>> > >>>>> > >>>> ----- > >>>> --- > >>>> Ashwin Karpe, Principal Consultant, PS - Opensource Center of > >>>> Competence > >>>> Progress Software Corporation > >>>> 14 Oak Park Drive > >>>> Bedford, MA 01730 > >>>> --- > >>>> +1-972-304-9084 (Office) > >>>> +1-972-971-1700 (Mobile) > >>>> ---- > >>>> Blog: http://opensourceknowledge.blogspot.com/ > >>>> > >>>> > >>>> -- > >>>> View this message in context: > >>>> > >>>> > http://www.nabble.com/anyone-have-AMQ-VirtualTopic%27s-working-in-Camel-T= est--tp24902737p24904788.html > >>>> Sent from the Camel - Users mailing list archive at Nabble.com. > >>>> > >>>> > >>>> > >>> > >> > > > > > > > ----- > --- > Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence > Progress Software Corporation > 14 Oak Park Drive > Bedford, MA 01730 > --- > +1-972-304-9084 (Office) > +1-972-971-1700 (Mobile) > ---- > Blog: http://opensourceknowledge.blogspot.com/ > > > -- > View this message in context: > http://www.nabble.com/anyone-have-AMQ-VirtualTopic%27s-working-in-Camel-T= est--tp24902737p24918802.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > --0015174bdcd8d0b19c0470e020a3--