Apache Camel Route未设置主体

问题描述 投票:0回答:1

我在Docker网络中有两个Apache Camel路由器。

一个充当客户端,并通过路由将主体中的一些数据发送到外部。

我现在想从服务器路由器获取修改后的主体。

但是显然,从不进行身体修改。

(对于上下文,初始请求是一个后请求,其中最终正文应为响应)

这是我的“客户”路线的样子:

<camelContext xmlns="http://camel.apache.org/schema/blueprint">

<restConfiguration component="restlet" bindingMode="json" port="8989" enableCORS="true"/>

<rest path="/finData">
  <description>User rest service</description>
  <post>
    <to uri="direct:update"/>
  </post>
</rest>

<route id="sendFinData">
  <from uri="direct:update"/>
  <log message="Got some data:  ${body}"/>
  <to uri="aclient://otherClient:9191"/>
</route>

这是“服务器”的外观:

 <camelContext xmlns="http://camel.apache.org/schema/blueprint">


 <route id="receiveFinData">
  <from
    uri="aserver://0.0.0.0:9191"/>
  <log message="Received via data: ${body}"/>
  <setBody>
    <simple>{"result": true }</simple>
  </setBody>
</route>

更新:如果我将第二条路由添加到“客户端”,然后将此路由命名为“服务器”的外部,并修改它正在运行的主体,则该链接>>

我在Docker网络中有两个Apache Camel路由器。一个充当客户端,并通过路由将主体中的某些数据发送到外部。我现在想从服务器路由器获取修改后的主体。 ...

rest apache-camel spring-camel
1个回答
1
投票

由于评论而更新

© www.soinside.com 2019 - 2024. All rights reserved.