envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
24.71k stars 4.76k forks source link

load balancing length delimited (prefixed) TCP messages #3650

Closed rkbalgi closed 6 years ago

rkbalgi commented 6 years ago

Hey Guys, I wanted to know if there a way to load balance TCP messages which are length delimited/prefixed (a 2 byte/4 byte prefix etc). These kind of messages are common in the payments industry which use formats like ISO8583.

Example - a "hello world" would be sent as 000b68656c6c6f20776f726c64 (where 000b is the length prefix and the rest is hello world in ASCII). I would like to break down the message and then send it upstream to a cluster with a load balancer policy.

If such a feature is not available, any guidance to adding such support would be very helpful!

mattklein123 commented 6 years ago

You could do this via custom filter.

rkbalgi commented 6 years ago

Thanks Matt! Would this be a good starting point? - https://github.com/envoyproxy/envoy-filter-example

mattklein123 commented 6 years ago

Yup or other filters in https://github.com/envoyproxy/envoy/tree/master/source/extensions

mattklein123 commented 6 years ago

Closing as answered.

GustavoAdrianGimenez commented 3 years ago

Hi @rkbalgi, How are you? Did you find some way to balance ISO 8583 traffic with envoy? can you share some example? Thank you!

rkbalgi commented 3 years ago

Hi @GustavoAdrianGimenez We ultimately chose to write our own simplified version of a proxy.