Skip to content

Instantly share code, notes, and snippets.

@chathurangat
Created November 12, 2017 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chathurangat/d90e1a058efc19cd3adb0707f1cbaab9 to your computer and use it in GitHub Desktop.
Save chathurangat/d90e1a058efc19cd3adb0707f1cbaab9 to your computer and use it in GitHub Desktop.
package com.springbootdev.examples.consumer.service;
import com.springbootdev.examples.consumer.model.Car;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
@Component
@RabbitListener(queues = {"all_cars_queue", "nissan_cars_queue"})
public class ConsumerService
{
private static final Logger logger = LoggerFactory.getLogger(ConsumerService.class);
@RabbitHandler
public void receiveMessage(Car car)
{
logger.info(" receive message [" + car.toString() + "] ");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment