Vertx 和 Camel 集成

Vertx and Camel Integration

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

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

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

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

在节点 A 上:

vertx.eventBus().send("eventbus-address", "a message");

在节点 B 上:

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