package com.lideeyunji.tool.framework.websocket.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * WebSocket 配置项
 *
 * @author xingyu4j
 */
@ConfigurationProperties("lideeyunji.websocket")
@Data
@Validated
public class WebSocketProperties {

    /**
     * WebSocket 的连接路径
     */
    @NotEmpty(message = "WebSocket 的连接路径不能为空")
    private String path = "/ws";

    /**
     * 消息发送器的类型
     *
     * 可选值：local、redis、rocketmq、kafka、rabbitmq
     */
    @NotNull(message = "WebSocket 的消息发送者不能为空")
    private String senderType = "local";

    /** yml 所有配置
     *   websocket:
     *     enable: true # websocket的开关
     *     path: /infra/ws # 路径
     *     sender-type: local # 消息发送的类型，可选值为 local、redis、rocketmq、kafka、rabbitmq
     *     sender-rocketmq:
     *       topic: ${spring.application.name}-websocket # 消息发送的 RocketMQ Topic
     *       consumer-group: ${spring.application.name}-websocket-consumer # 消息发送的 RocketMQ Consumer Group
     *     sender-rabbitmq:
     *       exchange: ${spring.application.name}-websocket-exchange # 消息发送的 RabbitMQ Exchange
     *       queue: ${spring.application.name}-websocket-queue # 消息发送的 RabbitMQ Queue
     *     sender-kafka:
     *       topic: ${spring.application.name}-websocket # 消息发送的 Kafka Topic
     *       consumer-group: ${spring.application.name}-websocket-consumer # 消息发送的 Kafka Consumer Group
     *
     */

}
