lerenn / asyncapi-codegen

An AsyncAPI Golang Code generator that generates all Go code from the broker to the application/user. Just plug your application to your favorite message broker!
Apache License 2.0
89 stars 23 forks source link

feature: a basic kafka broker implementation #68

Closed obouchet closed 1 year ago

obouchet commented 1 year ago

Description

First of all, thank you for offering this very nice code generator for async api contracts. It works well for us and fits our needs.

The only missing part for us is the support of Apache Kafka broker since that's what we're using. Thanks to your open interface for the broker, I've been able to make my own broker for Kafka and it works just fine.

This PR is about offering it to you in case you are interested to integrate it to your code base as an alternative to NATS.

It's not perfect but it could be a starter for someone else. I tried to follow as much as possible what you did for NATS, especially the ping example.

Thank you again.

lerenn commented 1 year ago

Hello @obouchet !

Thanks for contributing to the project and for the kind words!

It really nice to have another broker (and one of the most used) added to the repository. I'll be happy to support it with this repository.

It must not have been easy to keep up with the recent changes to simplify the generated code, so thanks for making the effort to adapt the code :pray:

I'll take a deeper look today at your code, but it looks already promising!

obouchet commented 1 year ago

Hello @lerenn!

Thank you so much for being open to add this piece of code to your repo!

Yes, there have been some changes in the recent days that I had to keep up with but that was ok and I must say I like better the non template approach for the brokers :-)

Like I said, it is really a starter and might not cover all Kafka possible configurations for sure but at least it can help bootstraping things and be a base for a more custom Kafka implementation.

Let me know if you want me to make some changes.

Thanks again.

lerenn commented 1 year ago

This is really good work! Thank you very much!

Everything looks good to me! And yes, it's not yet the full feature Kafka implementation, but thanks to your work, people will be able to add the features that interests them along the way. So yes, a perfect bootstrap!

I'll just merge it then :)

lerenn commented 1 year ago

Tagged as v0.19.0 !

obouchet commented 1 year ago

@lerenn Thank you very much for having merged it! I might open future PRs to enrich the kafka broker implementation with more options to cover more features of Kafka.

Keep up your good work please, your generator is awesome!

lerenn commented 1 year ago

@obouchet, thanks for the kind words!

Do not hesitate to come back to me in issue or discussions if there something that we could do (or avoid) to make things even better.

For example, I was thinking about changing the name of structures from 'AppXXX' to 'ServerXXX' throughout the repository in order to be more coherent. It doesn't really feel great in the end to use "App" when every protocol uses "server".

lerenn commented 1 year ago

Also, I'm currently fixing the headers that are not passed correctly.

obouchet commented 1 year ago

Do not hesitate to come back to me in issue or discussions if there something that we could do (or avoid) to make things even better.

Sure, will do!

For example, I was thinking about changing the name of structures from 'AppXXX' to 'ServerXXX' throughout the repository in order to be more coherent. It doesn't really feel great in the end to use "App" when every protocol uses "server".

Makes sense indeed. I second that. Not a major concern but you're right, better align with the rest of the world :-)

Also, I'm currently fixing the headers that are not passed correctly.

Not yet encounter this, we're still in early development phase but thanks for fixing issue ahead :-)