You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Claus Ibsen <cl...@gmail.com> on 2018/02/01 16:57:34 UTC

Re: Camel Rest services with no Base path for the CamelServlet

Try with newer release of Apache Camel.

Also it sound a bit like chicken-and-egg situation that you want to
use /* pattern matching for a servlet, which would then grab 100% of
all the urls.
I cannot see if there is any easy way to let "spring boot" do its url
matching first, and then the end users servlet afterwards.

But it sound like a generic spring boot problem, so you can try to
research a bit on that.

Also maybe spring boot actuators etc can be set to use a management
port so they dont use the same port number as end user servlets.
If you do not do that, then maybe try doing this.


On Thu, Jan 18, 2018 at 3:43 AM, Darius Cooper <da...@gmail.com> wrote:
> Using Camel 2.19.3 REST DSL with Spring Boot
> Currently, we have a REST service on an endpoint like this:
>
>     /mycontext/rest/myService
>
> Our web.xml contains:
>
>     <servlet>
>         <servlet-name>CamelServlet</servlet-name>
>
> <servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class>
>     </servlet>
>
>     <servlet-mapping>
>         <servlet-name>CamelServlet</servlet-name>
>         <url-pattern>/rest/*</url-pattern>
>     </servlet-mapping>
>
> In our route, we have:
>
>     rest('/myService')
>             .get()   //etc.
>
> That works fine. However, **we would like** to change the endpoint so that
> there is **no common base for the Camel servlet**.
> We would like to support:
>
> /mycontext/myService
>
> How can we set up the Camel Servlet for this? If we use a pattern like
>
>     <url-pattern>/*</url-pattern>
>
> Camel will try to service all the end-points in that context, including the
> Spring Boot actuator ones, like "/ping"



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2