219.10.2. Headers

Message 标头可用于覆盖 Metrics 组件 URI 中指定的操作值。

名称描述预期类型

CamelMetricsTimerAction

覆盖 URI 中的计时器操作

org.apache.camel.component.metrics.timer.TimerEndpoint.TimerAction

// sets timer action using header
from("direct:in")
    .setHeader(MetricsConstants.HEADER_TIMER_ACTION, TimerAction.start)
    .to("metrics:timer:simple.timer")
    .to("direct:out");