It's impossible to send durable messages with AMQP Sink
vasily-kirichenko opened this issue · comments
Vasily Kirichenko commented
To make messages persistent it's necessary to do two things: make the queue durable and set DeliveryMode = 2
for each message. The former is simple:
let queueDeclaration = QueueDeclaration.Create(queueName).WithDurable(true)`
But the latter is impossible with the current implementation:
Source
.From(seq { 1..1_000 })
.Select(fun x -> x |> string |> ByteString.FromString) // no way to set basic properties
.To(sink)
.Run(mat)
|> ignore
Sample is here https://github.com/vasily-kirichenko/AmqpStreams/blob/master/AmqpStreams1/Program.fs
Val Miscenko commented
you have to use AmqpSink.create(...) and then set for example:
new OutgoingMessage(elem,false,false,
Optional.of(new AMQP.BasicProperties.Builder()
.deliveryMode(2).build()),
Optional.empty()))
this will create persistent message in rabbit
Vasily Kirichenko commented
Yes, thanks.