[ 
https://issues.apache.org/jira/browse/CAMEL-13333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16796060#comment-16796060
 ] 

Robert Half edited comment on CAMEL-13333 at 3/19/19 1:05 PM:
--------------------------------------------------------------

I have already published /api/ui and /api/api1 (there are more). First is 
handled by a servlet (/api/ui/*) using Spring. Second is handled by Camel 
Servlet /api/api1/*.

If I must use same servlet for api2 with Camel and different contextPath, as 
you suggested,  I need to change the servlet mapping to /api/* in order to keep 
the paths for published services. Otherwise all the consumers (other projects) 
need to adjust. But /api/* conflicts with /api/ui/ and other servlets. My 
workaround for this is to set an order on the servlets, but I don't really like 
this, because it's more error prone. On the test environment the order might 
turn out correct occasionally and fail in the production.


was (Author: antidote2):
I have already published /api/ui and /api/api1 (there are more). First is 
handled by a servlet (/api/ui/*) using Spring. Second is handled by Camel 
Servlet /api/api1/*.

If I must use same servlet for api2 with Camel and different contextPath, as 
you suggested,  I need to change the servlet mapping to /api/* in order to keep 
the paths for published services. Otherwise all the consumers (other projects) 
need to adjust. But /api/* conflicts with /api/ui/ and other servlets. My 
workaround for this is to set an order on the servlets, but I don't really like 
this, because it's more error prone. On the test environment the order might 
turn out correct occasionally and fail in the production.

> Multiple servlets not supported
> -------------------------------
>
>                 Key: CAMEL-13333
>                 URL: https://issues.apache.org/jira/browse/CAMEL-13333
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core, camel-servlet
>    Affects Versions: 2.21.5
>         Environment: Apache Camel 2.21.5
>            Reporter: Robert Half
>            Priority: Major
>
> I think it's described pretty well in this stackoverflow question: 
> [https://stackoverflow.com/questions/55127006/multiple-servlets-with-camel-servlet-possible/55197778#55197778|http://example.com/]
>  
> To sum up: you can work with only one ServletComponent in Camel and you can 
> point it to only one servlet (at least with rest dsl). This means if you want 
> to have /api/ui/health and /api/business/health with servlets "ui" mapped to 
> /api/ui/* and "business" mapped to /api/business/* with camel rest dsl you 
> cannot.
> When working with Camel on an Java EE app server, which only supports Java EE 
> 6 like WebSphere 8.5, I cannot move to Spring 5 (EE 7) and thus 2.21 is the 
> last Camel version, I can work with. I would appreciate a hotfix for this 
> reason.
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to