gobetween icon indicating copy to clipboard operation
gobetween copied to clipboard

Can I customize Balancing Strategies in gobetween: select same backend if parameter GuideID % 2 return same value? - Tag Quesion

Open chiennv97 opened this issue 8 years ago • 1 comments

Hello, I want to customize Balancing Strategies in gobetween. I need your help!

I want to New Balancing Strategies: select same backend if parameter GuideID % 2 return same value

Example:

  • I have server A: localhost:9997, server B localhost:9998

  • Server GoBetween: localhost:8080

  • Parameter GuideID % 2 == 1 ---> forward request to server A

  • Parameter GuideID % 2 == 0---> forward request to server B

  • Request 1: http://localhost:8080?guideid=113 ---> forward request to server A because 113 % 2 == 1

  • Request 2: http://localhost:8080?guideid=112 ---> forward request to server B because 112 % 2 == 0

Thanks you!

PS: Sorry, but I can't add tag question in this issue. I don't know why :((

chiennv97 avatar Oct 20 '17 03:10 chiennv97

Hi @chiennv97!

Thanks for your interest in gobetween!

Unfortunately the problem you have can't be currently solved with gobetween (on L4 where gobetween operates, i.e. TCP/UDP/etc.). We do not parse HTTP so can't access query parameters or any other data from the HTTP request.

But we definitely planning to add kind of L7 (and HTTP) protocols support to gobetween, as well as custom rules/customization of requests processing flow, in future. We just need to figure out how to do it better in context of gobetween.

Keep tuned :-)

yyyar avatar Oct 20 '17 14:10 yyyar