-
Notifications
You must be signed in to change notification settings - Fork 79
add new module to map plumtree to servlets #455
Conversation
d1b7dfe
to
2a095c7
Compare
2a095c7
to
77897d2
Compare
plumtree-servlet/src/main/java/org/apache/tuweni/plumtree/servlet/GossipServlet.java
Outdated
Show resolved
Hide resolved
plumtree-servlet/src/main/java/org/apache/tuweni/plumtree/servlet/GossipServlet.java
Outdated
Show resolved
Hide resolved
message.hash = hash.toHexString(); | ||
message.payload = payload == null ? null : payload.toHexString(); | ||
HttpPost postMessage = new HttpPost("http://" + ((ServletPeer) peer).getAddress()); | ||
postMessage.setHeader(PLUMTREE_SERVER_HEADER, this.networkInterface + ":" + this.port); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is a means to self seed the peers? How do they discover each other?
Would they need to be colocated in the same process?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is indeed how you tell the other peer how to communicate with you. Discovery is not part of plumtree.
You can see in the test how we connect the peers. If you want discovery, there are a few ways to go about it :) there are a few libs in Tuweni to deal with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the options is to use plumtree to gossip new peers to all peers so they all connect, if you're interested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I'm thinking that I may assume that there are certain seed nodes that are well known to each deployment that can bootstrap the initial set of peers and use gossip for that interaction to spread the new one across the others.
PR description
Adds a new module that shows how to leverage servlets to perform gossip between servers.