Code Monkey home page Code Monkey logo

rabbit-mq-spring's Introduction

Spring boot with RabbitMQ

Docker RabbitMQ 서버

docker run -d --name rabbitmq -p
5672:5672 -p 15672:15672 --restart=unless-stopped rabbitmq:management
  • port 5672 : RabbitMQ Broker
  • port 15672 : RabbitMQ 웹 관리 콘솔 (application.yml의 username, password 참고)

RabbitMQ 웹 콘솔

  • localhost:15672에 접속해서 관련 설정을 확인하고 조작할 수 있다.
  • Direct Exchange를 확인하기 위해, application.yml에 설정된 (queue, key)와는 다른 (queue, key)를 만든다.
image

Spring boot 프로젝트 실행

  • Application을 실행하고 http://localhost:8080/send/message로 요청을 보낸다.
  • RabbitTemplate이 제공하는 convertAndSend 메서드를 이용한 sendMessage 서비스 메서드의 동작을 확인한다. Direct Exchange 전략을 사용하므로, exchange는 application.yml에 등록된 routing key와 일치하는 queue로 바인딩한다.
image

sample-queue : routing key와 일치하는 queue, 메시지를 받아서 처리했음을 알 수 있다.

image

test-queue : routing key와 일치하지 않는 queue, routing key가 달라 test-queue에 바인딩되지 않으므로, 처리한 메시지가 없다.

image

rabbit-mq-spring's People

Contributors

rumoszin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.