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

Support Kafka as an additional transport #158

Open
rhinof opened this issue Sep 14, 2019 · 9 comments
Open

Support Kafka as an additional transport #158

rhinof opened this issue Sep 14, 2019 · 9 comments
Labels
enhancement New feature or request

Comments

@rhinof
Copy link
Contributor

rhinof commented Sep 14, 2019

@vladshub @adiweiss @avigailberger @danielwitz @yuvmendel thoughts?

@rhinof rhinof added the enhancement New feature or request label Sep 14, 2019
@rhinof
Copy link
Contributor Author

rhinof commented Dec 17, 2019

@Prajna you can configure a kafka producer to wait for an ack from the elected leader or wait for akcs from all brokers in a replica (or none for non-resilient producing)
https://kafka.apache.org/documentation/#producerconfigs
On the consumer side it is just a matter of incrementing the consumers offset

@vladshub
Copy link
Contributor

I think this could add a lot of value, and clean our code as well.

@rhinof
Copy link
Contributor Author

rhinof commented Dec 26, 2019

@vladshub I agree, it will force us to decouple our message handling code from rabbitmq specifics that will promote for a better design and in addition provide kafka as a transport which will provide for a lot of value

vladshub added a commit that referenced this issue Dec 26, 2019
Solve issue #158
Disconnects rabbitmq and allows addition of kafka or any other transport
vladshub added a commit that referenced this issue Dec 26, 2019
Solve issue #158
Disconnects rabbitmq and allows addition of kafka or any other transport
@rhinof
Copy link
Contributor Author

rhinof commented Dec 27, 2019

@vladshub I think the challenge and where we need to think about the correct abstractions is how we bridge the conceptual gap between rabbit and kafka in respect to what is the unit of parallelism.
while in rabbit it is the consumer and in kafka it is the topic/partition.

@vladshub
Copy link
Contributor

@vladshub I think the challenge and where we need to think about the correct abstractions is how we bridge the conceptual gap between rabbit and kafka in respect to what is the unit of parallelism.
while in rabbit it is the consumer and in kafka it is the topic/partition.

I agree with you, however, I think it should be "hidden" in the implementation of the transport.
The first stage we should decide on the interface which I started writing in PR #230 which should abstract the underlying implementation and we should decide if we have one transport instance which receives all of the messages/instances and then fans them out to all of the grabbit workers or should we have an instance of transport for each grabbit worker.
Once that is done and we cleaned up the code from Rabbit "notions" it should be easy to implement the Kafka transport and in the future any additional. :)

@vladshub
Copy link
Contributor

vladshub commented Dec 31, 2019

@rhinof also I was thinking about a transport registry which should look like the database/sql implementation in go

import "github.com/wework/grabbit/gbus"
import _ "github.com/vladshub/grabbit-kafka"
.
.
.

This way we would allow the addition of new transports seamlessly, and maybe it will be easier to adopt.

then we would be able to have things like:

url = "amqp://user:pass@host:port/vhost"
url = "nats://user:pass@host:port/vhost"
url = "kafka://user:pass@host:port/vhost"
url = "nsq://user:pass@host:port/vhost"
...

@rhinof
Copy link
Contributor Author

rhinof commented Jan 1, 2020

@rhinof also I was thinking about a transport registry which should look like the database/sql implementation in go

import "github.com/wework/grabbit/gbus"
import _ "github.com/vladshub/grabbit-kafka"
.
.
.

This way we would allow the addition of new transports seamlessly, and maybe it will be easier to adopt.

then we would be able to have things like:

url = "amqp://user:pass@host:port/vhost"
url = "nats://user:pass@host:port/vhost"
url = "kafka://user:pass@host:port/vhost"
url = "nsq://user:pass@host:port/vhost"
...

I like the notion of following the driver model for hooking new transports however I still do not have a clear enough opinion on what would be the better approach to bridging the conceptual gaps between a broker model as rabbitmq and a distributed log like kafka (push vs pull, different units of parallelism etc,,)

@vladshub
Copy link
Contributor

vladshub commented Jan 2, 2020

@rhinof , you are right that is why my suggestion is to start with just moving and abstracting away our current rabbit implementation, once it's in one place we can look at the 2 different approaches and see where this responsibility should lay in and how to model it.

@rhinof
Copy link
Contributor Author

rhinof commented Jan 2, 2020

@vladshub ok, makes sense starting with something rough and refining along the way.
I created the experimental-kafka branch (branched off of master) so we could work on

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

No branches or pull requests

2 participants