Comment From: snicoll

Unfortunately, the upgrade missed several key points. Cassandra and Kafka containers have moved with a deprecation, but they don't share any common ancestors. As a result, if we move our support to the non-deprecated version, then the deprecated version no longer works (i.e. ConnectionDetails aren't provided anymore).

The other problem is that the difference between the deprecated CassandraContainer and non-deprecated one is sufficient for breaking our SSL smoke tests. We'll have to figure out why the container is failing in the background with the following exception:

INFO  [nioEventLoopGroup-2-7] 2024-10-15 10:55:28,562 Message.java:826 - Unexpected exception during request; channel = [id: 0xa3393c93, L:0.0.0.0/0.0.0.0:9042 ! R:/127.0.0.1:41786]
io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record: 0400000001000000160001000b43514c5f56455253494f4e0005332e302e30
    at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1057) ~[netty-all-4.0.44.Final.jar:4.0.44.Final]
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:411) [netty-all-4.0.44.Final.jar:4.0.44.Final]

cc @eddumelendez for visibility.

Comment From: eddumelendez

Hi @snicoll, thanks for sharing. I have raised https://github.com/testcontainers/testcontainers-java/issues/9410

Thanks for adapting the project to support the new implementations and sorry for the unexpected issues.

Comment From: snicoll

Thanks Eddu. FTR Kafka also has unexpected issues. The new container implementation doesn't behave the same way. So it looks like users have to use the deprecated version initially and then look at the differences.

I wonder if the Javadoc of the deprecated containers could be adapted. I can create an issue if you prefer?

Comment From: eddumelendez

Kafka is a little bit different. org.testcontainers.containers.KafkaContainer has three modes to start (embedded zookeeper, external zookeeper and raft or zookeeperless) and the default one is embedded zookeeper. ConfluentKafkaContainer is not a full replacement of the previous one, it just supports raft mode which starts with tag 7.4.0. The smoke test for SSL was using the embedded zookeeper but could switch to kraft mode using withKraft() and then the same change would be required as using ConfluentKafkaContainer. Also, the new implementation use the standard kafka port 9092 and remove the security protocol from bootstrap-server, indeed now you can use kafka::getBootstrapServers instead, I remember there is or was an issue related to testcontainers providing plaintext as part of the bootstrap server in boot but couldn't find it.

Testcontainers Kafka documentation mentions the minimum version to use with Confluent but the javadoc miss it. I will update this.

As always your feedback is very welcome.