Skip to content

Commit

Permalink
Google Java Format
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Mar 11, 2024
1 parent d05d4fe commit f7066a0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.twtw.backend.global.constant.RabbitMQConstant;
import com.twtw.backend.global.properties.RabbitMQProperties;

import lombok.RequiredArgsConstructor;

import org.springframework.amqp.core.*;
import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
Expand All @@ -25,8 +27,11 @@ public class RabbitMQConfig {
@Bean
public Queue locationQueue() {
return QueueBuilder.durable(RabbitMQConstant.LOCATION_QUEUE.getName())
.withArgument("x-dead-letter-exchange", RabbitMQConstant.DEAD_LETTER_EXCHANGE.getName())
.withArgument("x-dead-letter-routing-key", RabbitMQConstant.DEAD_LETTER_ROUTING_KEY.getName())
.withArgument(
"x-dead-letter-exchange", RabbitMQConstant.DEAD_LETTER_EXCHANGE.getName())
.withArgument(
"x-dead-letter-routing-key",
RabbitMQConstant.DEAD_LETTER_ROUTING_KEY.getName())
.build();
}

Expand All @@ -45,8 +50,11 @@ public Binding locationBinding() {
@Bean
public Queue notificationQueue() {
return QueueBuilder.durable(RabbitMQConstant.NOTIFICATION_QUEUE.getName())
.withArgument("x-dead-letter-exchange", RabbitMQConstant.DEAD_LETTER_EXCHANGE.getName())
.withArgument("x-dead-letter-routing-key", RabbitMQConstant.DEAD_LETTER_ROUTING_KEY.getName())
.withArgument(
"x-dead-letter-exchange", RabbitMQConstant.DEAD_LETTER_EXCHANGE.getName())
.withArgument(
"x-dead-letter-routing-key",
RabbitMQConstant.DEAD_LETTER_ROUTING_KEY.getName())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.twtw.backend.domain.deadletter;

import lombok.extern.slf4j.Slf4j;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
Expand All @@ -21,7 +22,8 @@ public DeadLetterConsumer(@Value("${slack.url}") final String slackUrl) {
@RabbitListener(queues = "deadletter.queue")
public void handleDeadLetterMessage(final String message) {
log.error("Dead letter received: {}", message);
webClient.post()
webClient
.post()
.uri(slackUrl)
.bodyValue("{\"text\": \"Dead letter received: " + message + "\"}")
.retrieve()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public FcmConsumer(FirebaseMessaging firebaseMessaging) {
}

@RabbitListener(queues = "notification.queue")
public void sendNotification(final NotificationRequest request) throws FirebaseMessagingException {
public void sendNotification(final NotificationRequest request)
throws FirebaseMessagingException {
firebaseMessaging.send(request.toMessage());
}
}

0 comments on commit f7066a0

Please sign in to comment.