Skip to content

Commit d0b84db

Browse files
lmarinibodom0015
andauthored
Removed queue from EventSinkService.
Co-authored-by: Mike Lambert <[email protected]>
1 parent 7d2dd28 commit d0b84db

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/services/rabbitmq/RabbitMQMessageService.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,12 @@ class RabbitMQMessageService extends MessageService {
233233
// This probably isn't going to extract queue (use other submit() for that) so make a new broker
234234
val tempChannel = connection.get.createChannel()
235235
tempChannel.exchangeDeclare(exchange, exchange_type, true)
236+
237+
// If a routing_key (queue name) was provided, ensure that the queue exists
238+
if (routing_key != "") {
239+
tempChannel.queueDeclare(routing_key, true, false, false, null)
240+
tempChannel.queueBind(routing_key, exchange, routing_key)
241+
}
236242
tempChannel.basicPublish(exchange, routing_key, null, message.toString.getBytes)
237243
}
238244

0 commit comments

Comments
 (0)