Dependency io.debezium:debezium-core breaks Spring Boot logging

68 views
Skip to first unread message

Jan Baudisch

unread,
Mar 3, 2023, 7:49:53 AM3/3/23
to debezium
Hello,

we have a standard Spring Boot Application with a Debezium TestContainer Test.

When including the dependency

<dependency>
<groupId>io.debezium</groupId>
<artifactId>debezium-testing-testcontainers</artifactId>
<version>2.1.2.Final</version>
<scope>test</scope>
</dependency>

to the pom.xml, there will be no logging output any more when executing JUnit tests.
When excluding the transitive dependency io.debezium:debezium-core, the logging works.

Does Debezium require special handling when using with Slf4j/Logback?

Regards,
Jan

Chris Cranford

unread,
Mar 3, 2023, 8:35:46 AM3/3/23
to debe...@googlegroups.com
Hi Jan

That sounds odd; is it possible there is a version conflict on the classpath between the dependency from Debezium vs Spring?

Chris
--
You received this message because you are subscribed to the Google Groups "debezium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to debezium+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/debezium/f2fc34d2-eac0-4ef0-97a9-fc9e3f0116abn%40googlegroups.com.

Jan Baudisch

unread,
Mar 3, 2023, 11:02:43 AM3/3/23
to debezium
Hi Chris,

thank you for your quick answer. For me, it seems there is no version conflict.
debezium-core has only few dependencies, and they are not dependencies of the Spring Boot application

[INFO] +- org.testcontainers:mongodb:jar:1.17.5:test
[INFO] +- io.debezium:debezium-core:test-jar:tests:2.1.2.Final:test
[INFO] | +- io.debezium:debezium-api:jar:2.1.2.Final:test
[INFO] | \- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.14.1:test
[INFO] \- io.quarkus:quarkus-test-common:jar:2.14.0.Final:test

I have created a small example project demonstating the issue:


Shall I open an issue at Debezium?

Jan

jiri.p...@gmail.com

unread,
Mar 6, 2023, 4:43:22 AM3/6/23
to debezium
The transitive dependency on core test JAR brings the logback config https://github.com/debezium/debezium/tree/main/debezium-core/src/test/resources

Can it be the issue?

J.

Jan Baudisch

unread,
Mar 7, 2023, 8:14:08 AM3/7/23
to debezium
Thank you.
The logback config file /src/test/resources/logback-test.xml was indeed the problem.
Duplicating my logback.xml to logback-test.xml fixed the logging.

It seems that the only class from debezium-core needed to execute Debezium Testcontainer tests is the class
io.debezium.util.ContainerImageVersions

logback-test.xml seems to be the Logback config for the Debezium tests.

Wouldn't it be better not to package the Tests and logback-test.xml into the jar?

From my point of view, this are separate concerns and belong to different .jars:
In the one hand the Debezium TestUtil classes to execute the Debezium Testcontainer Tests, and on the other hand
the Testcode to test Debezium itself.

Ben Gilbert

unread,
Jun 1, 2023, 3:23:01 PM6/1/23
to debezium

Hi,
I just got burned by this as well and found this while searching to see if it had already been raised as a DBZ Jira. 
Having looked at the `debezium-testing-testcontainers` project I came to the same conclusion as Jan that

1. This really doesn't look like it should be depending on a test-jar and it would be better not to have that dependency
2. If others are really convinced this is the way to go - a resource filter to exclude `logback-test.xml` from being packaged into the test-jar seems like a good fix.

jiri.p...@gmail.com

unread,
Jun 2, 2023, 1:12:13 AM6/2/23
to debezium
Hi,

could you please raise a Jira if it does not exist yet?

Thanks

J.

Ben Gilbert

unread,
Jun 5, 2023, 4:45:22 AM6/5/23
to debezium
Created https://issues.redhat.com/browse/DBZ-6525 and linked to here as well.
Reply all
Reply to author
Forward
0 new messages