From 164517f286eb8a2c692b5dc04703d257960464da Mon Sep 17 00:00:00 2001 From: Graham Russell Date: Mon, 11 Dec 2023 15:53:20 +0000 Subject: [PATCH] [SDK-3336] - `exchange` Parameter for `AmqpExternalTarget` struct Add the `exchange` parameter to the `AmqpExternalTarget` struct. This has been implemented in the Control API and will be exposed in the Ably Terraform provider. --- rules.go | 4 ++++ rules_test.go | 1 + 2 files changed, 5 insertions(+) diff --git a/rules.go b/rules.go index c17140d..5048339 100644 --- a/rules.go +++ b/rules.go @@ -417,6 +417,10 @@ type AmqpExternalTarget struct { // physical queue. See this Ably knowledge base article for details. // https://knowledge.ably.com/what-is-the-format-of-the-routingkey-for-an-amqp-or-kinesis-reactor-rule RoutingKey string `json:"routingKey,omitempty"` + // The RabbitMQ exchange, if needed supports interpolation; + // see https://faqs.ably.com/what-is-the-format-of-the-routingkey-for-an-amqp-or-kinesis-reactor-rule + // for more info. If you don't use RabbitMQ exchanges, leave this blank. + Exchange string `json:"exchange,omitempty"` // Reject delivery of the message if the route does not exist, otherwise fail silently. MandatoryRoute bool `json:"mandatoryRoute"` // Marks the message as persistent, instructing the broker to write it to disk if it is in a durable queue. diff --git a/rules_test.go b/rules_test.go index 0259016..a1a0e21 100644 --- a/rules_test.go +++ b/rules_test.go @@ -45,6 +45,7 @@ func TestRuleAmqpExtrernal(t *testing.T) { target := &AmqpExternalTarget{ Url: "amqps://test.com", RoutingKey: "key", + Exchange: "exchange", MandatoryRoute: true, PersistentMessages: true, MessageTTL: 50,