219.7.2. headers

메시지 헤더를 사용하여 지표 구성 요소 URI에 지정된 증가감소 값을 덮어쓸 수 있습니다.

이름설명예상 유형

CamelMetricsCounterIncrement 

재정의 증가 URI의 값

long

CamelMetricsCounterDecrement 

URI의 감소 값 재정의

long

// update counter simple.counter by 417
from("direct:in")
    .setHeader(MetricsConstants.HEADER_COUNTER_INCREMENT, constant(417L))
    .to("metrics:counter:simple.counter?increment=7")
    .to("direct:out");
// updates counter using simple language to evaluate body.length
from("direct:in")
    .setHeader(MetricsConstants.HEADER_COUNTER_INCREMENT, simple("${body.length}"))
    .to("metrics:counter:body.length")
    .to("mock:out");