package cn.com.taiji.dataService.listen;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

//@Component
@Slf4j
public class RabbitMqListener {

    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(value = "xalarm_aps_exchange_forward_to_face_consumer_queue_hik8807",
                    durable = "true"),
            exchange = @Exchange(value = "xalarm_aps_exchange_forward_to_component", type = ExchangeTypes.DIRECT),
            key = "iface"))
    public void listenerTest(String data){
        log.info("--------iface----------  {}",data);

    }

    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(value = "xalarm_aps_exchange_forward_to_ivehicle_consumer_queue_hik8807",
                    durable = "true"),
            exchange = @Exchange(value = "xalarm_aps_exchange_forward_to_component", type = ExchangeTypes.DIRECT),
            key = "ivehicle"))
    public void listenerIvehicle(String data){
        log.info("--------ivehicle----------  {}",data);

    }
}
