diff --git a/src/main/java/com/modoospace/alarm/consumer/AlarmConsumer.java b/src/main/java/com/modoospace/alarm/consumer/AlarmConsumer.java index 86b45f9..acf6f1a 100644 --- a/src/main/java/com/modoospace/alarm/consumer/AlarmConsumer.java +++ b/src/main/java/com/modoospace/alarm/consumer/AlarmConsumer.java @@ -18,7 +18,7 @@ public class AlarmConsumer { private final AlarmService alarmService; private final ObjectMapper objectMapper; - @RabbitListener(queues = "q.reservation") + @RabbitListener(queues = "q.alarm.work") public void handler(String message) { log.info("AlarmEvent consume from q.reservation"); try { diff --git a/src/main/java/com/modoospace/alarm/consumer/AlarmDLQConsumer.java b/src/main/java/com/modoospace/alarm/consumer/AlarmDLQConsumer.java index ecd9cbb..ce2a2a3 100644 --- a/src/main/java/com/modoospace/alarm/consumer/AlarmDLQConsumer.java +++ b/src/main/java/com/modoospace/alarm/consumer/AlarmDLQConsumer.java @@ -20,7 +20,7 @@ public class AlarmDLQConsumer { @Value("${spring.rabbitmq.retry_count}") private int retryCount; - @RabbitListener(queues = "q.reservation.dlx") + @RabbitListener(queues = "q.alarm.dead") public void processFailedMessagesRequeue(Message failedMessage) { Integer retriesCnt = (Integer) failedMessage.getMessageProperties().getHeaders() .get(RETRY_COUNT_HEADER); diff --git a/src/main/java/com/modoospace/alarm/producer/AlarmProducer.java b/src/main/java/com/modoospace/alarm/producer/AlarmProducer.java index fd44ab9..646953b 100644 --- a/src/main/java/com/modoospace/alarm/producer/AlarmProducer.java +++ b/src/main/java/com/modoospace/alarm/producer/AlarmProducer.java @@ -21,7 +21,7 @@ public void send(AlarmEvent alarmEvent) { try { log.info("AlarmEvent produce to x.reservation"); String message = objectMapper.writeValueAsString(alarmEvent); - rabbitTemplate.convertAndSend("x.reservation", "", message); + rabbitTemplate.convertAndSend("x.alarm.work", "", message); } catch (JsonProcessingException e) { throw new MessageParsingError(); } diff --git a/src/test/java/com/modoospace/RabbitMQTestInitializer.java b/src/test/java/com/modoospace/RabbitMQTestInitializer.java index 650fe99..bb93502 100644 --- a/src/test/java/com/modoospace/RabbitMQTestInitializer.java +++ b/src/test/java/com/modoospace/RabbitMQTestInitializer.java @@ -27,15 +27,15 @@ static void initializeRabbitMQ(RabbitMQContainer container) { } static void createExchangeAndQueue(Channel channel) throws IOException { - channel.exchangeDeclare("x.reservation", BuiltinExchangeType.FANOUT); - channel.exchangeDeclare("x.reservation.dlx", BuiltinExchangeType.FANOUT); + channel.exchangeDeclare("x.alarm.work", BuiltinExchangeType.FANOUT); + channel.exchangeDeclare("x.alarm.dead", BuiltinExchangeType.FANOUT); HashMap argumentsMap = new HashMap<>(); - argumentsMap.put("x-dead-letter-exchange", "x.reservation.dlx"); - channel.queueDeclare("q.reservation", false, false, false, argumentsMap); - channel.queueBind("q.reservation", "x.reservation", ""); + argumentsMap.put("x-dead-letter-exchange", "x.alarm.dead"); + channel.queueDeclare("q.alarm.work", false, false, false, argumentsMap); + channel.queueBind("q.alarm.work", "x.alarm.work", ""); - channel.queueDeclare("q.reservation.dlx", false, false, false, null); - channel.queueBind("q.reservation.dlx", "x.reservation.dlx", ""); + channel.queueDeclare("q.alarm.dead", false, false, false, null); + channel.queueBind("q.alarm.dead", "x.alarm.dead", ""); } }