chat fini

This commit is contained in:
Rochas
2025-04-21 17:58:51 +02:00
parent 53aec7802c
commit cb5719232c
7 changed files with 197 additions and 43 deletions

View File

@@ -5,6 +5,7 @@ import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.DeliverCallback;
public class RecevoirDate {
private static final String EXCHANGE_NAME = "direct_logs";
@@ -13,8 +14,8 @@ public class RecevoirDate {
factory.setUri("amqps://cyvthtfj:O8LmaXkX5mVB0oFZN9TobaK8rX9wEhol@whale.rmq.cloudamqp.com/cyvthtfj");
Connection connection = factory.newConnection();
Channel channel = connection.createChannel();
channel.exchangeDeclare(EXCHANGE_NAME, "direct");
String queueName = channel.queueDeclare().getQueue();
//la clé: locale
channel.queueBind(queueName, EXCHANGE_NAME, "locale");