dominikriemer commented on code in PR #3041:
URL: https://github.com/apache/streampipes/pull/3041#discussion_r1680703407


##########
streampipes-client-python/streampipes/functions/utils/data_stream_generator.py:
##########
@@ -104,8 +104,15 @@ def create_data_stream(
             )
         ]
 
+    # Assign a default topic name incorporating the unique stream ID to each 
protocol.
+    # This ensures the topic name remains consistent across function restarts, 
avoiding reliance on client-side defaults.
+    for protocol in transport_protocols:
+        protocol.topic_definition.actual_topic_name = 
f"org.apache.streampipes.connect.{stream_id}"
+
     data_stream = DataStream(
-        name=name, event_schema=event_schema, 
event_grounding=EventGrounding(transport_protocols=transport_protocols)
+        name=name,
+        event_schema=event_schema,
+        event_grounding=EventGrounding(transport_protocols=transport_protocols)
     )
     if stream_id:

Review Comment:
   Can the if clause be removed so that the element_id is always overriden?



##########
streampipes-client-python/streampipes/functions/utils/data_stream_generator.py:
##########
@@ -104,8 +104,15 @@ def create_data_stream(
             )
         ]
 
+    # Assign a default topic name incorporating the unique stream ID to each 
protocol.
+    # This ensures the topic name remains consistent across function restarts, 
avoiding reliance on client-side defaults.
+    for protocol in transport_protocols:
+        protocol.topic_definition.actual_topic_name = 
f"org.apache.streampipes.connect.{stream_id}"

Review Comment:
   Do we need to sanitized the stream_id (e.g., removing whitespaces)?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to