-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[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
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.
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) { |
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.
Can this be a simple else
? ( without if
)
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.
Unfortunately it cannot because there are 4 different component type enums:
enum ComponentType {
UNKNOWN = 0;
FUNCTION = 1;
SOURCE = 2;
SINK = 3;
}
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.
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?
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.
@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!
/pulsarbot run-failure-checks |
9a6553a
to
8dab7b4
Compare
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
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
/pulsarbot run-failure-checks |
1 similar comment
/pulsarbot run-failure-checks |
…lsar Sources (#9943) Co-authored-by: David Kjerrumgaard <[email protected]> (cherry picked from commit 1273c71)
…lsar Sources (apache#9943) Co-authored-by: David Kjerrumgaard <[email protected]>
No description provided.