package com.persagy.server.syn.jms

import org.slf4j.LoggerFactory
import org.springframework.amqp.rabbit.annotation.RabbitHandler
import org.springframework.amqp.rabbit.annotation.RabbitListener
import org.springframework.stereotype.Component


/**
 * 消息的接收者
 * @author wx  <zhangweixin@sagacloud.com>
 * @date  2020/10/27 17:25
 */
@Component
class MessageReceiver {
    companion object {
        // 日志
        private val logger = LoggerFactory.getLogger(MessageReceiver::class.java)
    } // Companion object

    @RabbitListener(queues = ["queue-zwx"])
    @RabbitHandler
    fun process(mess: String) {
        println("我是topic.qune的消费者接收到的消息为 ：$mess")
        logger.debug("接收消息：${mess}")
    }

}