salimma / rpms / ceph

Forked from rpms/ceph a year ago
Clone
fc46f52
From 178f6bdac97b57300bbe0956633cf686a7e3ccee Mon Sep 17 00:00:00 2001
fc46f52
From: Yuval Lifshitz <ylifshit@redhat.com>
fc46f52
Date: Fri, 12 Mar 2021 08:56:45 +0200
fc46f52
Subject: [PATCH] librgw/notifications: initialize kafka and amqp
fc46f52
fc46f52
Fixes: https://tracker.ceph.com/issues/49738
fc46f52
fc46f52
Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
fc46f52
---
fc46f52
 src/rgw/librgw.cc | 23 +++++++++++++++++++++++
fc46f52
 1 file changed, 23 insertions(+)
fc46f52
fc46f52
diff --git a/src/rgw/librgw.cc b/src/rgw/librgw.cc
fc46f52
index 012cc54c3b..a5351dbe7c 100644
fc46f52
--- a/src/rgw/librgw.cc
fc46f52
+++ b/src/rgw/librgw.cc
fc46f52
@@ -53,6 +53,12 @@
fc46f52
 #include "rgw_http_client.h"
fc46f52
 #include "rgw_http_client_curl.h"
fc46f52
 #include "rgw_perf_counters.h"
fc46f52
+#ifdef WITH_RADOSGW_AMQP_ENDPOINT
fc46f52
+#include "rgw_amqp.h"
fc46f52
+#endif
fc46f52
+#ifdef WITH_RADOSGW_KAFKA_ENDPOINT
fc46f52
+#include "rgw_kafka.h"
fc46f52
+#endif
fc46f52
 
fc46f52
 #include "services/svc_zone.h"
fc46f52
 
fc46f52
@@ -617,6 +623,17 @@ namespace rgw {
fc46f52
       /* ignore error */
fc46f52
     }
fc46f52
 
fc46f52
+#ifdef WITH_RADOSGW_AMQP_ENDPOINT
fc46f52
+    if (!rgw::amqp::init(cct.get())) {
fc46f52
+      derr << "ERROR: failed to initialize AMQP manager" << dendl;
fc46f52
+    }
fc46f52
+#endif
fc46f52
+#ifdef WITH_RADOSGW_KAFKA_ENDPOINT
fc46f52
+    if (!rgw::kafka::init(cct.get())) {
fc46f52
+      derr << "ERROR: failed to initialize Kafka manager" << dendl;
fc46f52
+    }
fc46f52
+#endif
fc46f52
+
fc46f52
     return 0;
fc46f52
   } /* RGWLib::init() */
fc46f52
 
fc46f52
@@ -645,6 +662,12 @@ namespace rgw {
fc46f52
     rgw_shutdown_resolver();
fc46f52
     rgw_http_client_cleanup();
fc46f52
     rgw::curl::cleanup_curl();
fc46f52
+#ifdef WITH_RADOSGW_AMQP_ENDPOINT
fc46f52
+    rgw::amqp::shutdown();
fc46f52
+#endif
fc46f52
+#ifdef WITH_RADOSGW_KAFKA_ENDPOINT
fc46f52
+    rgw::kafka::shutdown();
fc46f52
+#endif
fc46f52
 
fc46f52
     rgw_perf_stop(g_ceph_context);
fc46f52
 
fc46f52
-- 
fc46f52
2.26.2
fc46f52