Skip to content

Commit

Permalink
use topic exchanges
Browse files Browse the repository at this point in the history
  • Loading branch information
burdoto committed Feb 25, 2024
1 parent 9747cea commit 439004d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 -> {});
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 439004d

Please sign in to comment.