使用路由时如何提取 header 属性

How to extract header properties when using routes

我是 Apache camel、路由和 AMQP 的新手,我正在像这样向代理发送消息:

当我在 Active MQ 中显示我的请求时,我发现我在请求消息的 header 中设置的属性:

我想知道如何从消息中提取 header 以便将其转发给我的 talend 作业。 我使用 ($in.body) 提取消息的 body,但 ($in.header) 不起作用。

请帮助

如果它使用的是 Camel 的简单表达式语言,那么请尝试使用 ${in.headers},或者如果您想访问特定的 header,那么您可以使用 ${in.header.something}.

您可以找到更多示例 here

更新

工作解决方案(来自评论):${header.taskID}