-
Notifications
You must be signed in to change notification settings - Fork 14.4k
KAFKA-5146 / move kafka-streams example to a new module #10131
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
Conversation
0681b34
to
e568571
Compare
e568571
to
cae4e15
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the PR!
build.gradle
Outdated
@@ -1528,8 +1523,7 @@ project(':streams') { | |||
':streams:upgrade-system-tests-24:test', | |||
':streams:upgrade-system-tests-25:test', | |||
':streams:upgrade-system-tests-26:test', | |||
':streams:upgrade-system-tests-27:test', | |||
':streams:examples:test' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should include the new streams-examples
module in testAll
goal.
streams-examples/.gitignore
Outdated
@@ -0,0 +1 @@ | |||
/bin/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious. Why do we need this?
compile(project(':connect:json')) { | ||
// this transitive dependency is not used in Streams, and it breaks SBT builds | ||
exclude module: 'javax.ws.rs-api' | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break users who were relying on the transitive dependency. We may want to add a note to the release notes.
build.gradle
Outdated
from(project(':streams:examples').jar) { into("libs/") } | ||
from(project(':streams:examples').configurations.runtime) { into("libs/") } | ||
from(project(':streams-examples').jar) { into("libs/") } | ||
from(project(':streams-examples').configurations.runtime) { into("libs/") } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we change the name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We move the sub-module stream/examples
into it's own module streams-examples
. I would be weird to only name it examples
as there is not parent streams
reference any longer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an advantage in having it as a top level module instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As describe on the Jira, the goal is to get rid of the dependency of stream
model on connect
module. It's ok for streams-examples
to depend on connect
, but for streams
is cleaner to not have it, and the dependency is only there to pull in stuff for the examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems independent of whether it's a submodule or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. \cc @ableegoldman
I actually just tried to only remove the connect
dependency from streams
module (and add the Jackson dependency we need fo StateDirectory.java
) and it seems to work.
So maybe we can just keep sub-module :streams:examples
as-is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, maybe we're not even using connect
in the examples to begin with (or at least, not anymore)? That actually doesn't sound too surprising, I've never seen Connect being used in any streams stuff I've looked at
That seems independent of whether it's a submodule or not
@ijuma WDYM? If the examples are a submodule of streams
, and the examples depend on connect
, then doesn't that mean the streams
module will pull in connect
? Even if we may turn out not to depend on connect
to begin with...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ableegoldman No. I removed the connect-json
dependency from streams
and left it in streams:examples
and the dependency is gone from the streams
module:
compileClasspath - Compile classpath for source set 'main'.
+--- project :clients
+--- org.slf4j:slf4j-api:1.7.30
+--- org.rocksdb:rocksdbjni:5.18.4
+--- com.fasterxml.jackson.core:jackson-annotations:2.10.5
--- com.fasterxml.jackson.core:jackson-databind:2.10.5.1
+--- com.fasterxml.jackson.core:jackson-annotations:2.10.5
--- com.fasterxml.jackson.core:jackson-core:2.10.5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's all you need to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I will send a PR later this week fixing it to be as discussed here then. Probably even tonight (CET).
cae4e15
to
75879da
Compare
// this transitive dependency is not used in Streams, and it breaks SBT builds | ||
exclude module: 'javax.ws.rs-api' | ||
} | ||
|
||
implementation libs.slf4jApi | ||
implementation libs.rocksDBJni | ||
implementation libs.jacksonAnnotations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"implementation libs.jacksonDatabind" is already being added to compileClassPath in streams module.
Thus it seems that indeed there's no need to add compile dependency of libs.jacksonDatabind to streams module. Please let me know if this is not the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM.
Back in the days, KafkaStreams did not use anything JSON related, but in a later version we actually added this dependency.
build.gradle
Outdated
@@ -1635,8 +1627,14 @@ project(':streams:examples') { | |||
archivesBaseName = "kafka-streams-examples" | |||
|
|||
dependencies { | |||
// this dependency should be removed after we unify data API | |||
compile(project(':connect:json')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compile
is deprecated, you have to choose between api
and implementation
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ijuma well noted! I have updated the PR. Since there are many "compile" references in build.gradle, I will have a look later on JIRA if there is already a ticket to update all this to api or implementation and raise if not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
having a better look, seems that no ticket is required. They are compileOnly or testCompileOnly which are not deprecated. All good.
75879da
to
c2cb194
Compare
c2cb194
to
8c439e7
Compare
@MarcoLotz Overall LGTM -- but as mentioned by @ijuma (cf #10131 (comment)) we should add a comment to the upgrade note (ie, in |
0e50a83
to
cb3be19
Compare
Thank you for pointing the directions @mjsax. Updated those files. Since it's not API related, I've used another paragraph on streams/upgrade-guide.html |
215b74a
to
bae4795
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry the delay -- and thanks for updating the docs! Overall LGTM.
Seems there is some conflict -- can you rebase so we can merge this PR?
bae4795
to
dd605f7
Compare
Thanks for the PR @MarcoLotz |
* apache-github/trunk: KAFKA-10769 Remove JoinGroupRequest#containsValidPattern as it is dup… (apache#9851) KAFKA-12384: stabilize ListOffsetsRequestTest#testResponseIncludesLeaderEpoch (apache#10389) KAFKA-5146: remove Connect dependency from Streams module (apache#10131)
Moved "streams-examples" to its own module outside kafka-streams module.
Because of org.apache.kafka.streams.processor.internals.StateDirectory in kafka-streams module, I had to add the jackson binder dependency. Before the change, It was probably being retrieved as a transitive dependency through "connect-json" dependency.
Committer Checklist (excluded from commit message)