]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
Merge pull request #61825 from thuvh/wip-69372-reef
authorYuri Weinstein <yweinste@redhat.com>
Wed, 28 May 2025 21:07:55 +0000 (14:07 -0700)
committerGitHub <noreply@github.com>
Wed, 28 May 2025 21:07:55 +0000 (14:07 -0700)
reef: rgw: allow bucket notification send message to kafka with multiple br…

Reviewed-by: Yuval Lifshitz <ylifshit@redhat.com>
1  2 
doc/radosgw/notifications.rst
src/test/rgw/bucket_notification/test_bn.py

Simple merge
index c09b6e247cd56762204afcb60f16fc058410e78c,a33e47c67da62412314a99f7879da93907f381a8..37a0c24af6a7ddccfb3b1c267714928be95445f6
@@@ -425,13 -425,20 +425,21 @@@ class KafkaReceiver(object)
          if security_type != 'PLAINTEXT':
              security_type = 'SSL'
              port = 9093
+         if kafka_server is None:
+             endpoint = "localhost" + ":" + str(port)
+         elif ":" not in kafka_server:
+             endpoint = kafka_server + ":" + str(port)
+         else:
+             endpoint = kafka_server
          while remaining_retries > 0:
              try:
-                 self.consumer = KafkaConsumer(topic, 
-                         bootstrap_servers = kafka_server+':'+str(port), 
+                 self.consumer = KafkaConsumer(topic,
+                         bootstrap_servers=endpoint,
                          security_protocol=security_type,
 -                        consumer_timeout_ms=16000)
 +                        consumer_timeout_ms=16000,
 +                        auto_offset_reset='earliest')
                  print('Kafka consumer created on topic: '+topic)
                  break
              except Exception as error: