Hi there,

Assume following XML DSL:

    <route id="dispatch">
      <from uri="direct:dispatch"/>
      <interceptSendToEndpoint uri="http:*"
afterUri="direct:after_dispatch">
                <when>
                        <simple>${headers.messageType} != null &amp;&amp;
${headers.serviceType} != null</simple>
                </when>
        <to uri="direct:req_out"/>
      </interceptSendToEndpoint>
      <choice id="dispatch-choice">
        <when>
          <simple>${headers.messageType} == 'Property'</simple>
          <toD
uri="{{ext.url}}/Property${headers.serviceType}?bridgeEndpoint=true"/>
        </when>
.
.
.

I found several issues listed below ordered by bug likelihood:

1. When I change uri="http:*" to uri="{{ext.url}}/*" it doesn't match as
I expect. I debugged and saw that Camel tries to match
"http://localhost:8080?bridgeEndpoint=true"; with "{{ext.url}}/*" i.e.
"http://localhost:8080/camel/external_mock/*"; (because ext.url is set to
http://localhost:8080/camel/external_mock) and it doesn't match, Camel
is right but why it's removed "/Property${headers.serviceType}" from the
interceptedUri?! because it has dynamics? it doesn't match because it's
removed this portion. I expect Camel to match
"http://localhost:8080/camel/external_mock/PropertyFoo?bridgeEndpoint=true";,
not "http://localhost:8080?bridgeEndpoint=true";.

2. As you see I've defined it at route level but I see all of my other
"http:*" endpoints will be intercepted! Is this expected?!

3. As per Camel docs, when `when` condition evaluates to false then the
interception shouldn't being triggered, but I see yes, it doesn't go to
the "direct:req_out" but always go to the afterUri i.e.
"direct:after_dispatch" regardless of `when`! Is this expected?

Thanks in advance!

Regards.

Reply via email to