OWL ITS + 탐지시스템(인터넷 진흥원)
이민희
2022-01-13 ebfd37816a332308519b30af5bfb017c5052be69
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package kr.wisestone.owl.config.websocket;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.data.redis.listener.ChannelTopic;
 
import java.util.Map;
 
@Service
public class RedisPublisher {
 
    @Autowired
    private RedisTemplate redisTemplate;
 
    public void publish(ChannelTopic channelTopic, Map<String, Object> message) {
        this.redisTemplate.convertAndSend(channelTopic.getTopic(), message);
    }
}