File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/main/java/com/somemore/notification/subscriber Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 11package com .somemore .notification .subscriber ;
22
3+ import com .somemore .notification .converter .MessageConverter ;
4+ import com .somemore .notification .domain .Notification ;
35import com .somemore .notification .handler .NotificationHandler ;
46import lombok .RequiredArgsConstructor ;
57import org .springframework .data .redis .connection .Message ;
1113public class RedisNotificationSubscriber implements MessageListener {
1214
1315 private final NotificationHandler notificationHandler ;
16+ private final MessageConverter messageConverter ;
1417
1518 @ Override
1619 public void onMessage (Message message , byte [] pattern ) {
17- String data = new String (message .getBody ());
20+ Notification notification = messageConverter .ToNotification (
21+ new String (message .getBody ())
22+ );
1823
19- notificationHandler .handle (data );
24+ notificationHandler .handle (notification );
2025 }
2126}
You can’t perform that action at this time.
0 commit comments