From 513b5de7d520d30b2c89f4ebd5e2f58a1bceb729 Mon Sep 17 00:00:00 2001 From: Michal Kuratczyk Date: Mon, 9 Dec 2024 10:27:11 +0100 Subject: [PATCH] Remove --amqp-send-settled It was introduced to allow fast publishing when there was no async publish. SendWithRecepit doesn't allow sending settled messages, so let's just remove this option altogether. If needed, we can add it back and use Send() when it's used --- cmd/root.go | 2 -- pkg/amqp10/publisher.go | 6 ------ pkg/config/config.go | 1 - 3 files changed, 9 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 741073f..bf24d4a 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -94,8 +94,6 @@ func RootCmd() *cobra.Command { "AMQP application properties, eg. key1=val1,val2") amqpPublisherFlags.StringSliceVar(&cfg.Amqp.Subjects, "amqp-subject", []string{}, "AMQP 1.0 message subject(s)") - amqpPublisherFlags.BoolVar(&cfg.Amqp.SendSettled, "amqp-send-settled", false, - "Send settled messages (fire and forget)") amqpConsumerFlags := pflag.NewFlagSet("amqp-consumer", pflag.ContinueOnError) diff --git a/pkg/amqp10/publisher.go b/pkg/amqp10/publisher.go index e8db8f5..4e45c08 100644 --- a/pkg/amqp10/publisher.go +++ b/pkg/amqp10/publisher.go @@ -125,14 +125,8 @@ func (p *Amqp10Publisher) CreateSender() { durability = amqp.DurabilityUnsettledState } - settleMode := amqp.SenderSettleModeUnsettled.Ptr() - if p.Config.Amqp.SendSettled { - settleMode = amqp.SenderSettleModeSettled.Ptr() - } - for p.Sender == nil { sender, err := p.Session.NewSender(context.TODO(), p.Terminus, &amqp.SenderOptions{ - SettlementMode: settleMode, TargetDurability: durability, }) if err != nil { diff --git a/pkg/config/config.go b/pkg/config/config.go index 2e8c82e..4768883 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -47,7 +47,6 @@ var QueueTypes = map[QueueType][]string{ type AmqpOptions struct { Subjects []string - SendSettled bool ReleaseRate int RejectRate int PropertyFilters map[string]string