Browse Source

Messaging multi-backend support

Add config options to declare by default
rabbitmq as RPC and Notifications backend.

These options will be used to generate
backend-related configs of oslo messaging
and specify dependency.

Change-Id: Ib110af1b9d4feef9085a46518f629e27e8094611
kbespalov 2 years ago
parent
commit
8be506e3e0
2 changed files with 14 additions and 0 deletions
  1. 8
    0
      exports/oslo_messaging.j2
  2. 6
    0
      service/files/defaults.yaml

+ 8
- 0
exports/oslo_messaging.j2 View File

@@ -0,0 +1,8 @@
1
+{% macro rabbit(cfg_type) -%}
2
+{% if cfg_type == 'rpc_config' -%}
3
+  [DEFAULT]
4
+{%- elif cfg_type == 'notifications_config' -%}
5
+  [oslo_messaging_notifications]
6
+{%- endif %}
7
+transport_url=rabbit://{{ rabbitmq.user }}:{{ rabbitmq.password }}@{{ address('rabbitmq') }}
8
+{%- endmacro %}

+ 6
- 0
service/files/defaults.yaml View File

@@ -1,4 +1,10 @@
1 1
 configs:
2
+  messaging:
3
+    backend:
4
+      rpc: rabbit
5
+      notifications: rabbit
6
+    dependencies:
7
+      rabbit: rabbitmq
2 8
   rabbitmq:
3 9
     port:
4 10
       cont: 5672

Loading…
Cancel
Save