【问题标题】:Cannot Resolve .process in Apache Camel Route无法解决 Apache Camel Route 中的 .process
【发布时间】:2018-04-09 15:03:51
【问题描述】:

我正在尝试使用 Apache Camel 公开一个 REST 端点。我正在尝试引入使用处理器来处理传入消息的管理,但是当我尝试使用 .process() 时,IntelliJ 抱怨该方法无法解决。

我的代码如下所示:

public void configure() throws Exception {

    restConfiguration()
          .host(host).port(port);

    rest("/exampleCallback").description("ExampleCallBackUri")
          .get()
          .bindingMode(RestBindingMode.off)
          .param().name(abc).type(RestParamType.query).required(true).endParam()
          .param().name(xyz).type(RestParamType.query).required(true).endParam() 
          .produces(MediaType.TEXT_PLAIN_VALUE)
          .process(messageProcessor).id("MessageProcessor")
          .to(exampleEndpoint);
}

【问题讨论】:

    标签: java apache apache-camel


    【解决方案1】:

    你需要这样做,

    rest("/exampleCallback").description("ExampleCallBackUri")
              .get()
              .bindingMode(RestBindingMode.off)
              .param().name(abc).type(RestParamType.query).required(true).endParam()
              .param().name(xyz).type(RestParamType.query).required(true).endParam() 
              .produces(MediaType.TEXT_PLAIN_VALUE)
              .toD("someIntermediateEndpoint");
    
    from("someIntermediateEndpoint")
              .process(messageProcessor).id("MessageProcessor")
              .to(exampleEndpoint);
    

    因为RestDefinition 没有process 方法。

    【讨论】:

    • 感谢您的快速回复:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-26
    • 1970-01-01
    相关资源
    最近更新 更多