Skip to content

Commit 98c9ee1

Browse files
Simon LydellAnnaBohlin97
andauthored
Allow configuring queue type (#26)
Co-authored-by: AnnaBohlin97 <92303703+AnnaBohlin97@users.noreply.github.com>
1 parent 0cc5682 commit 98c9ee1

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/Insurello.RabbitMqClient/MqClient.fs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ module MqClient =
5454
{ Queue: string
5555
BindToExchange: string option
5656
ConsumeCallbacks: Callbacks
57-
MessageTimeToLive: int option }
57+
MessageTimeToLive: int option
58+
QueueType: QueueType }
59+
60+
and QueueType =
61+
| Classic
62+
| Quorum
5863

5964
[<RequireQualifiedAccessAttribute>]
6065
type PublishResult =
@@ -273,9 +278,9 @@ module MqClient =
273278
let arguments =
274279
dict (
275280
[ "x-queue-type",
276-
(match queueTopology.BindToExchange with
277-
| Some _ -> "quorum"
278-
| None -> "classic")
281+
(match queueTopology.QueueType with
282+
| Quorum -> "quorum"
283+
| Classic -> "classic")
279284
:> obj ]
280285
@ (queueTopology.MessageTimeToLive
281286
|> Option.map (fun ttl -> [ ("x-message-ttl", ttl :> obj) ])

0 commit comments

Comments
 (0)