Vertx 和 Camel 集成

Jer*_*y V 3 apache-camel vert.x

我试图找出将消息从 Apache Camel 路由发送到外部 Vert.x 事件总线的最佳方式。

我查看了camel-vertx 库和vertx-camel-bridge,但这些库似乎用于在同一JVM 中运行的Camel 和Vert.x 之间进行通信,我没有看到任何有关Camel 和Vert 的示例。 x 单独运行。

我的假设正确吗?ActiveMQ 会成为 Vertx 和 Camel 之间的良好桥梁吗?

tse*_*ont 5

Vert.x 事件总线可以集群。在一个节点 (A) 上,您可以有一个纯 Vert.x 应用程序发送消息。在另一个节点 (B) 上,您可以使用 Vert.x Camel 桥接您的 Camel 应用程序。

在节点 A 上:

vertx.eventBus().send("eventbus-address", "a message");
Run Code Online (Sandbox Code Playgroud)

在节点 B 上:

CamelContext camel = new DefaultCamelContext();
OutboundMapping outbound = OutboundMapping
  .fromVertx("eventbus-address")
  .toCamel("stream:out");
CamelBridge.create(vertx, new CamelBridgeOptions(camel)
  .addOutboundMapping(outbound)).start();
Run Code Online (Sandbox Code Playgroud)