Espen Tjonneland created CAMEL-7820:
---------------------------------------
Summary: Interceptors not regestering for Rest DSL
Key: CAMEL-7820
URL: https://issues.apache.org/jira/browse/CAMEL-7820
Project: Camel
Issue Type: Bug
Components: camel-core
Affects Versions: 2.14.0
Reporter: Espen Tjonneland
My project only has one Rest DSL route.
If I add interceptFrom().stop() in the beginning of a my RouteDefinition file,
no stop of that route occurs. In addition, if I add the interceptFrom().stop()
after my rest dsl route is defined, no exception is thrown (as it should be).
However, if I add another regular DSL, like:
from("timer://foo?fixedRate=true&period=10s").log("Hello world")
The interceptor is fired (and Exception is thrown if I move the interceptor
below the route).
Here is a snippet of the code (I have removed some details inside it, like just
piping the rest call over to log hello, and removed the details for the servlet
config part).
{code}
@Component
@DependsOn("camelConfig")
public class IncomingRestCalls extends RouteBuilder {
interceptFrom().id("Logging interceptor").bean(NISAccessLog.class);
restConfiguration()<more code here>......;
rest(NISConfig.API_VERSION_1 + "/holdings").description("Holdings
service " + NISConfig.API_VERSION_1)
.consumes("application/json").produces("application/json")
.get("/{ID}").description("List the customers holdings for the
given ID.").outTypeList(
InsuranceDTO.class).to("log:hello");
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)