You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/08/06 00:56:24 UTC

[GitHub] [pulsar] brightsparc opened a new issue #11577: Function Context methods `get_output_topic` and `get_output_serde_class_name` not resolving to `sink`

brightsparc opened a new issue #11577:
URL: https://github.com/apache/pulsar/issues/11577


   **Describe the bug**
   As per the [functions development](https://pulsar.apache.org/docs/en/2.4.1/functions-develop/) documentation, the methods
   * `get_output_topic()`
   * `get_output_serde_class_name()`
    are not resolving to the correct`self.instance_config.function_details.sink` object so are returning `None`:
   
   see: https://github.com/apache/pulsar/blob/master/pulsar-functions/instance/src/main/python/contextimpl.py#L141
   
   **To Reproduce**
   1. Create a function:
   ```
   bin/pulsar-admin functions create \
     --tenant public \
     --namespace default \
     --name my_function \
     --py my_function.py \
     --classname my_function.MyFunction \
     --custom-serde-inputs '{"input-topic-1":"Serde1","input-topic-2":"Serde2"}' \
     --output-serde-classname Serde3 \
     --output output-topic-1
   ```
   
   2. Attempt to access these properties within the function process:
   ```
   topic_name = context.get_output_topic()
   serde_class_name = context.get_output_serde_class_name()
   ```
   **Expected behavior**
   Should return `Serde3` and `output-topic-1` respectively - but are returning None.
   
   **Desktop (please complete the following information):**
    - OS: macOS


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui closed issue #11577: Function Context methods `get_output_topic` and `get_output_serde_class_name` not resolving to `sink`

Posted by GitBox <gi...@apache.org>.
codelipenghui closed issue #11577:
URL: https://github.com/apache/pulsar/issues/11577


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org