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/09/02 17:32:36 UTC

[GitHub] [pulsar] frejonb opened a new issue #11904: Support `KEY_VALUE` schema in the python client

frejonb opened a new issue #11904:
URL: https://github.com/apache/pulsar/issues/11904


   **Is your enhancement request related to a problem? Please describe.**
   It's not possible to serialize/deserialize `Schema.KeyValue` in the python client. In particular the debezium source will return a bytes array.
   
   A quick workaround is to do 
   ```python
   key_size = int.from_bytes(msg[:4], 'big')
   event_key = json.loads(msg[4: key_size + 4])
   value_size = int.from_bytes(msg[key_size + 4: key_size + 8], 'big')
   event_value = json.loads(msg[key_size + 8: value_size + key_size + 8])
   ```
   where `event_key` and `event_value` are the json key and value of the message.
   
   **Describe the solution you'd like**
   It should be possible to define the serialization by importing a `KeyValue` schema from the `schemas` module.
   
   


-- 
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 commented on issue #11904: Support `KEY_VALUE` schema in the python client

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on issue #11904:
URL: https://github.com/apache/pulsar/issues/11904#issuecomment-1058886536


   The issue had no activity for 30 days, mark with Stale label.


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