mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
Added queue type config for topic, values are classic and quorum
This commit is contained in:
parent
3e6d8db98d
commit
22c843c49c
4 changed files with 14 additions and 2 deletions
|
@ -855,6 +855,12 @@ RabbitMQ topic to publish message.
|
||||||
|
|
||||||
Default:
|
Default:
|
||||||
|
|
||||||
|
#### rabbitmq_topic
|
||||||
|
|
||||||
|
RabbitMQ queue type for the topic.
|
||||||
|
|
||||||
|
Default: classic
|
||||||
|
|
||||||
## Supported Clients
|
## Supported Clients
|
||||||
|
|
||||||
Radicale has been tested with:
|
Radicale has been tested with:
|
||||||
|
|
1
config
1
config
|
@ -126,3 +126,4 @@
|
||||||
#type = none
|
#type = none
|
||||||
#rabbitmq_endpoint =
|
#rabbitmq_endpoint =
|
||||||
#rabbitmq_topic =
|
#rabbitmq_topic =
|
||||||
|
#rabbitmq_queue_type = classic
|
|
@ -223,6 +223,10 @@ DEFAULT_CONFIG_SCHEMA: types.CONFIG_SCHEMA = OrderedDict([
|
||||||
("rabbitmq_topic", {
|
("rabbitmq_topic", {
|
||||||
"value": "",
|
"value": "",
|
||||||
"help": "topic to declare queue",
|
"help": "topic to declare queue",
|
||||||
|
"type": str}),
|
||||||
|
("rabbitmq_queue_type", {
|
||||||
|
"value": "",
|
||||||
|
"help": "queue type for topic declaration",
|
||||||
"type": str})])),
|
"type": str})])),
|
||||||
("web", OrderedDict([
|
("web", OrderedDict([
|
||||||
("type", {
|
("type", {
|
||||||
|
|
|
@ -12,6 +12,7 @@ class Hook(hook.BaseHook):
|
||||||
super().__init__(configuration)
|
super().__init__(configuration)
|
||||||
self._endpoint = configuration.get("hook", "rabbitmq_endpoint")
|
self._endpoint = configuration.get("hook", "rabbitmq_endpoint")
|
||||||
self._topic = configuration.get("hook", "rabbitmq_topic")
|
self._topic = configuration.get("hook", "rabbitmq_topic")
|
||||||
|
self._queue_type = configuration.get("hook", "rabbitmq_queue_type")
|
||||||
self._encoding = configuration.get("encoding", "stock")
|
self._encoding = configuration.get("encoding", "stock")
|
||||||
|
|
||||||
self._make_connection_synced()
|
self._make_connection_synced()
|
||||||
|
@ -23,7 +24,7 @@ class Hook(hook.BaseHook):
|
||||||
self._channel = connection.channel()
|
self._channel = connection.channel()
|
||||||
|
|
||||||
def _make_declare_queue_synced(self):
|
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):
|
def notify(self, notification_item):
|
||||||
if isinstance(notification_item, HookNotificationItem):
|
if isinstance(notification_item, HookNotificationItem):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue