You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Amit <am...@gmail.com> on 2014/11/25 23:36:32 UTC

Servlet component matchOnUriPrefix is not working as documented

We are using Servlet component and we route two routes as below. When i send
request to (route2) myservice/v1/ it process by route1.

As per Servlet component document  "CamelServlet should try to find a target
consumer by matching the URI prefix, if no exact match is found."
is not valid. 




route1
========
<route xmlns="http://camel.apache.org/schema/spring" trace="true">
  <from uri="servlet:///?matchOnUriPrefix=true" />
  <to uri="bean:helloWorld?method=speak"/>  
</route>

route2
=========
<route xmlns="http://camel.apache.org/schema/spring" trace="true">
  <from uri="servlet:///myservice/v1/>
  <to uri="bean:helloWorld?method=speak"/>  
</route>





--
View this message in context: http://camel.465427.n5.nabble.com/Servlet-component-matchOnUriPrefix-is-not-working-as-documented-tp5759604.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Servlet component matchOnUriPrefix is not working as documented

Posted by Claus Ibsen <cl...@gmail.com>.
Try flipping the order the routes are defined, not the startup order attribute

On Mon, Dec 1, 2014 at 6:18 PM, Amit <am...@gmail.com> wrote:
> I still need to check with 2.14.0 version, but we did try to change the route
> order by specifying startupOrder="1" for exact match and  startupOrder="2"
> to   matchOnUriPrefix route but it does not work in
> Apache Camel 2.11.4?
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Servlet-component-matchOnUriPrefix-is-not-working-as-documented-tp5759604p5759880.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
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Re: Servlet component matchOnUriPrefix is not working as documented

Posted by Amit <am...@gmail.com>.
I still need to check with 2.14.0 version, but we did try to change the route
order by specifying startupOrder="1" for exact match and  startupOrder="2"
to   matchOnUriPrefix route but it does not work in
Apache Camel 2.11.4? 

 



--
View this message in context: http://camel.465427.n5.nabble.com/Servlet-component-matchOnUriPrefix-is-not-working-as-documented-tp5759604p5759880.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Servlet component matchOnUriPrefix is not working as documented

Posted by Willem Jiang <wi...@gmail.com>.
Can you try your test case with the latest released Camel 2.14.0 to see if the issue is still there?

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 27, 2014 at 2:00:22 AM, Amit (amitpatel2000@gmail.com) wrote:
> We are using Apache Camel 2.11.4.
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Servlet-component-matchOnUriPrefix-is-not-working-as-documented-tp5759604p5759665.html  
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  


Re: Servlet component matchOnUriPrefix is not working as documented

Posted by Amit <am...@gmail.com>.
We are using Apache Camel 2.11.4. 



--
View this message in context: http://camel.465427.n5.nabble.com/Servlet-component-matchOnUriPrefix-is-not-working-as-documented-tp5759604p5759665.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Servlet component matchOnUriPrefix is not working as documented

Posted by Claus Ibsen <cl...@gmail.com>.
What version of Camel do you use?

And as a workaround then try flip the order of the 2 routes.

On Tue, Nov 25, 2014 at 11:36 PM, Amit <am...@gmail.com> wrote:
> We are using Servlet component and we route two routes as below. When i send
> request to (route2) myservice/v1/ it process by route1.
>
> As per Servlet component document  "CamelServlet should try to find a target
> consumer by matching the URI prefix, if no exact match is found."
> is not valid.
>
>
>
>
> route1
> ========
> <route xmlns="http://camel.apache.org/schema/spring" trace="true">
>   <from uri="servlet:///?matchOnUriPrefix=true" />
>   <to uri="bean:helloWorld?method=speak"/>
> </route>
>
> route2
> =========
> <route xmlns="http://camel.apache.org/schema/spring" trace="true">
>   <from uri="servlet:///myservice/v1/>
>   <to uri="bean:helloWorld?method=speak"/>
> </route>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Servlet-component-matchOnUriPrefix-is-not-working-as-documented-tp5759604.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
hawtio: http://hawt.io/
fabric8: http://fabric8.io/