Skip to content

Instantly share code, notes, and snippets.

@sophea
Created July 31, 2020 14:37
Show Gist options
  • Select an option

  • Save sophea/34e1078a95a5bd199be8058341eefe41 to your computer and use it in GitHub Desktop.

Select an option

Save sophea/34e1078a95a5bd199be8058341eefe41 to your computer and use it in GitHub Desktop.
package com.sma.rabbitmq.service;
import com.sma.rabbitmq.model.Category;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
/**
* Author: Mak Sophea
* Date: 07/31/2020
*/
@Component
@Slf4j
public class RabbitMQReceiver {
@RabbitListener(queues = "${backend.rabbitmq.queue}")
public void receivedMessage(Category category) {
log.info("Recieved Message From RabbitMQ: " + category);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment