From 8d7e442b3a6998aa7c396b7dab7eb0bc1e232465 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Sat, 20 Feb 2021 18:12:05 +0300 Subject: [PATCH] server: add SubscriberBodyOnly option Signed-off-by: Vasiliy Tolstov --- server/options.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/server/options.go b/server/options.go index ff6b2543..0973a2ce 100644 --- a/server/options.go +++ b/server/options.go @@ -332,6 +332,7 @@ type SubscriberOptions struct { AutoAck bool Queue string Internal bool + BodyOnly bool Context context.Context } @@ -389,6 +390,20 @@ func SubscriberQueue(n string) SubscriberOption { } } +// SubscriberGroup sets the shared group name distributed messages across subscribers +func SubscriberGroup(n string) SubscriberOption { + return func(o *SubscriberOptions) { + o.Queue = n + } +} + +// SubscriberBodyOnly says broker that message contains raw data with absence of micro broker.Message format +func SubscriberBodyOnly(b bool) SubscriberOption { + return func(o *SubscriberOptions) { + o.BodyOnly = b + } +} + // SubscriberContext set context options to allow broker SubscriberOption passed func SubscriberContext(ctx context.Context) SubscriberOption { return func(o *SubscriberOptions) {