-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add Kafka Connect support #105
Comments
Triaged on 14.11.2024: This makes sense and should be implemented. But we should not use the test-clients, as it can create a cyclic dependency. So we should go with the scripts for producer/consumer. |
Why do you need a test container when you keep it running for itself? |
Using test containers for clients within the Docker network allows these clients to communicate easily with other services (Kafka, Keycloak etc.) using Docker aliases. Even if the test container seems to be "running by itself", it's part of the Docker network where it interacts with other containers So, we very much simplify overall networking. |
I am not sure if I completely understand but as part of test-client ITs, I didn't have any problems with running clients code outside of testcontainer and connect it to StrimziTestcontainer Kafka cluster. |
You’re correct that running client code outside of Docker can work without issues in many scenarios. However, when it comes to more complex setups involving OAuth authentication, running clients inside Docker containers becomes easier to handle. OAuth often requires that the client and server share the same OAuth issuer URI. This means the client needs to access the OAuth server (e.g., Keycloak) using the same network address that the Kafka broker uses. So for instance when you are running clients outside of Docker, you might need to manipulate your |
I think that beats the purpose of the test container. The purpose is to run Kafka cluster that is used by your test. Not to run some complete Kafka infrastructure encapsulated into itself. |
The value of the OAuth support is that I can connect to it with a client from inside the unit/integration test. It is not a framewokr for infrastructure as a code. If you want to test that something works for you within a closed up Docker network, use Docker compose for example, but there is no need to integrate it into Java unit/integration tests. |
I thought the clients will be just for testing purposes of our test container (like another readiness/health check for the cluster in ITs), but it seems I misunderstood it right? The real reason is to provide client implementation to users that they could use? |
I understand your perspective. If you don't see this (mentioned all above) as a benefit I am okay with closing this... :) |
I will follow up on #113 (comment) here is this is the primary source of info for the issue. cc @im-konge @mimaison I think the only suitable and useful solution would be to also implement On the other hand, do we really need it? How many known users asked for it? As Lukas mentioned, is super-easy to setup GenericTestContainer (see https://github.com/strimzi/test-clients/blob/main/clients/src/test/java/io/strimzi/integration/KafkaClientWithRegistryIT.java#L48) so I think with clients images it could be something like:
and then just do whatever you want. Do we really need wrapper around this? I don't think so. And if so, then just provide a class as part of |
So I looked at The last remaining issues are the Admin client and Connect:
Apart from these 2 issues |
Thanks, I will have a look at it :)
Yeah we implemented the
What is needed in order to "add a way to run it in strimzi/test-clients"? |
I'd need to keep the client running long enough so I can query its metrics endpoint. We could have it rerun a command a number of times for example. That would be quite similar to the producer client where we keep it running by making it send
I'd need an image that starts Kafka Connect. Then my test could start connectors via the Connect REST API, and finally check the metrics. |
For context, check strimzi/metrics-reporter#67 to see the tests I implemented with |
Okay, I will think about the best way how to cover this in the repo. Maybe we can have some option there to "watch" the Kafka topics or something. That would be maybe useful for some debugging and it can maybe be enough for your use-case. Or for example wait for Kafka topic creation (for your test it will not be created) for some time -> that should be also useful for those using the
FMPOV it doesn't suite the purpose of the |
Isn't it something that could/should be provided by |
Do you mean to encapsulate KafkaConnect/KMM2 scripts as a container? |
yes |
Yeah, I was also thinking about adding KafkaConnect and KMM2 not sure what others think about it. |
I opened a PR adding basic Kafka Connect support: #117 |
Triaged on 28/11/2024: agreed on having a proposal about having KafkaConnect support within test-container. @mimaison is going to work on it. |
I opened a proposal: strimzi/proposals#141 |
Triaged on 12/12/2024: the proposal was opened by @mimaison so we'll keep this and add the support. |
At present, our test containers do not incorporate any client applications, such as producers or consumers. However, there are scenarios where it would be advantageous to instantiate clients within Docker on the
localhost
. This approach would enable the seamless use of Docker network aliases and obviate the necessity to expose any ports.I propose that we can add [1] clients. At the start, we can consider just producer and consumer and then we can extend it more to streams etc. The proposed naming conventions are ProducerContainer and ConsumerContainer, which would allow users to specify multiple configurations through environment variables or builder parameters.
Alternative:
test-container-images
) and call producer/consumer scripts as we do for Kafka/ZK.[1] - https://github.com/strimzi/test-clients
The text was updated successfully, but these errors were encountered: