You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tz...@apache.org on 2020/03/26 04:49:05 UTC

[flink-statefun] branch master updated: [hotfix] Let generic Kafka ingress in k8s example us an utf-8 key

This is an automated email from the ASF dual-hosted git repository.

tzulitai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink-statefun.git


The following commit(s) were added to refs/heads/master by this push:
     new 0caf62e  [hotfix] Let generic Kafka ingress in k8s example us an utf-8 key
0caf62e is described below

commit 0caf62ea2565dedd1409e958b94e8f4c8c328ba9
Author: Igal Shilman <ig...@gmail.com>
AuthorDate: Wed Mar 25 22:23:36 2020 +0100

    [hotfix] Let generic Kafka ingress in k8s example us an utf-8 key
    
    This closes #75.
---
 statefun-examples/statefun-python-k8s/event-generator.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/statefun-examples/statefun-python-k8s/event-generator.py b/statefun-examples/statefun-python-k8s/event-generator.py
index 1df04d0..7d947b4 100644
--- a/statefun-examples/statefun-python-k8s/event-generator.py
+++ b/statefun-examples/statefun-python-k8s/event-generator.py
@@ -41,7 +41,8 @@ def produce(events, address):
     for _ in range(events):
         event = LoginEvent()
         event.user_name = random_user(4)
-        producer.send('logins', event.SerializeToString())
+        key = event.user_name.encode('utf-8')
+        producer.send('logins', key=key, value=event.SerializeToString())
     producer.flush()
     producer.close()