// Path: rock-paper-scissors-lizard-spock/src/main/java/be/ordina/jworks/rpsls/game/websocket/ChatMessage.java
// @Getter
// @Builder
// @AllArgsConstructor
// public class ChatMessage implements Serializable {
// 
//     private String message;
//     private String username;
// 
// }


import be.ordina.jworks.rpsls.game.websocket.ChatMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.listener.Topic;
import org.springframework.stereotype.Service;
package be.ordina.jworks.rpsls.game.pubsub;


@Slf4j
@Service
public class ChatEventPublisher {

    private final RedisTemplate<String, Object> messageRedisTemplate;
    private final Topic topic;

    @Autowired
    public ChatEventPublisher(final RedisTemplate<String, Object> messageRedisTemplate, @Qualifier("chatTopic") final Topic topic) {
        this.messageRedisTemplate = messageRedisTemplate;
        this.topic = topic;
    }

// Path: rock-paper-scissors-lizard-spock/src/main/java/be/ordina/jworks/rpsls/game/websocket/ChatMessage.java
// @Getter
// @Builder
// @AllArgsConstructor
// public class ChatMessage implements Serializable {
// 
//     private String message;
//     private String username;
// 
// }


// Path: rock-paper-scissors-lizard-spock/src/main/java/be/ordina/jworks/rpsls/game/pubsub/ChatEventPublisher.java
import be.ordina.jworks.rpsls.game.websocket.ChatMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.listener.Topic;
import org.springframework.stereotype.Service;

package be.ordina.jworks.rpsls.game.pubsub;


@Slf4j
@Service
public class ChatEventPublisher {

    private final RedisTemplate<String, Object> messageRedisTemplate;
    private final Topic topic;

    @Autowired
    public ChatEventPublisher(final RedisTemplate<String, Object> messageRedisTemplate, @Qualifier("chatTopic") final Topic topic) {
        this.messageRedisTemplate = messageRedisTemplate;
        this.topic = topic;
    }

    public void publish(final ChatMessage chatMessage) {