Data exchange between verticals in Vert.x
What's the best way to exchange data in Vert.x between vertices? I'm most interested in low, direct, parallel access. The event system doesn't seem to fit if multiple vertices need to be able to access things that are large enough that their economy isn't sent as json.
A simple example - consider a mock email service using Vert.x. Let's say that it has two verticals, one to determine the next package to send, and the other to figure out the fuel spent in the previous hour on vehicles delivering the packages.
Say there are 1000 packages at any given time. There might be a database returning them, but then it will need to return all packets as the algorithms for determining which packet to send / spent fuel are complex enough and run by two verticals.
So far I have found them:
- Vert.x Equivalent to the global Node.js object
- Clustering and Shared Data in Vert.x
- https://groups.google.com/forum/#!topic/vertx/fyVvWRzeqJU
Some suggestions:
- Use
JSON.stringify
/JSON.parse
viavertx.getMap
. This looks pretty overhead to me, especially when things are updated frequently (for example, the package location may contain a GPS coordinate) - Use EHCache, Hazelcast, etc., but they mostly die with "you can try" without details.
Is there a canonical Vert.x solution that I have not been able to recognize? I'm fine with dividing things up differently, having more vertices, lower / higher granularity, etc., if so, then there is a more architectural question regarding the Vert.x model.
I'm also interested in seeing the open source examples linked to above, if any.
source to share