错误在Camel中将端点注入Bean中

时间:2015-06-10 16:03:14

标签: apache-camel

我有一个使用annotation定义的bean。我尝试使用CamelBeanPostProcessor,但camelContext为null。

<select name="subject" id="id_subject">
    <option value="How can I help?">How can I help?</option>
    <option value="Lets work together!">Lets work together!</option>
    <option value="I have a question!">I have a question!</option>
    <option value="I love your work!">I love your work!</option>
</select>

1 个答案:

答案 0 :(得分:1)

实现这一目标有很多方法。由于您的bean是处理器,您可以简单地实现Processor,然后可以访问整个交换,当然还有camelcontext:

public class HelloWorld implements Processor {
  public void process(Exchange exchange) throws Exception {
    context = exchange.getContext()
  }
}