Grokbase Groups Camel users June 2015
FAQ
The breadcrumbId you see is not the one from your service but the one for
the Exchange created in your test.

On Tue, Jun 16, 2015 at 3:23 PM, Alex Soto wrote:

Hi Willem,

Thanks for the help; however I fail to understand why is the breadcrumbId
header present in the exchange during integration test and not when
manually testing with curl.

If not the HTTP component, then it must be ProducerTemplate who is adding
back this header during integration test execution, so the question is:

How should I write the integration test code in order to verify the header
is not present?
Is there some flag or setting I can set to prevent the ProducerTemplate
from adding a bread crumb header?


Best regards,
Alex soto

On Jun 15, 2015, at 10:02 PM, Willem Jiang wrote:

Current camel-http component just copy the in message header to the out
message header, so it can explain that why you get the
Exchange.BREADCRUMB_ID from the out message.
--
Willem Jiang

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



On June 15, 2015 at 8:52:31 PM, Alex Soto (alex.soto@envieta.com
) wrote:
Hello:

I guess it must be the way I am writing my integration test.

When manually testing the service with curl, the header is not preset,
as expected.
When I try to verify it in an integration test, the header is present:


ProducerTemplate testProducer = camelContext.createProducerTemplate();
testProducer.start();

Exchange response =
testProducer.request(
"https://localhost:8890/test?throwExceptionOnFailure=false",
new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
exchange.getIn().setHeader(Exchange.HTTP_METHOD, "POST");
}
}
);

assertNotNull(response);
assertTrue(response.hasOut());

final Message out = response.getOut();
assertNotNull(out);

assertEquals("", out.getBody(String.class));

int code = out.getHeader(Exchange.HTTP_RESPONSE_CODE, Integer.class);
assertEquals(500, code);

final Map headers = out.getHeaders();
assertNotNull(headers);

assertFalse(headers.containsKey(Exchange.BREADCRUMB_ID));



Last assertion is not passing!!!

Best regards,
Alex soto


On Jun 14, 2015, at 11:44 AM, Claus Ibsen wrote:

Hi

You should be able to remove the header. Can you try adding a step
after the removeHeader, eg




And see if that works.

On Wed, Jun 10, 2015 at 5:16 PM, Alex Soto wrote:
Hi there,

Is there a way to remove the “breadcrumbId" header from the Rest
Service response?
I am using Camel 2.15.1
Here is my Route :


java.lang.Exception


true


500














asyncDelayed="false"
callerRunsWhenRejected="false"
rejectExecution="true"
timePeriodMillis="1000">
10000








Adding the removeHeaders does not seem to cause any effect; I am
still getting the breadcrumbId
header in the HTTP response headers.

Best regards,
Alex soto



--
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/

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 6 of 6 | next ›
Discussion Overview
groupusers @
categoriescamel
postedJun 10, '15 at 3:16p
activeJun 16, '15 at 1:48p
posts6
users4
websitecamel.apache.org

People

Translate

site design / logo © 2021 Grokbase