Skip to content

add passSourceMessageProperty switch to pulsar functions#6318

Merged
sijie merged 2 commits intoapache:masterfrom
streamnative:neng/function-pass-message-property-switch
Feb 13, 2020
Merged

add passSourceMessageProperty switch to pulsar functions#6318
sijie merged 2 commits intoapache:masterfrom
streamnative:neng/function-pass-message-property-switch

Conversation

@nlu90
Copy link
Member

@nlu90 nlu90 commented Feb 12, 2020

Fixes #5116

Motivation

Based on the request in #5116, adding this flag can help reduce ambiguity and increase flexibility. By default, the function passes source message properties.

Modifications

  • add flags in pulsar admin client tools
  • update functions proto and functionConfig to contain the flag
  • update the pulsar sink to pass source message property if the flag is set

Verifying this change

  • Make sure that the change passes the CI checks.

This change is already covered by existing tests, such as pulsar-functions, pulsar-client-tools.

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): no
  • The public API: no
  • The schema: no
  • The default values of configurations: no
  • The wire protocol: no
  • The rest endpoints: no
  • The admin cli options: yes
  • Anything that affects deployment: no

Documentation

  • Does this pull request introduce a new feature? no

@sijie sijie added this to the 2.6.0 milestone Feb 12, 2020
@sijie sijie requested review from jiazhai and srkukarni February 12, 2020 22:22
@sijie sijie merged commit bce14ed into apache:master Feb 13, 2020
@sijie sijie deleted the neng/function-pass-message-property-switch branch February 13, 2020 21:33
codelipenghui added a commit that referenced this pull request Mar 26, 2020
### Motivation

There are some tests that failed in the master branch related to functions. For example https://github.com/apache/pulsar/blob/master/pulsar-broker/src/test/java/org/apache/pulsar/functions/worker/PulsarFunctionE2ESecurityTest.java#L630, the test checks the properties of the message are forwarded, but we don't call `functionConfig.setForwardSourceMessageProperty(true)`, the reason is #6318 introduce `forwardSourceMessageProperty ` to enable or disable message properties forward in functions. But the default value is false, this will break previous behavior. So this PR set it to true to keep forward compatible.

And getApiException method (https://github.com/apache/pulsar/blob/master/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/BaseResource.java#L235) is very confusing, this will cause the async function admin method that #6580 introduced can't complete when met exceptions. 

BTW,  I have no idea why #6318 and #6580 can pass the CI check. This test is there long ago.
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Aug 24, 2020
Fixes apache#5116 

### Motivation
Based on the request in apache#5116, adding this flag can help reduce ambiguity and increase flexibility. By default, the function passes source message properties.

### Modifications
- add flags in pulsar admin client tools
- update functions proto and functionConfig to contain the flag
- update the pulsar sink to pass source message property if the flag is set
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Aug 24, 2020
### Motivation

There are some tests that failed in the master branch related to functions. For example https://github.com/apache/pulsar/blob/master/pulsar-broker/src/test/java/org/apache/pulsar/functions/worker/PulsarFunctionE2ESecurityTest.java#L630, the test checks the properties of the message are forwarded, but we don't call `functionConfig.setForwardSourceMessageProperty(true)`, the reason is apache#6318 introduce `forwardSourceMessageProperty ` to enable or disable message properties forward in functions. But the default value is false, this will break previous behavior. So this PR set it to true to keep forward compatible.

And getApiException method (https://github.com/apache/pulsar/blob/master/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/BaseResource.java#L235) is very confusing, this will cause the async function admin method that apache#6580 introduced can't complete when met exceptions. 

BTW,  I have no idea why apache#6318 and apache#6580 can pass the CI check. This test is there long ago.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide a flag for message properties pass through in functions

2 participants