Skip to content

protocol-laboratory/kop-proxy-go

kop-proxy-go

kop-proxy-go (Kafka on Pulsar implement by golang) brings the native Apache Kafka protocol support to Apache Pulsar by introducing a Kafka protocol handler on Pulsar brokers. It uses golang to implement the complete Kafka client and server protocol.

How to use kop-proxy-go

  1. define a structure to implement the Server interface
type ItKopImpl struct {}
var _ kop.Server = (*ItKopImpl)(nil)

func (e ItKopImpl) Auth(username string, password string, clientId string) (bool, error) {
    return true, nil
}
// ... other method implement
  1. run a kop instance
func main() {
    config := &kop.Config{}
    e := &ItKopImpl{}
    impl, err := kop.NewKop(e, config)
    if err != nil {
        panic(err)
    }
    err = impl.Run()
    if err != nil {
        panic(err)
    }
    interrupt := make(chan os.Signal, 1)
    signal.Notify(interrupt, os.Interrupt)
    for range interrupt {
        impl.Close()
        return
    }
}

use case: kop-proxy-go/cmd/it

About

Kop Proxy Go. Feel free to open an issue if you have any questions or feature requests.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •