Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore: πŸ› Issue with Detecting Push Notification Events #205

Merged
merged 6 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class FcmNotificationEventHandler implements NotificationEventHandler {
@Override
@TransactionalEventListener
public void handleEvent(NotificationEvent event) {
log.debug("handleEvent: {}", event);
log.info("handleEvent: {}", event);
ApiFuture<?> response = fcmManager.sendMessage(event);

if (response == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
@Configuration
@EnablePennywayInfraConfig({
PennywayInfraConfigGroup.MESSAGE_BROKER_CONFIG,
PennywayInfraConfigGroup.GUID_GENERATOR_CONFIG
PennywayInfraConfigGroup.GUID_GENERATOR_CONFIG,
PennywayInfraConfigGroup.FCM
})
public class InfraConfig {
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package kr.co.pennyway.socket.relay;

import kr.co.pennyway.domain.common.redis.message.type.MessageCategoryType;
import kr.co.pennyway.socket.dto.ChatMessageDto;
import kr.co.pennyway.socket.service.ChatMessageRelayService;
import lombok.RequiredArgsConstructor;
Expand All @@ -23,12 +24,15 @@ public class ChatMessageRelayEventListener {
exchange = @Exchange(value = "${pennyway.rabbitmq.chat.exchange}", type = "topic"),
key = "${pennyway.rabbitmq.chat.routing-key}"
),
exclusive = true,
concurrency = "1"
)
public void handleSendEvent(ChatMessageDto.Response event) {
log.info("ChatMessageSendEventListener.handleSendEvent: {}", event);

if (MessageCategoryType.SYSTEM.equals(event.categoryType())) {
return;
}

chatMessageRelayService.execute(event.senderId(), event.chatRoomId(), event.content());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ public class ChatMessageRelayService {
* @param content String μ±„νŒ… λ‚΄μš©
* @apiNote push notification 전솑 μ‹€νŒ¨μ— λŒ€ν•œ μž¬μ‹œλ„λ₯Ό μˆ˜ν–‰ν•˜κ³  μžˆμ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
*/
@Transactional(readOnly = true)
public void execute(Long senderId, Long chatRoomId, String content) {
ChatPushNotificationContext context = executeInTransaction(() -> chatNotificationCoordinatorService.determineRecipients(senderId, chatRoomId));
log.info("μ±„νŒ… λ©”μ‹œμ§€ μ•Œλ¦Ό 전솑 μ»¨ν…μŠ€νŠΈ: {}", context);

NotificationEvent notificationEvent = NotificationEvent.of(
context.senderName(),
Expand Down
Loading