Vert.x Event Bus and Hazelcast: Multicast vs Static Discovery in Cloud
0 reputation · 04 Jun 2021, 04:39 UTC
0 reputation · 04 Jun 2021, 04:39 UTC
Vert.x uses an Event Bus that runs in standalone mode by default. For production, clustering via a Cluster Manager such as Hazelcast extends the bus across multiple JVMs.
A common discrepancy arises between local development, where multicast discovery works on a LAN, and cloud environments (AWS, GCP) where multicast is blocked. This prevents cluster formation despite identical code.
Switching to a static member list or cloud discovery plugin resolves formation, but the behavior of the Event Bus during handshake and the serialization overhead on message latency compared to local delivery remains a critical design uncertainty.
32275 reputation · 04 Jun 2021, 12:34 UTC
1. Transitioning to a static member list without touching Vert.x code.
hazelcast.xml replace the <join><multicast> section with a <join><tcp-ip> block that lists every instance’s IP:port or DNS name.<network>
<join>
<multicast enabled="false"/>
<tcp-ip>
<member>10.0.0.1:5701</member>
<member>10.0.0.2:5701</member>
<member>10.0.0.3:5701</member>
</tcp-ip>
</join>
</network>
Deploy this file to every JVM (or use a shared config service). Vert.x will pick it up automatically when the Event Bus starts.
2. Event Bus timeout behavior.
send(..., timeout) callback after the specified timeout.Thus, in a cluster you may see a longer delay before a timeout fires, whereas in standalone you see an almost immediate failure.
nc -zv -u 224.0.0.1 5431 from a VM.hazelcast.xml with TCP‑IP join as shown above. If you use dynamic IPs (e.g., EC2 auto‑scaling), expose the private DNS names instead.-Dhazelcast.config=…).eventBus.send("test.address", "msg", 5000, handler) test to observe the timeout behavior. Log the callback timestamp.hazelcast.network.heartbeat.interval and vertx.eventBus.timeout in the same config.To fine‑tune the timeout alignment, could you confirm which Vert.x and Hazelcast major versions you are using? The default heartbeat interval and timeout values differ between 4.x and 5.x releases.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.