4.5. 将 URI 配置为写或读数据
在以下路由中,Camel 将写入指定的 websocket 连接。
from("direct:start")
.to("ahc-ws://targethost");
以及等同的 Spring 示例:
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="direct:start"/>
<to uri="ahc-ws://targethost"/>
</route>
</camelContext>
在以下路由中,Camel 将从指定的 websocket 连接中读取。
from("ahc-ws://targethost")
.to("direct:next");
以及等同的 Spring 示例:
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="ahc-ws://targethost"/>
<to uri="direct:next"/>
</route>
</camelContext>