更新时间:2021-11-14 22:09:46
您可以在处理器中设置 Authorization 标头,然后使用 .to()
You can set the Authorization header in your processor and then send the REST request with .to()
public void process(Exchange exchange) throws Exception {
String token = //your logic to get the token
exchange.getIn().setHeader("Authorization", "Bearer " + token)
}
.to("your/rest/endpoint")
Camel 自动将消息头复制到外发消息上.
Camel automatically copies over the message headers onto the outgoing message.