-
-
Notifications
You must be signed in to change notification settings - Fork 406
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
ISSUE 615: Changes to support "seekEpoch", "seekTimestamp" in Kafka Consumer step, removing "seek" from ConsumerCommonConfigs #619
ISSUE 615: Changes to support "seekEpoch", "seekTimestamp" in Kafka Consumer step, removing "seek" from ConsumerCommonConfigs #619
Conversation
core/src/main/java/org/jsmart/zerocode/core/kafka/consume/ConsumerLocalConfigs.java
Outdated
Show resolved
Hide resolved
1. Changed epoch seekTimestamp to seekEpoch and added seekTimestamp with format and timestamp 2. Added validations for seekEpoch and seekTimestamp 3. Implemented seekTimestamp feature
…issue-615/seekToTimestamp
@nirmalchandra Which Wiki page should I update with details of use of this feature? Have added a ser/des unit test and an integration test for the feature which is working as expected |
@nirmalchandra @authorjapps @M3lkior hey, let me know if there is any action i need to take on this |
pom.xml
Outdated
@@ -138,6 +139,13 @@ | |||
<artifactId>json</artifactId> | |||
<version>20160810</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.projectlombok</groupId> |
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.
Hi @a1shadows , Great work!
It's preferred to go with simple getter/setter methods, without using lombok
.
This has caused IDE dependency, readability and other issues in the past.
Can you please remove this ?
Rest everything looks amazing. 🚀
I might add couple of more scenarios to the test pack before merging.
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 added Lombok to reduce the boilerplate code. Are you sure we want to write explicit getters, setters and constructors for everything?
At my workplace, we have been using Lombok extensively and at great scale with no issues faced so far, and the code stays compact.
Let me know either way and I'll make the changes
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 added Lombok to reduce the boilerplate code. Are you sure we want to write explicit getters, setters and constructors for everything?
At my workplace, we have been using Lombok extensively and at great scale with no issues faced so far, and the code stays compact.
Let me know either way and I'll make the changes
Thanks for understanding @a1shadows . Kindly make the changes to remove lombok
.
Reason is simple, it has happened in the past, worth thinking about the practicality of the issue in terms of benefits.
Thousands of projects are using this library and we wouldn't want to have additional maintenance overhead due to some projects at some corner of the world may comeback with issues, wanting us to fix it.
That will need additional work to reproduce the issue, fix, PR and merge, then release cycle.
Also, can you take a look and fix this CI failure? 🔴
https://github.com/authorjapps/zerocode/pull/619/checks#step:6:12150 (click)
testSerDeser_seekEpoch(org.jsmart.zerocode.core.kafka.consume.ConsumerLocalConfigsWrapTest) Time elapsed: 0.004 sec <<< FAILURE!
java.lang.AssertionError: consumerLocalConfigs.seekEpoch
Expected: 1706940293669
got: 1707299617296
at org.skyscreamer.jsonassert.JSONAssert.assertEquals(JSONAssert.java:417)
at org.skyscreamer.jsonassert.JSONAssert.assertEquals(JSONAssert.java:394)
at org.jsmart.zerocode.core.kafka.consume.ConsumerLocalConfigsWrapTest.testSerDeser_seekEpoch(ConsumerLocalConfigsWrapTest.java:36)
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.
@authorjapps could you let me know on the above point? Also, can you let me know when the PR looks ready to merge? Would love to see a merge commit on my 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.
@authorjapps could you let me know on the above point? Also, can you let me know when the PR looks ready to merge? Would love to see a merge commit on my name ? 😁
Thanks for understanding @a1shadows .
Can you please make the changes to remove lombok
dependency soon you get chance?
Once done, please confirm.
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.
@authorjapps Did you have time to consider Lombok use in the project? We can whittle down the volume of code significantly in the long run if we adopt it. Let me know.
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.
@authorjapps Did you have time to consider Lombok use in the project? We can whittle down the volume of code significantly in the long run if we adopt it. Let me know.
Already provided my view in this thread.
To add more clarity:
@a1shadows , Lets do it this way to derisk this release if you are keen in using lombok.
- For this PR, please remove it and lets release it (
version = 1.0.36
) - Raise a new PR with it and we can make a new release with lombok (e.g.
version = 1.0.37-RC-lombok
)
(Use this new Issue No. 624 for your commits. ) Release with Lombok dependency (with a RC version) #624
This way we don't introduce overhead with our regular releases, then once the version 1.0.37-RC-lombok
becomes stable, we can merge the code to main release.
Can you amend this PR for Point No.1 please?
and
a new PR for Point No.2 please? <--- This is optional as it it is only Dev stuff, really doesn't affect any users
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.
@authorjapps Hey, I have removed the Lombok dependency and fixed the test. Can you take another look at this?
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.
@authorjapps Hey, I have removed the Lombok dependency and fixed the test. Can you take another look at this?
Thanks, just given a rerun now on the CI job. Once Green, we should be able to merge.
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.
@authorjapps Looks like CI is a success. Can we merge now?
core/src/main/java/org/jsmart/zerocode/core/kafka/helper/KafkaConsumerHelper.java
Outdated
Show resolved
Hide resolved
pom.xml
Outdated
@@ -138,6 +139,13 @@ | |||
<artifactId>json</artifactId> | |||
<version>20160810</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.projectlombok</groupId> |
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 added Lombok to reduce the boilerplate code. Are you sure we want to write explicit getters, setters and constructors for everything?
At my workplace, we have been using Lombok extensively and at great scale with no issues faced so far, and the code stays compact.
Let me know either way and I'll make the changes
Thanks for understanding @a1shadows . Kindly make the changes to remove lombok
.
Reason is simple, it has happened in the past, worth thinking about the practicality of the issue in terms of benefits.
Thousands of projects are using this library and we wouldn't want to have additional maintenance overhead due to some projects at some corner of the world may comeback with issues, wanting us to fix it.
That will need additional work to reproduce the issue, fix, PR and merge, then release cycle.
Also, can you take a look and fix this CI failure? 🔴
https://github.com/authorjapps/zerocode/pull/619/checks#step:6:12150 (click)
testSerDeser_seekEpoch(org.jsmart.zerocode.core.kafka.consume.ConsumerLocalConfigsWrapTest) Time elapsed: 0.004 sec <<< FAILURE!
java.lang.AssertionError: consumerLocalConfigs.seekEpoch
Expected: 1706940293669
got: 1707299617296
at org.skyscreamer.jsonassert.JSONAssert.assertEquals(JSONAssert.java:417)
at org.skyscreamer.jsonassert.JSONAssert.assertEquals(JSONAssert.java:394)
at org.jsmart.zerocode.core.kafka.consume.ConsumerLocalConfigsWrapTest.testSerDeser_seekEpoch(ConsumerLocalConfigsWrapTest.java:36)
pom.xml
Outdated
@@ -138,6 +139,13 @@ | |||
<artifactId>json</artifactId> | |||
<version>20160810</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.projectlombok</groupId> |
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.
@authorjapps could you let me know on the above point? Also, can you let me know when the PR looks ready to merge? Would love to see a merge commit on my name ? 😁
Thanks for understanding @a1shadows .
Can you please make the changes to remove lombok
dependency soon you get chance?
Once done, please confirm.
pom.xml
Outdated
@@ -138,6 +139,13 @@ | |||
<artifactId>json</artifactId> | |||
<version>20160810</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.projectlombok</groupId> |
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.
@authorjapps Did you have time to consider Lombok use in the project? We can whittle down the volume of code significantly in the long run if we adopt it. Let me know.
Already provided my view in this thread.
To add more clarity:
@a1shadows , Lets do it this way to derisk this release if you are keen in using lombok.
- For this PR, please remove it and lets release it (
version = 1.0.36
) - Raise a new PR with it and we can make a new release with lombok (e.g.
version = 1.0.37-RC-lombok
)
(Use this new Issue No. 624 for your commits. ) Release with Lombok dependency (with a RC version) #624
This way we don't introduce overhead with our regular releases, then once the version 1.0.37-RC-lombok
becomes stable, we can merge the code to main release.
Can you amend this PR for Point No.1 please?
and
a new PR for Point No.2 please? <--- This is optional as it it is only Dev stuff, really doesn't affect any users
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.
Good work. Approved
New Feature: Support to consume on all partitions from specified timestamp/epoch
PR Branch
https://github.com/a1shadows/zerocode/tree/issue-615/seekToTimestamp
fixes #615
fixes #621
Motivation and Context
Right now, the seek method available can only seek from one partition and has no semantics to consume from a specific timestamp. It only consumes the last 'n' messages on the specified partition.
With this new feature, we will be able to consume on all partitions from specified timestamp/epoch in the following fashion:
or like this:
in the kafka consume step.
In addition, we have also removed "seek" from ConsumerCommonConfigs as it made no sense in a common context and can now only be specified as a consumerLocalConfig.
Checklist:
Unit tests added
Integration tests added
Test names are meaningful
Feature manually tested
Branch build passed
No 'package.*' in the imports
Relevant Wiki page updated with clear instruction for the end user
Http test added to
http-testing
module(if applicable) ?Kafka test added to
kafka-testing
module(if applicable) ?