Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

r1m
Copy link

@r1m r1m commented Jan 3, 2019

This depends on spring-projects/spring-integration-aws#103.

Add support for KCL and KPL kinesis library fixes #65.

Copy link
Contributor

@artembilan artembilan left a 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

@artembilan
Copy link
Contributor

@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

@javarno
Copy link
Contributor

javarno commented Mar 15, 2019

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
Copy link

codecov bot commented Mar 15, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@194297e). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #75   +/-   ##
=========================================
  Coverage          ?   24.73%           
  Complexity        ?       22           
=========================================
  Files             ?       10           
  Lines             ?      473           
  Branches          ?       36           
=========================================
  Hits              ?      117           
  Misses            ?      345           
  Partials          ?       11
Impacted Files Coverage Δ Complexity Δ
...der/kinesis/config/KinesisBinderConfiguration.java 0% <0%> (ø) 0 <0> (?)
...am/binder/kinesis/KinesisMessageChannelBinder.java 0% <0%> (ø) 0 <0> (?)
...operties/KinesisBinderConfigurationProperties.java 35.41% <0%> (ø) 7 <0> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 194297e...5f06ddf. Read the comment docs.

@javarno
Copy link
Contributor

javarno commented Mar 15, 2019

I think I covered all the requested changes, it would be nice to have your feedback on this.

Copy link
Contributor

@artembilan artembilan left a 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>
Copy link
Contributor

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

@javarno javarno force-pushed the feature/kpl-0.12.11-kcl-2.0.5 branch from 2e52077 to 45f3494 Compare March 15, 2019 18:12
@javarno
Copy link
Contributor

javarno commented Mar 15, 2019

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.

Copy link
Contributor

@artembilan artembilan left a 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>
Copy link
Contributor

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() {
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

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

@javarno
Copy link
Contributor

javarno commented Mar 18, 2019

Changes done. For the task executor, I had to use a qualifier since there are two TaskExecutor beans available, I hope I chose the right one.

Copy link
Contributor

@artembilan artembilan left a 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) {
Copy link
Contributor

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();
// }
Copy link
Contributor

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. */
Copy link
Contributor

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:

Suggested change
/** 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. */
Copy link
Contributor

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.

@javarno
Copy link
Contributor

javarno commented Mar 19, 2019

Sorry, I misunderstood about the task executor, it should be all fixed now.

Copy link
Contributor

@artembilan artembilan left a 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...

@artembilan
Copy link
Contributor

Merged as 2843ded

@javarno ,

Thank you very much for the contribution; looking forward for more!

@javarno
Copy link
Contributor

javarno commented Mar 19, 2019

Great, thanks for all the help and code reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PutRecord bytes sum very low
4 participants