-
Notifications
You must be signed in to change notification settings - Fork 436
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
[RdKafka] Allow acknowledge
to not call commit
#580
Comments
I dont know. I am not much into kafka world. We could try if you think it makes sense. |
@makasim I'm going to run tests to check if what I understand of Kafka internals is correct anyway. Just looking for your opinion and / or disapproval before I start :) I'll gladly make a PR once I'm sure about it, since I'm going to use that functionality myself. |
Sorry for it being so late, had a lot of different project issues to solve, had to postpone anything related to Kafka. According to my tests, there is no significant difference betweem calling As far as using "normal" In all three cases offset was saved on broker, whether message was acknowledged or not. |
@Steveb-p I think we should make async commit a default behavior than. https://github.com/php-enqueue/enqueue-dev/blob/master/pkg/rdkafka/RdKafkaConsumer.php#L54 |
@makasim I'm looking into this further. As a matter of fact, it seems that calling Sample of subscription for base library does not include I've ran tests with both array:3 [
"global" => array:3 [
"group.id" => "1"
"metadata.broker.list" => "kafka1:9092,kafka2:9092,kafka3:9092"
"enable.auto.commit" => "true"
]
"commit_async" => true
"topic" => array:1 [
"auto.offset.reset" => "beginning"
]
] On subsequent calls, I've not received previously seen messages, which is what I'd expect. array:3 [
"global" => array:3 [
"group.id" => "2"
"metadata.broker.list" => "kafka1:9092,kafka2:9092,kafka3:9092"
]
"commit_async" => false
"topic" => array:1 [
"auto.offset.reset" => "beginning"
"enable.auto.commit" => "false"
]
] At first glance, despite explicitly asking Consumer to not commit automatically, I did not receive previously seen messages. It is possible that Kafka holds some information about Consumer group in memory, but I'm not sure atm. It looks as if array:3 [
"global" => array:3 [
"group.id" => "3"
"metadata.broker.list" => "kafka1:9092,kafka2:9092,kafka3:9092"
"auto.offset.reset" => "beginning"
]
"commit_async" => false
"topic" => array:1 [
"enable.auto.commit" => "false"
]
] For sake of information, since I've stumbled upon this when dealing with topic/global configuration, it seems Configuration was dumped near RdKafkaContext.php:155 ( Either way, it seems that calling |
Thank you for such a detailed overview. I think we can remove commit call than. |
@makasim Wanted to ask this in a separate issue maybe, but this is as good a place as any: I've noticed that there was a recent patch removing However it can also potentially cause deserialization errors to get stuck in Queue indefininitely (this is kinda also my case - Serializer was unable to deserialize message, tho Kafka consumed the message anyway. It might happen for other queue implementations tho, since As for the original issue, I'll provide a patch sometime tomorrow. In case anything breaks due to this, it might happen on my new message bus, so it should provide a nice testing environment :) |
@Steveb-p I am not using Symfony Messenger. IMO messenger transport layer is very very bad designed, for me it is broken in many places. and should not be used at all. Sorry, cannot help you here much. |
@Steveb-p I'd like to propose you a kafka transport maintainer role. As I see you know far more than me about it. Would you be interested? |
@makasim I'd say sure but I'm not familiar with underlying code of Symfony Messenger & Messenger Adapter for it. I've seen a couple of others steping up for the job. I'd prefer to stay a collaborator or co-maintainer at this time. Not to mention, I doubt I'll be using it for anything else than Redis / Kafka. |
I was talking about rdkafka transport not symfony messenger. |
@makasim My bad. I'd do so gladly then, considering my company will probably use it a lot. |
@Steveb-p that's great |
@makasim can I reopen this since I intend to work on it? :) |
Provide addition configuration documentation for integrating with Symfony bundle Fixes #580
According to a discusion on https://gitter.im/arnaud-lb/php-rdkafka calling
KafkaConsumer::commit
or (commitAsync
) is not really necessary, since offset is moved on read from topic (unless I'm mistaken, and also ifenable.auto.commit
topic configuration is left set totrue
(default)).I'd like to propose an option for configuration to disable calling
commit
when acknowledging messages from Kafka. Is it a good idea?The text was updated successfully, but these errors were encountered: