写在一起
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; @RabbitListener(bindings = @QueueBinding( value = @Queue(value = "my_queue", durable = "true", autoDelete = "false"), exchange = @Exchange(value = "my_exchange", type = ExchangeTypes.TOPIC), key = "my_key" )) public void appealSelectedCatId(String catId) { }