diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 1242a915..cd4fc742 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -855,6 +855,12 @@ RabbitMQ topic to publish message. Default: +#### rabbitmq_topic + +RabbitMQ queue type for the topic. + +Default: classic + ## Supported Clients Radicale has been tested with: diff --git a/config b/config index a54026fc..cfd7412e 100644 --- a/config +++ b/config @@ -125,4 +125,5 @@ # Value: none | rabbitmq #type = none #rabbitmq_endpoint = -#rabbitmq_topic = \ No newline at end of file +#rabbitmq_topic = +#rabbitmq_queue_type = classic \ No newline at end of file diff --git a/radicale/config.py b/radicale/config.py index 63378efa..b5f45086 100644 --- a/radicale/config.py +++ b/radicale/config.py @@ -223,6 +223,10 @@ DEFAULT_CONFIG_SCHEMA: types.CONFIG_SCHEMA = OrderedDict([ ("rabbitmq_topic", { "value": "", "help": "topic to declare queue", + "type": str}), + ("rabbitmq_queue_type", { + "value": "", + "help": "queue type for topic declaration", "type": str})])), ("web", OrderedDict([ ("type", { diff --git a/radicale/hook/rabbitmq/__init__.py b/radicale/hook/rabbitmq/__init__.py index 638ca522..2323ed43 100644 --- a/radicale/hook/rabbitmq/__init__.py +++ b/radicale/hook/rabbitmq/__init__.py @@ -12,6 +12,7 @@ class Hook(hook.BaseHook): super().__init__(configuration) self._endpoint = configuration.get("hook", "rabbitmq_endpoint") self._topic = configuration.get("hook", "rabbitmq_topic") + self._queue_type = configuration.get("hook", "rabbitmq_queue_type") self._encoding = configuration.get("encoding", "stock") self._make_connection_synced() @@ -23,7 +24,7 @@ class Hook(hook.BaseHook): self._channel = connection.channel() def _make_declare_queue_synced(self): - self._channel.queue_declare(queue=self._topic, durable=True) + self._channel.queue_declare(queue=self._topic, durable=True, arguments={"x-queue-type": self._queue_type}) def notify(self, notification_item): if isinstance(notification_item, HookNotificationItem):