Skip to content

[Issue-9926][Pulsar Functions] Pass through record properties from Pulsar Sources #9943

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

Merged
merged 7 commits into from
Mar 20, 2021

Conversation

david-streamlio
Copy link
Contributor

No description provided.

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add some simple unit test? In order to prevent regressions in the future

if (this.instanceConfig.getFunctionDetails().getComponentType()== ComponentType.SOURCE) {
// Forward record level properties for all sources by default
pulsarSinkConfig.setForwardSourceMessageProperty(true);
} else if (this.instanceConfig.getFunctionDetails().getComponentType() == ComponentType.SINK) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be a simple else ? ( without if)

Copy link
Contributor Author

@david-streamlio david-streamlio Mar 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately it cannot because there are 4 different component type enums:

enum ComponentType {
UNKNOWN = 0;
FUNCTION = 1;
SOURCE = 2;
SINK = 3;
}

Copy link
Contributor Author

@david-streamlio david-streamlio Mar 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A more comprehensive solution would be to add a ForwardSourceMessageProperty to the configuration for ALL component types and use a default value of true for all types. Seems like from a consistency perspective having all the components behave exactly the same w.r.t to forward properties but leave an option for the user to override this behavior as needed would be a good approach from an end-user experience perspective.

Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eolivelli I have replaced the code with a different approach. If you have time can you please review the updated code and mark this issue as resolved or suggest what other changes are required to address you concerns? Thanks in advance!

@david-streamlio
Copy link
Contributor Author

/pulsarbot run-failure-checks

@jerrypeng jerrypeng added area/connector type/bug The PR fixed a bug or issue reported a bug release/2.7.2 labels Mar 18, 2021
@jerrypeng jerrypeng added this to the 2.8.0 milestone Mar 18, 2021
@david-streamlio
Copy link
Contributor Author

/pulsarbot run-failure-checks

@david-streamlio
Copy link
Contributor Author

/pulsarbot run-failure-checks

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@david-streamlio
Copy link
Contributor Author

/pulsarbot run-failure-checks

1 similar comment
@david-streamlio
Copy link
Contributor Author

/pulsarbot run-failure-checks

@jerrypeng jerrypeng merged commit 1273c71 into apache:master Mar 20, 2021
@codelipenghui codelipenghui added the cherry-picked/branch-2.7 Archived: 2.7 is end of life label Mar 24, 2021
codelipenghui pushed a commit that referenced this pull request Mar 24, 2021
…lsar Sources (#9943)

Co-authored-by: David Kjerrumgaard <[email protected]>
(cherry picked from commit 1273c71)
merlimat pushed a commit to merlimat/pulsar that referenced this pull request Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connector cherry-picked/branch-2.7 Archived: 2.7 is end of life release/2.7.2 type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants