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
Feature: Add KPL/KCL support #75
Conversation
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's it for the current round.
Thanks
...ngframework/cloud/stream/binder/kinesis/properties/KinesisBinderConfigurationProperties.java
Outdated
Show resolved
Hide resolved
...ngframework/cloud/stream/binder/kinesis/properties/KinesisBinderConfigurationProperties.java
Outdated
Show resolved
Hide resolved
...c/main/java/org/springframework/cloud/stream/binder/kinesis/KinesisMessageChannelBinder.java
Outdated
Show resolved
Hide resolved
...c/main/java/org/springframework/cloud/stream/binder/kinesis/KinesisMessageChannelBinder.java
Outdated
Show resolved
Hide resolved
@r1m , May we come back to this feature since Spring Integration AWS is now based on KCL v1: spring-projects/spring-integration-aws@dd9f3a7 ? Thanks |
I had already done part of the changes on my local git repo, I'll rebase to get the latest modifications and try to finish the requested changes. |
Codecov Report
@@ Coverage Diff @@
## master #75 +/- ##
=========================================
Coverage ? 24.73%
Complexity ? 22
=========================================
Files ? 10
Lines ? 473
Branches ? 36
=========================================
Hits ? 117
Misses ? 345
Partials ? 11
Continue to review full report at Codecov.
|
I think I covered all the requested changes, it would be nice to have your feedback on 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.
Would you mind to rebase
your branch to the latest master
?
It is hard to review those files which are already in the master and are not a part of your change
Thanks
pom.xml
Outdated
<relativePath/> | ||
</parent> | ||
|
||
<artifactId>spring-cloud-stream-binder-kinesis-parent</artifactId> | ||
<version>1.1.0.BUILD-SNAPSHOT</version> | ||
<version>1.1.1.BUILD-SNAPSHOT</version> |
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.
Well, that's not. Since it is about a new feature in the project, so we will go a new minor release. Therefore: 1.2.0.BUILD-SNAPSHOT
2e52077
to
45f3494
Compare
Sorry about that, I'm still quite new to git and not very familiar with the rebase (especially on an upstream repo), I hope this push fixes it. |
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's all. nothing critical.
Very close to the merge.
Please, consider to update Copyrights for all the affected classes to the current 2019
year.
|
||
<properties> | ||
<amazon-kinesis-client.version>1.9.3</amazon-kinesis-client.version> | ||
<amazon-kinesis-producer.version>0.12.11</amazon-kinesis-producer.version> |
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.
These must go to the root
pom as a dependencyManagement
, alongside with other managed in this project dependencies. So, this pom won't suffer from missed properties.
@Bean(name = "kclTaskExecutor") | ||
@ConditionalOnMissingBean(name = "kclTaskExecutor") | ||
@ConditionalOnProperty(name = "spring.cloud.stream.kinesis.binder.kpl-kcl-enabled", havingValue = "true") | ||
public TaskExecutor kclTaskExecutor() { |
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 don't think we need this bean.
For this kind of Microservices, based on Spring Cloud Stream, it is fully enough to rely on the internal TaskExecutor
.
So, please, remove.
@@ -44,6 +44,8 @@ | |||
|
|||
private int minShardCount = 1; | |||
|
|||
private boolean kplKclEnabled; |
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.
Please, add short descriptive JavaDoc for this field. With period in the end.
This is going to help tooling and docs to generate helpful metadata.
I understand that all other properties are without that, but this is slightly different story which we definitely should fix too. Eventually...
@@ -121,6 +131,8 @@ public void setAutoCreateStream(boolean autoCreateStream) { | |||
|
|||
private Integer timeToLive; | |||
|
|||
private Long interval = null; |
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.
The same JavaDocs description, please, here.
I don't think we need this = null
...c/main/java/org/springframework/cloud/stream/binder/kinesis/KinesisMessageChannelBinder.java
Show resolved
Hide resolved
Changes done. For the task executor, I had to use a qualifier since there are two |
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.
Review for the next round.
@@ -93,7 +92,7 @@ public KinesisMessageChannelBinder kinesisMessageChannelBinder( | |||
KinesisExtendedBindingProperties kinesisExtendedBindingProperties, | |||
@Autowired(required = false) KinesisProducerConfiguration kinesisProducerConfiguration, | |||
AWSCredentialsProvider awsCredentialsProvider, | |||
@Autowired(required = false) @Qualifier("kclTaskExecutor") TaskExecutor kclTaskExecutor) { | |||
@Autowired(required = false) @Qualifier("taskScheduler") TaskExecutor kclTaskExecutor) { |
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.
No, my point is do not inject any TaskExecutor
at all and just rely on the default one created in the channel adapter.
// @ConditionalOnProperty(name = "spring.cloud.stream.kinesis.binder.kpl-kcl-enabled", havingValue = "true") | ||
// public TaskExecutor kclTaskExecutor() { | ||
// return new SimpleAsyncTaskExecutor(); | ||
// } |
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.
Please, remove this code altogether.
@@ -44,6 +44,9 @@ | |||
|
|||
private int minShardCount = 1; | |||
|
|||
/** Enables the usage of Amazon KCL/KPL libraries for all message consumption and production. */ |
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 is not a JavaDoc.
Please, consider to have one more line in this description:
/** Enables the usage of Amazon KCL/KPL libraries for all message consumption and production. */ | |
/** | |
* Enables the usage of Amazon KCL/KPL libraries for all message consumption and production. | |
*/ |
@@ -121,6 +132,9 @@ public void setAutoCreateStream(boolean autoCreateStream) { | |||
|
|||
private Integer timeToLive; | |||
|
|||
/** Interval between two checkpoints when checkpoint mode is periodic. */ |
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.
DITTO.
Please, see other similar JavaDocs in this class.
Sorry, I misunderstood about the task executor, it should be all fixed now. |
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!
Pulling locally for final review...
Great, thanks for all the help and code reviews. |
This depends on spring-projects/spring-integration-aws#103.
Add support for KCL and KPL kinesis library fixes #65.