You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Mick Knutson <mk...@baselogic.com> on 2009/08/10 18:18:51 UTC

anyone have AMQ VirtualTopic's working in Camel Test?

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/java/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 help me out
please?

---
Thank You…

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
---

Re: anyone have AMQ VirtualTopic's working in Camel Test?

Posted by Mick Knutson <mk...@baselogic.com>.
I get no message delivered.

I see the Topic getting created;

[myproject] DEBUG [main]
DefaultInstrumentationAgent.registerMBeanWithServer(293) | Registered MBean
with objectname:
org.apache.camel:context=mick-knutsons-macbook.local/camel-2,type=processors,nodeid=to1,name="To[activemq:VirtualTopicConsumers.1]"
[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) | Creating
endpoint uri=[activemq://VirtualTopicConsumers.1],
path=[VirtualTopicConsumers.1], parameters=[{}]
[myproject] DEBUG [main] DefaultCamelContext.getEndpoint(387) |
activemq://VirtualTopicConsumers.1 converted to endpoint:
Endpoint[activemq://VirtualTopicConsumers.1] by component:
org.apache.activemq.camel.component.ActiveMQComponent@6179a0ab
[myproject] DEBUG [main]
DefaultInstrumentationAgent.registerMBeanWithServer(293) | Registered MBean
with objectname:
org.apache.camel:context=mick-knutsons-macbook.local/camel-2,type=endpoints,name="activemq://VirtualTopicConsumers.1\?id=0x6d67751d"
[myproject] DEBUG [main] DefaultComponent.createEndpoint(77) | Creating
endpoint uri=[activemq://Player.VirtualTopicConsumers.1],
path=[Player.VirtualTopicConsumers.1], parameters=[{}]
[myproject] DEBUG [main] DefaultCamelContext.getEndpoint(387) |
activemq://Player.VirtualTopicConsumers.1 converted to endpoint:
Endpoint[activemq://Player.VirtualTopicConsumers.1] by component:
org.apache.activemq.camel.component.ActiveMQComponent@6179a0ab
[myproject] DEBUG [main]
DefaultInstrumentationAgent.registerMBeanWithServer(293) | Registered MBean
with objectname:
org.apache.camel:context=mick-knutsons-macbook.local/camel-2,type=endpoints,name="activemq://Player.VirtualTopicConsumers.1\?id=0xc44497bc"
[myproject] DEBUG [main]
DefaultInstrumentationAgent.registerMBeanWithServer(293) | Registered MBean
with objectname:
org.apache.camel:context=mick-knutsons-macbook.local/camel-2,type=processors,nodeid=process1,name="process[com.wiredducks.service.test.TableServiceTest$ClientChecker@709e192f
]"
[myproject] DEBUG [main]
DefaultInstrumentationAgent.registerMBeanWithServer(293) | Registered MBean
with objectname:
org.apache.camel:context=mick-knutsons-macbook.local/camel-2,type=processors,nodeid=to2,name="To[mock:player1]"




---
Thank You…

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 5:06 PM, Mick Knutson <mk...@baselogic.com>wrote:

> So I changed my server context.xml with this broker:
>
> <bean id="broker" class="org.apache.activemq.xbean.BrokerFactoryBean">
>         <property name="config"
>             value="classpath:META-INF/broker.xml" />
>         <property name="start" value="true" />
>     </bean>
>
>
> I then added this broker.xml:
>
> <broker xmlns="http://activemq.apache.org/schema/core">
>     <transportConnectors>
>         <transportConnector name="tcp"
>             uri="tcp://localhost:61616" />
>     </transportConnectors>
>
>     <destinationInterceptors>
>         <virtualDestinationInterceptor>
>             <virtualDestinations>
>                 <compositeQueue name="MY.QUEUE">
>                     <forwardTo>
>                         <filteredDestination selector="odd = 'yes'"
>                             queue="FOO" />
>                         <filteredDestination selector="i = 5" topic="BAR"
> />
>                     </forwardTo>
>                 </compositeQueue>
>                 <virtualTopic name=">" prefix="VirtualTopicConsumers.*." />
>             </virtualDestinations>
>         </virtualDestinationInterceptor>
>     </destinationInterceptors>
> </broker>
>
> Then when I start the Client Side Unit Tests:
>
> 6178 [main] DEBUG org.apache.camel.component.direct.DirectConsumer  -
> Starting consumer: Consumer[direct://start]
>  6179 [main] DEBUG org.apache.camel.impl.DefaultCamelContext  - Route 0:
> EventDrivenConsumerRoute[Endpoint[activemq://Player.VirtualTopicConsumers.1]
> ->
> UnitOfWork(Pipeline[Channel[com.wiredducks.service.test.TableServiceTest$ClientChecker@7acdff36],
> Channel[sendTo(Endpoint[mock://player1])]])]
>  6180 [main] DEBUG org.apache.camel.impl.DefaultCamelContext  - Route 1:
> EventDrivenConsumerRoute[Endpoint[direct://start] ->
> UnitOfWork(Channel[sendTo(Endpoint[activemq://VirtualTopicConsumers.1])])]
>  6180 [main] DEBUG org.apache.camel.impl.DefaultCamelContext  - Started
> routes
>  6180 [main] INFO  org.apache.camel.impl.DefaultCamelContext  - Apache
> Camel 2.0-M3 (CamelContext:camel-2) started
>  6180 [main] DEBUG com.wiredducks.service.test.TableServiceTest  - Routing
> Rules are: *[EventDrivenConsumerRoute[Endpoint[activemq://Player.VirtualTopicConsumers.1]
> -> *
> UnitOfWork(Pipeline[Channel[com.wiredducks.service.test.TableServiceTest$ClientChecker@7acdff36],
> Channel[sendTo(Endpoint[mock://player1])]])],
> EventDrivenConsumerRoute[Endpoint[direct://start] -> *
> UnitOfWork(Channel[sendTo(Endpoint[activemq://VirtualTopicConsumers.1])])]]
> *
>  6180 [main] DEBUG com.wiredducks.service.test.TableServiceTest  - Routing
> Rules are:
> [EventDrivenConsumerRoute[Endpoint[activemq://Player.VirtualTopicConsumers.1]
> ->
> UnitOfWork(Pipeline[Channel[com.wiredducks.service.test.TableServiceTest$ClientChecker@7acdff36],
> *Channel[sendTo(Endpoint[mock://player1])]])],
> EventDrivenConsumerRoute[Endpoint[direct://start] ->
> UnitOfWork(Channel[sendTo(Endpoint[activemq://VirtualTopicConsumers.1])])]]
> *
>  6180 [main] INFO  com.wiredducks.service.test.TableServiceTest  - Invoking
> TableService to place a bet of 987 from player 123
>  6181 [main] DEBUG org.apache.camel.impl.DefaultComponentResolver  - Found
> component: jms via type: org.apache.camel.component.jms.JmsComponent via:
> META-INF/services/org/apache/camel/component/jms
>
>
>
> When I send a message from my Server to:
> producer.sendBodyAndHeader("activemq:VirtualTopicConsumers.1", "888",
> "foo", "bar");
>
>
> ---
> Thank You…
>
> 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 1:48 PM, Ashwin Karpe <as...@progress.com>wrote:
>
>>
>> Hi,
>>
>> If you do not use a broker.xml to instantiate a broker then you will need
>> to
>> use brokers API's to add a virtual destination interceptors that
>> instanctiate a virtual destination.
>>
>> An easier way to accomplish this is to instantiate your embedded broker
>> using a broker.xml file (provided you use spring). If you had a broker.xml
>> then the setup would look as follows.
>>
>> <broker xmlns="http://activemq.apache.org/schema/core">
>>    <destinationInterceptors>
>>      <virtualDestinationInterceptor>
>>        <virtualDestinations>
>>          <compositeQueue name="MY.QUEUE">
>>            <forwardTo>
>>              <filteredDestination selector="odd = 'yes'" queue="FOO"/>
>>              <filteredDestination selector="i = 5" topic="BAR"/>
>>            </forwardTo>
>>          </compositeQueue>
>>        </virtualDestinations>
>>      </virtualDestinationInterceptor>
>>    </destinationInterceptors>
>>
>>  </broker>
>>
>> Hope this helps.
>>
>> Cheers,
>>
>> Ashwin...
>>
>>
>> Mick Knutson-3 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…
>> >
>> > 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 <as...@progress.com>
>> > 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 virtual
>> >> queue/topic is like any other queue or topic from a broker perspective
>> >> and
>> >> only gets interpreted when a payload arrive with the destination name
>> 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/java/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 help
>> >> me
>> >> > out
>> >> > please?
>> >> >
>> >> > ---
>> >> > Thank You…
>> >> >
>> >> > 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-Test--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-Test--tp24902737p24907245.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>

Re: anyone have AMQ VirtualTopic's working in Camel Test?

Posted by Mick Knutson <mk...@baselogic.com>.
So I changed my server context.xml with this broker:

<bean id="broker" class="org.apache.activemq.xbean.BrokerFactoryBean">
        <property name="config"
            value="classpath:META-INF/broker.xml" />
        <property name="start" value="true" />
    </bean>


I then added this broker.xml:

<broker xmlns="http://activemq.apache.org/schema/core">
    <transportConnectors>
        <transportConnector name="tcp"
            uri="tcp://localhost:61616" />
    </transportConnectors>

    <destinationInterceptors>
        <virtualDestinationInterceptor>
            <virtualDestinations>
                <compositeQueue name="MY.QUEUE">
                    <forwardTo>
                        <filteredDestination selector="odd = 'yes'"
                            queue="FOO" />
                        <filteredDestination selector="i = 5" topic="BAR" />
                    </forwardTo>
                </compositeQueue>
                <virtualTopic name=">" prefix="VirtualTopicConsumers.*." />
            </virtualDestinations>
        </virtualDestinationInterceptor>
    </destinationInterceptors>
</broker>

Then when I start the Client Side Unit Tests:

6178 [main] DEBUG org.apache.camel.component.direct.DirectConsumer  -
Starting consumer: Consumer[direct://start]
 6179 [main] DEBUG org.apache.camel.impl.DefaultCamelContext  - Route 0:
EventDrivenConsumerRoute[Endpoint[activemq://Player.VirtualTopicConsumers.1]
->
UnitOfWork(Pipeline[Channel[com.wiredducks.service.test.TableServiceTest$ClientChecker@7acdff36],
Channel[sendTo(Endpoint[mock://player1])]])]
 6180 [main] DEBUG org.apache.camel.impl.DefaultCamelContext  - Route 1:
EventDrivenConsumerRoute[Endpoint[direct://start] ->
UnitOfWork(Channel[sendTo(Endpoint[activemq://VirtualTopicConsumers.1])])]
 6180 [main] DEBUG org.apache.camel.impl.DefaultCamelContext  - Started
routes
 6180 [main] INFO  org.apache.camel.impl.DefaultCamelContext  - Apache Camel
2.0-M3 (CamelContext:camel-2) started
 6180 [main] DEBUG com.wiredducks.service.test.TableServiceTest  - Routing
Rules are: *[EventDrivenConsumerRoute[Endpoint[activemq://Player.VirtualTopicConsumers.1]
-> *
UnitOfWork(Pipeline[Channel[com.wiredducks.service.test.TableServiceTest$ClientChecker@7acdff36],
Channel[sendTo(Endpoint[mock://player1])]])],
EventDrivenConsumerRoute[Endpoint[direct://start] -> *
UnitOfWork(Channel[sendTo(Endpoint[activemq://VirtualTopicConsumers.1])])]]*
 6180 [main] DEBUG com.wiredducks.service.test.TableServiceTest  - Routing
Rules are:
[EventDrivenConsumerRoute[Endpoint[activemq://Player.VirtualTopicConsumers.1]
->
UnitOfWork(Pipeline[Channel[com.wiredducks.service.test.TableServiceTest$ClientChecker@7acdff36],
*Channel[sendTo(Endpoint[mock://player1])]])],
EventDrivenConsumerRoute[Endpoint[direct://start] ->
UnitOfWork(Channel[sendTo(Endpoint[activemq://VirtualTopicConsumers.1])])]]*
 6180 [main] INFO  com.wiredducks.service.test.TableServiceTest  - Invoking
TableService to place a bet of 987 from player 123
 6181 [main] DEBUG org.apache.camel.impl.DefaultComponentResolver  - Found
component: jms via type: org.apache.camel.component.jms.JmsComponent via:
META-INF/services/org/apache/camel/component/jms



When I send a message from my Server to:
producer.sendBodyAndHeader("activemq:VirtualTopicConsumers.1", "888", "foo",
"bar");


---
Thank You…

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 1:48 PM, Ashwin Karpe <as...@progress.com> wrote:

>
> Hi,
>
> If you do not use a broker.xml to instantiate a broker then you will need
> to
> use brokers API's to add a virtual destination interceptors that
> instanctiate a virtual destination.
>
> An easier way to accomplish this is to instantiate your embedded broker
> using a broker.xml file (provided you use spring). If you had a broker.xml
> then the setup would look as follows.
>
> <broker xmlns="http://activemq.apache.org/schema/core">
>    <destinationInterceptors>
>      <virtualDestinationInterceptor>
>        <virtualDestinations>
>          <compositeQueue name="MY.QUEUE">
>            <forwardTo>
>              <filteredDestination selector="odd = 'yes'" queue="FOO"/>
>              <filteredDestination selector="i = 5" topic="BAR"/>
>            </forwardTo>
>          </compositeQueue>
>        </virtualDestinations>
>      </virtualDestinationInterceptor>
>    </destinationInterceptors>
>
>  </broker>
>
> Hope this helps.
>
> Cheers,
>
> Ashwin...
>
>
> Mick Knutson-3 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…
> >
> > 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 <as...@progress.com>
> > 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 virtual
> >> queue/topic is like any other queue or topic from a broker perspective
> >> and
> >> only gets interpreted when a payload arrive with the destination name
> 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/java/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 help
> >> me
> >> > out
> >> > please?
> >> >
> >> > ---
> >> > Thank You…
> >> >
> >> > 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-Test--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-Test--tp24902737p24907245.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>

Re: anyone have AMQ VirtualTopic's working in Camel Test?

Posted by Ashwin Karpe <as...@progress.com>.
Hi,

If you do not use a broker.xml to instantiate a broker then you will need to
use brokers API's to add a virtual destination interceptors that
instanctiate a virtual destination.
 
An easier way to accomplish this is to instantiate your embedded broker
using a broker.xml file (provided you use spring). If you had a broker.xml
then the setup would look as follows.

<broker xmlns="http://activemq.apache.org/schema/core"> 
    <destinationInterceptors> 
      <virtualDestinationInterceptor> 
        <virtualDestinations> 
          <compositeQueue name="MY.QUEUE"> 
            <forwardTo> 
              <filteredDestination selector="odd = 'yes'" queue="FOO"/> 
              <filteredDestination selector="i = 5" topic="BAR"/> 
            </forwardTo> 
          </compositeQueue> 
        </virtualDestinations> 
      </virtualDestinationInterceptor> 
    </destinationInterceptors> 
 
  </broker> 

Hope this helps.

Cheers,

Ashwin...


Mick Knutson-3 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…
> 
> 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 <as...@progress.com>
> 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 virtual
>> queue/topic is like any other queue or topic from a broker perspective
>> and
>> only gets interpreted when a payload arrive with the destination name 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/java/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 help
>> me
>> > out
>> > please?
>> >
>> > ---
>> > Thank You…
>> >
>> > 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-Test--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-Test--tp24902737p24907245.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: anyone have AMQ VirtualTopic's working in Camel Test?

Posted by Mick Knutson <mk...@baselogic.com>.
Still working ALL week, and simply do not have a working test yet.
Am I just doing something that nobody else in the world is trying to do with
camel?

---
Thank You…

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 12:23 PM, Mick Knutson <mk...@baselogic.com>wrote:

> I tried what you suggested with this Broker:
>
> <broker xmlns="http://activemq.apache.org/schema/core">
>     <transportConnectors>
>         <transportConnector name="tcp" uri="tcp://localhost:61616" />
>     </transportConnectors>
>
>     <destinationInterceptors>
>         <virtualDestinationInterceptor>
>             <virtualDestinations>
>                 *<compositeTopic name="VirtualTopic.TEST">*
>                     <forwardTo>
>                         *<topic
> physicalName="Consumer.A.VirtualTopic.TEST" />*
>                     </forwardTo>
>                 </compositeTopic>
>             </virtualDestinations>
>         </virtualDestinationInterceptor>
>     </destinationInterceptors>
>
> </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
> the 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 = 5, responseRequired = true, messageId =
> ID:L83601HY-3296-1250007358494-2:4:1:1:1, originalDestination = null,
> originalTran*
> *sactionId = null, producerId = ID:L83601HY-3296-1250007358494-2:4:1:1,
> destination = queue://Consumer.A.VirtualTopic.TEST, transactionId = null,
> expiration*
> * = 0, timestamp = 1250007383823, arrival = 0, brokerInTime =
> 1250007383823, brokerOutTime = 1250007383823, correlationId = null, replyTo
> = null, persistent*
> * = true, type = null, priority = 4, groupID = null, groupSequence = 0,
> targetConsumerId = null, compressed = false, userID = null, content = null,
> marshall*
> *edProperties = org.apache.activemq.util.ByteSequence@16d3536,
> dataStructure = null, redeliveryCounter = 0, size = 0, properties =
> {foo=bar}, readOnlyProper*
> *ties = true, readOnlyBody = true, droppable = false, text =
> 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…
>
> 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 <as...@progress.com>wrote:
>
>>
>> Hi,
>>
>> Looks like you used the little snippet I sent in an as-is mode. I intended
>> this to be an example.
>>
>> In any case, you could use something like this in your broker
>>
>>  <broker xmlns="http://activemq.apache.org/schema/core">
>>    <destinationInterceptors>
>>      <virtualDestinationInterceptor>
>>        <virtualDestinations>
>>           <compositeTopic name="MY.TOPIC">
>>            <forwardTo>
>>              <topic physicalName="BAR" />
>>            </forwardTo>
>>          </compositeTopic>
>>        </virtualDestinations>
>>      </virtualDestinationInterceptor>
>>    </destinationInterceptors>
>>
>>  </broker>
>>
>> Notice in this example that the real queue is a queue named FOO and a real
>> topic is a topic named BAR.
>>
>> Your consumers should listen on the topic named BAR and your clients
>> should
>> 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
>> topic
>> 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=mick-knutsons-macbook.local/camel-2,type=processors,nodeid=to1,name="
>> > *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) | Creating
>> > endpoint uri=[activemq://VirtualTopic.TEST]*, path=[VirtualTopic.TEST],
>> > parameters=[{}]
>> > *[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=mick-knutsons-macbook.local/camel-2,type=endpoints,name="activemq://VirtualTopic.TEST\?id=0x5cab2ebd"
>> > [myproject] DEBUG [main] DefaultComponent.createEndpoint(77) | Creating
>> > endpoint uri=[activemq://Consumer.A.VirtualTopic.TEST],
>> > path=[Consumer.A.VirtualTopic.TEST], parameters=[{}]
>> > *[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=mick-knutsons-macbook.local/camel-2,type=endpoints,name="activemq://Consumer.A.VirtualTopic.TEST\?id=0x561756a4"
>> >
>> >
>> >
>> > 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…
>> >
>> > 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
>> > <wi...@gmail.com>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
>> and
>> >> 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…
>> >>>
>> >>> 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 <as...@progress.com>
>> >>> 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
>> virtual
>> >>>> queue/topic is like any other queue or topic from a broker
>> perspective
>> >>>> and
>> >>>> only gets interpreted when a payload arrive with the destination name
>> >>>> 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/java/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
>> help
>> >>>>> me
>> >>>>> out
>> >>>>> please?
>> >>>>>
>> >>>>> ---
>> >>>>> Thank You…
>> >>>>>
>> >>>>> 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-Test--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-Test--tp24902737p24918802.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>

Re: anyone have AMQ VirtualTopic's working in Camel Test?

Posted by Mick Knutson <mk...@baselogic.com>.
I tried what you suggested with this Broker:

<broker xmlns="http://activemq.apache.org/schema/core">
    <transportConnectors>
        <transportConnector name="tcp" uri="tcp://localhost:61616" />
    </transportConnectors>

    <destinationInterceptors>
        <virtualDestinationInterceptor>
            <virtualDestinations>
                *<compositeTopic name="VirtualTopic.TEST">*
                    <forwardTo>
                        *<topic physicalName="Consumer.A.VirtualTopic.TEST"
/>*
                    </forwardTo>
                </compositeTopic>
            </virtualDestinations>
        </virtualDestinationInterceptor>
    </destinationInterceptors>

</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 the
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 = 5, responseRequired = true, messageId =
ID:L83601HY-3296-1250007358494-2:4:1:1:1, originalDestination = null,
originalTran*
*sactionId = null, producerId = ID:L83601HY-3296-1250007358494-2:4:1:1,
destination = queue://Consumer.A.VirtualTopic.TEST, transactionId = null,
expiration*
* = 0, timestamp = 1250007383823, arrival = 0, brokerInTime = 1250007383823,
brokerOutTime = 1250007383823, correlationId = null, replyTo = null,
persistent*
* = true, type = null, priority = 4, groupID = null, groupSequence = 0,
targetConsumerId = null, compressed = false, userID = null, content = null,
marshall*
*edProperties = org.apache.activemq.util.ByteSequence@16d3536, dataStructure
= null, redeliveryCounter = 0, size = 0, properties = {foo=bar},
readOnlyProper*
*ties = true, readOnlyBody = true, droppable = false, text =
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…

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 <as...@progress.com> wrote:

>
> Hi,
>
> Looks like you used the little snippet I sent in an as-is mode. I intended
> this to be an example.
>
> In any case, you could use something like this in your broker
>
>  <broker xmlns="http://activemq.apache.org/schema/core">
>    <destinationInterceptors>
>      <virtualDestinationInterceptor>
>        <virtualDestinations>
>           <compositeTopic name="MY.TOPIC">
>            <forwardTo>
>              <topic physicalName="BAR" />
>            </forwardTo>
>          </compositeTopic>
>        </virtualDestinations>
>      </virtualDestinationInterceptor>
>    </destinationInterceptors>
>
>  </broker>
>
> Notice in this example that the real queue is a queue named FOO and a real
> topic is a topic named BAR.
>
> Your consumers should listen on the topic named BAR and your clients should
> 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 topic
> 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=mick-knutsons-macbook.local/camel-2,type=processors,nodeid=to1,name="
> > *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) | Creating
> > endpoint uri=[activemq://VirtualTopic.TEST]*, path=[VirtualTopic.TEST],
> > parameters=[{}]
> > *[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=mick-knutsons-macbook.local/camel-2,type=endpoints,name="activemq://VirtualTopic.TEST\?id=0x5cab2ebd"
> > [myproject] DEBUG [main] DefaultComponent.createEndpoint(77) | Creating
> > endpoint uri=[activemq://Consumer.A.VirtualTopic.TEST],
> > path=[Consumer.A.VirtualTopic.TEST], parameters=[{}]
> > *[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=mick-knutsons-macbook.local/camel-2,type=endpoints,name="activemq://Consumer.A.VirtualTopic.TEST\?id=0x561756a4"
> >
> >
> >
> > 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…
> >
> > 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
> > <wi...@gmail.com>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 and
> >> 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…
> >>>
> >>> 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 <as...@progress.com>
> >>> 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 virtual
> >>>> queue/topic is like any other queue or topic from a broker perspective
> >>>> and
> >>>> only gets interpreted when a payload arrive with the destination name
> >>>> 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/java/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 help
> >>>>> me
> >>>>> out
> >>>>> please?
> >>>>>
> >>>>> ---
> >>>>> Thank You…
> >>>>>
> >>>>> 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-Test--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-Test--tp24902737p24918802.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>

Re: anyone have AMQ VirtualTopic's working in Camel Test?

Posted by Ashwin Karpe <as...@progress.com>.
Hi,

Looks like you used the little snippet I sent in an as-is mode. I intended
this to be an example.

In any case, you could use something like this in your broker

  <broker xmlns="http://activemq.apache.org/schema/core">
    <destinationInterceptors>
      <virtualDestinationInterceptor>
        <virtualDestinations>
          <compositeTopic name="MY.TOPIC">
            <forwardTo>
              <topic physicalName="BAR" />
            </forwardTo>
          </compositeTopic>
        </virtualDestinations>
      </virtualDestinationInterceptor>
    </destinationInterceptors>

  </broker>  

Notice in this example that the real queue is a queue named FOO and a real
topic is a topic named BAR.

Your consumers should listen on the topic named BAR and your clients should
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 topic
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=mick-knutsons-macbook.local/camel-2,type=processors,nodeid=to1,name="
> *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) | Creating
> endpoint uri=[activemq://VirtualTopic.TEST]*, path=[VirtualTopic.TEST],
> parameters=[{}]
> *[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=mick-knutsons-macbook.local/camel-2,type=endpoints,name="activemq://VirtualTopic.TEST\?id=0x5cab2ebd"
> [myproject] DEBUG [main] DefaultComponent.createEndpoint(77) | Creating
> endpoint uri=[activemq://Consumer.A.VirtualTopic.TEST],
> path=[Consumer.A.VirtualTopic.TEST], parameters=[{}]
> *[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=mick-knutsons-macbook.local/camel-2,type=endpoints,name="activemq://Consumer.A.VirtualTopic.TEST\?id=0x561756a4"
> 
> 
> 
> 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…
> 
> 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
> <wi...@gmail.com>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 and
>> 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…
>>>
>>> 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 <as...@progress.com>
>>> 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 virtual
>>>> queue/topic is like any other queue or topic from a broker perspective
>>>> and
>>>> only gets interpreted when a payload arrive with the destination name
>>>> 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/java/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 help
>>>>> me
>>>>> out
>>>>> please?
>>>>>
>>>>> ---
>>>>> Thank You…
>>>>>
>>>>> 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-Test--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-Test--tp24902737p24918802.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: anyone have AMQ VirtualTopic's working in Camel Test?

Posted by Mick Knutson <mk...@baselogic.com>.
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=mick-knutsons-macbook.local/camel-2,type=processors,nodeid=to1,name="
*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) | Creating
endpoint uri=[activemq://VirtualTopic.TEST]*, path=[VirtualTopic.TEST],
parameters=[{}]
*[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=mick-knutsons-macbook.local/camel-2,type=endpoints,name="activemq://VirtualTopic.TEST\?id=0x5cab2ebd"
[myproject] DEBUG [main] DefaultComponent.createEndpoint(77) | Creating
endpoint uri=[activemq://Consumer.A.VirtualTopic.TEST],
path=[Consumer.A.VirtualTopic.TEST], parameters=[{}]
*[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=mick-knutsons-macbook.local/camel-2,type=endpoints,name="activemq://Consumer.A.VirtualTopic.TEST\?id=0x561756a4"



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…

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 <wi...@gmail.com>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 and
> 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…
>>
>> 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 <as...@progress.com>
>> 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 virtual
>>> queue/topic is like any other queue or topic from a broker perspective
>>> and
>>> only gets interpreted when a payload arrive with the destination name 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/java/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 help me
>>>> out
>>>> please?
>>>>
>>>> ---
>>>> Thank You…
>>>>
>>>> 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-Test--tp24902737p24904788.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>>
>>
>

Re: anyone have AMQ VirtualTopic's working in Camel Test?

Posted by Willem Jiang <wi...@gmail.com>.
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 and 
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…
> 
> 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 <as...@progress.com> 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 virtual
>> queue/topic is like any other queue or topic from a broker perspective and
>> only gets interpreted when a payload arrive with the destination name 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/java/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 help me
>>> out
>>> please?
>>>
>>> ---
>>> Thank You…
>>>
>>> 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-Test--tp24902737p24904788.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 


Re: anyone have AMQ VirtualTopic's working in Camel Test?

Posted by Mick Knutson <mk...@baselogic.com>.
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…

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 <as...@progress.com> 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 virtual
> queue/topic is like any other queue or topic from a broker perspective and
> only gets interpreted when a payload arrive with the destination name 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/java/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 help me
> > out
> > please?
> >
> > ---
> > Thank You…
> >
> > 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-Test--tp24902737p24904788.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>

Re: anyone have AMQ VirtualTopic's working in Camel Test?

Posted by Ashwin Karpe <as...@progress.com>.
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 virtual
queue/topic is like any other queue or topic from a broker perspective and
only gets interpreted when a payload arrive with the destination name 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/java/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 help me
> out
> please?
> 
> ---
> Thank You…
> 
> 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-Test--tp24902737p24904788.html
Sent from the Camel - Users mailing list archive at Nabble.com.