简体   繁体   English

如何在CXF拦截器中进行骆驼交换

[英]How to get camel exchange in cxf interceptor

I want to get the exchange body in cxf interceptor and make it as a camel exchange property. 我想在cxf拦截器中获取交换主体,并将其作为骆驼交换属性。 So that I can use this property in any processor or bean methods. 这样我就可以在任何处理器或bean方法中使用此属性。 I tried to get exchange with message.getExchange() but it will return a cxf exchange. 我试图与message.getExchange()进行交换,但它将返回cxf交换。 How can I use the org.apache.cxf.message.Message to get the org.apache.camel.Exchange . 如何使用org.apache.cxf.message.Message获得org.apache.camel.Exchange

Perhaps you cannot do it exact that way because CXF interceptors are beyond Camel and have no idea about Camel. 也许您不能那样做,因为CXF拦截器不在Camel范围内,并且对Camel不了解。 Camel Exchange is above CXF. 骆驼交易所高于CXF。 But if you need to do exact what you said: 但是,如果您需要按照您所说的做:

get the exchange body ... and make it as a camel exchange property 得到交换机构...并使其成为骆驼交换财产

What does prevent you from doing that in the processor at very first step in Camel route? 是什么阻止您在骆驼路线的第一步中在处理器中执行此操作? Why do you try to do that in CXF Interceptor? 您为什么尝试在CXF拦截器中做到这一点?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM