From 439004d9b1036ef69d2c18b28920caf5313e5374 Mon Sep 17 00:00:00 2001 From: "Tobias Burdow [Kaleidox]" Date: Sun, 25 Feb 2024 11:56:30 +0100 Subject: [PATCH] use topic exchanges --- .../java/com/mineaurion/aurionchat/common/ChatService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/com/mineaurion/aurionchat/common/ChatService.java b/common/src/main/java/com/mineaurion/aurionchat/common/ChatService.java index dfd19bd..762f4bb 100644 --- a/common/src/main/java/com/mineaurion/aurionchat/common/ChatService.java +++ b/common/src/main/java/com/mineaurion/aurionchat/common/ChatService.java @@ -69,10 +69,10 @@ public void reCreateConnection() throws IOException { } private void join() throws IOException{ - channel.exchangeDeclare(EXCHANGE_NAME, "fanout"); + channel.exchangeDeclare(EXCHANGE_NAME, "topic"); String queue = channel.queueDeclare().getQueue(); - channel.queueBind(queue, EXCHANGE_NAME, ""); + channel.queueBind(queue, EXCHANGE_NAME, "#"); channel.basicConsume(queue, true, consumer(), consumerTag -> {}); } @@ -106,7 +106,7 @@ public void send(AurionPacket.Builder builder) throws IOException { AurionPacket packet = builder.source(config.getString("server-name", "ingame")).build(); // send - channel.basicPublish(EXCHANGE_NAME, "", null, packet.toString().getBytes()); + channel.basicPublish(EXCHANGE_NAME, packet.getChannel(), null, packet.toString().getBytes()); } public void close(){ try {