Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

add new module to map plumtree to servlets #455

Merged
merged 4 commits into from
Jan 1, 2023

Conversation

atoulme
Copy link
Member

@atoulme atoulme commented Dec 31, 2022

PR description

Adds a new module that shows how to leverage servlets to perform gossip between servers.

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);
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Contributor

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.

@atoulme atoulme merged commit 701200e into apache:main Jan 1, 2023
@atoulme atoulme deleted the plumtree-servlet branch January 1, 2023 06:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants