Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Dynamic routees in group router #20

Closed
pavelsmejkal opened this issue Nov 10, 2016 · 2 comments
Closed

Question: Dynamic routees in group router #20

pavelsmejkal opened this issue Nov 10, 2016 · 2 comments

Comments

@pavelsmejkal
Copy link
Contributor

Hi, i have one question about routing group. I was studying how the routers are written since I wanted to help with consistent hashing issue.

Just want to ask what is the intention about group routers. Are they static by any purpose? You have mentioned consul.io in readme. That is exactly what i want to use for clustering. But how to incorporate it to gam ?

Only way currently is to create front facing structure that will implement Tell(message interface{}) and forward messages to some group router. If anything changes in consul network this struct will re-create group router and stop old remote pids. Is that something that you are proposing? Or i have missed something.

It would be awesome if group routers would have ability to change routees in runtime.

@rogeralsing
Copy link
Collaborator

rogeralsing commented Nov 10, 2016

The easiest way to do what you want right now, would be to create an actor that talks to consul, to find the PID's for each routee.

e.g.

Sender -> Consul Proxy Actor -> Routee

That way, when you send a message, send it to the consul proxy actor, this actor could then check what routees are available, and pick one and send the message forward to that actor.

pseudo code

func (*ProxyActor) Receive(context actor.Context) {
   // Fetch consul info via consul Go RPC API.
   // Pick one address from the result
   // create a PID for the above address
   pid.Tell(context.Message()) 
}

I am currently investigating what would be the best way forward to create a cluster system for GAM.
I am leaning towards using MemberList from Hashicorp, it is the same code that actually powers Consul.
That would allow GAM systems to form a cluster w/o having Consul installed.

@pavelsmejkal
Copy link
Contributor Author

Thank you for quick reply, Proxy Actor sounds like go idea. It doesn't need to fetch consul data directly but it can be just notified from outside as well.

About MemberList if it is cover by opened API why not. But It should be possible to explicitly use already existing service catalog either consul or etcd. Since there are many subject using already such service in heterogeneous environments including me :) wink, wink

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants