You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by apara <ap...@standardset.com> on 2013/08/31 13:03:57 UTC

Can I use from ="direct:abc*" for wildcard routing...

I am building a routing to URI based on the name of class's package:

        <camel:route>
            <camel:from uri="direct://start/event" />

            <camel:recipientList>
                <camel:simple resultType="java.lang.String">
                    direct://start/event/${in.body.class.package.name}
                </camel:simple>
            </camel:recipientList>
        </camel:route>

Later, I want to create a wildcard route that looks something like this:

        <camel:route>
            <camel:from uri="direct://start/event/com.mycompany.mypackage.*"
/>

In other words I want to route everything that's inside
com.mycompany.mypackage. to a specific route.

Is this possible?  Can I use wildcards with direct: or is there a better
option?

Thanks.
-AP_





--
View this message in context: http://camel.465427.n5.nabble.com/Can-I-use-from-direct-abc-for-wildcard-routing-tp5738379.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Can I use from ="direct:abc*" for wildcard routing...

Posted by James Carman <ja...@carmanconsulting.com>.
Why not just route it to direct://start/event and then the receiving
route can figure out what to do with it?  You're not doing any
conditional routing here anyway.

Re: Can I use from ="direct:abc*" for wildcard routing...

Posted by Raul Kripalani <ra...@evosent.com>.
The best option is to use JMS Publish / Subscribe, with the camel-jms or
activemq-camel components. This way you get the full QoS guarantees that a
messaging broker is able to provide. If you use Apache ServiceMix, the
ActiveMQ broker is already embedded so you can enjoy an out-of-the-box
experience.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Sat, Aug 31, 2013 at 12:03 PM, apara <ap...@standardset.com> wrote:

> I am building a routing to URI based on the name of class's package:
>
>         <camel:route>
>             <camel:from uri="direct://start/event" />
>
>             <camel:recipientList>
>                 <camel:simple resultType="java.lang.String">
>                     direct://start/event/${in.body.class.package.name}
>                 </camel:simple>
>             </camel:recipientList>
>         </camel:route>
>
> Later, I want to create a wildcard route that looks something like this:
>
>         <camel:route>
>             <camel:from
> uri="direct://start/event/com.mycompany.mypackage.*"
> />
>
> In other words I want to route everything that's inside
> com.mycompany.mypackage. to a specific route.
>
> Is this possible?  Can I use wildcards with direct: or is there a better
> option?
>
> Thanks.
> -AP_
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Can-I-use-from-direct-abc-for-wildcard-routing-tp5738379.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Can I use from ="direct:abc*" for wildcard routing...

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

No there is no wildcard support in the direct component. The intention
is that there is only one consumer per endpoint. If you have wildcard
supports then you may end up with multiple consumers matching a
wilcard pattern. The direct is intended for one consumer only per
endpoint.


On Sat, Aug 31, 2013 at 1:03 PM, apara <ap...@standardset.com> wrote:
> I am building a routing to URI based on the name of class's package:
>
>         <camel:route>
>             <camel:from uri="direct://start/event" />
>
>             <camel:recipientList>
>                 <camel:simple resultType="java.lang.String">
>                     direct://start/event/${in.body.class.package.name}
>                 </camel:simple>
>             </camel:recipientList>
>         </camel:route>
>
> Later, I want to create a wildcard route that looks something like this:
>
>         <camel:route>
>             <camel:from uri="direct://start/event/com.mycompany.mypackage.*"
> />
>
> In other words I want to route everything that's inside
> com.mycompany.mypackage. to a specific route.
>
> Is this possible?  Can I use wildcards with direct: or is there a better
> option?
>
> Thanks.
> -AP_
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Can-I-use-from-direct-abc-for-wildcard-routing-tp5738379.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen