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

Start & stop Kafka process within running container #1235

Merged
merged 7 commits into from
Oct 22, 2020

Conversation

seglo
Copy link
Contributor

@seglo seglo commented Oct 19, 2020

Fixes #1233

Add support to stop and start the Kafka broker programmatically without having to stop or start the container (see #1233 for issues with managing container lifetime).

@seglo seglo marked this pull request as draft October 19, 2020 21:29
@ennru
Copy link
Member

ennru commented Oct 20, 2020

This looks very good.
I wonder how Testcontainers 1.15 affects this. #1225

@seglo
Copy link
Contributor Author

seglo commented Oct 20, 2020

Thanks. I'm not certain if I'm reproducing "pick up again when the Kafka server comes back up" as was intended. In my local tests the consumer won't usually reset to offset 0, but it will disconnect. On travis it will always reset to 0. I think it's because the broker takes longer to start again, when I manually increase the sleep after the broker stop then I can reproduce the problem locally. The change I made to accommodate both scenarios is to always request the full number of messages produced and assert the tail is correct. In both scenarios the Consumer is reconnecting silently, so I think it satisfies the original intention of the test.

@seglo
Copy link
Contributor Author

seglo commented Oct 20, 2020

I wonder how Testcontainers 1.15 affects this. #1225

Good question. I was thinking about referencing their 1.15 release, but it's not a final yet. Maybe it will be available before our release.

@bsideup
Copy link

bsideup commented Oct 21, 2020

@seglo JFYI the "rc" status of 1.15.0 is only for the image-related changes (deprecated constructors & more) that we wanted to evaluate before doing a Big Bang Release :)
The "core" API is stable (not to mention that we care deeply about the backward compatibility) and it is safe to use now. Also, I am not planning to touch Kafka's internals any time soon, so I'd say you're good to go with rc2 unless you have a super strict & restrictive policy irt dependency versions.

@seglo
Copy link
Contributor Author

seglo commented Oct 21, 2020

@bsideup Thanks for the info. We'll give the RC a test run before our release to confirm our use case is still working as expected.

@seglo seglo marked this pull request as ready for review October 21, 2020 15:08
Copy link
Member

@ennru ennru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@ennru ennru merged commit f8a8e31 into akka:master Oct 22, 2020
@ennru
Copy link
Member

ennru commented Dec 22, 2020

This has been backported to the release-2.0.x branch to be part of 2.0.6.

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

Successfully merging this pull request may close these issues.

Simulate downed broker with testcontainers in ReconnectSpec
3 participants