package com.jpsoft.shinestar.mq.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RabbitListener(queues = "testYearRequestForLeaveQueue",concurrency = "10")
public class TestYearRequestForLeaveListener {

    @RabbitHandler
    public void process(String id) {
        try {
            log.warn("收到年假编号:" + id);
            System.out.print("收到年假编号:" + id);
        }
        catch (Exception ex){
            log.error(ex.getMessage(),ex);
        }
    }

}
