【问题标题】:Is it possible to create a synchronnous response with CXF server and Camel which processes the request?是否可以与处理请求的 CXF 服务器和 Camel 创建同步响应?
【发布时间】:2011-11-13 15:39:54
【问题描述】:

我想拥有一个使用 Apache CXF 的 REST Web 服务,并将传入请求发送到 camel:route 进行处理。是否可以从路由同步创建响应(如果在处理过程中发生错误)?

【问题讨论】:

    标签: rest cxf apache-camel


    【解决方案1】:

    是的。事实上,这是默认设置。您可以使用 camel-cxf 触发路由,也可以使用直接端点向路由发送内容。

    使用直接端点,您可以执行以下操作:

    生产者 = camelContext.createProducerTemplate();

    试试{

    result = producer.requestBody("direct:test", myContent);

    } 捕捉(异常 e){ ... }

    相应的路线必须从以下开始:

    from("direct:test")...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-06-15
      • 1970-01-01
      • 1970-01-01
      • 2019-09-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多