From 4edcc6bc604a8f60aa430fc69d5c7021c208b0de Mon Sep 17 00:00:00 2001 From: quexer Date: Sun, 22 Oct 2023 09:35:49 +0800 Subject: [PATCH] feat: add ServerDurableQueue, providing durable queue option for micro.RegisterSubscriber --- v4/broker/rabbitmq/options.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/v4/broker/rabbitmq/options.go b/v4/broker/rabbitmq/options.go index 4a31846e..0044c201 100644 --- a/v4/broker/rabbitmq/options.go +++ b/v4/broker/rabbitmq/options.go @@ -5,6 +5,7 @@ import ( "time" "go-micro.dev/v4/broker" + "go-micro.dev/v4/server" ) type durableQueueKey struct{} @@ -32,6 +33,11 @@ type appID struct{} type externalAuth struct{} type durableExchange struct{} +// ServerDurableQueue provide durable queue option for micro.RegisterSubscriber +func ServerDurableQueue() server.SubscriberOption { + return setServerSubscriberOption(durableQueueKey{}, true) +} + // DurableQueue creates a durable queue when subscribing. func DurableQueue() broker.SubscribeOption { return setSubscribeOption(durableQueueKey{}, true)