RabbitMQ

위키백과, 우리 모두의 백과사전.

RabbitMQ
개발자피보탈 소프트웨어
안정화 버전
3.7.13 / 2019년 3월 7일(5년 전)(2019-03-07)
저장소github.com/rabbitmq
프로그래밍 언어얼랭
운영 체제크로스 플랫폼
종류AMQP, 메시지 지향 미들웨어
라이선스모질라 퍼블릭 라이선스
웹사이트www.rabbitmq.com
RabbitMQ

RabbitMQ는 오픈 소스 메시지 브로커 소프트웨어(메시지 지향 미들웨어)로서, AMQP를 구현하였으며 그 이후로 STOMP, MQTT 등의 프로토콜을 지원하기 위해 플러그인 구조와 함께 확장되고 있다.

메시지를 생산하는 생산자(Producer)가 메시지를 큐에 저장해 두면, 메시지를 수신하는 소비자(Consumer)가 메시지를 가져와 처리하는 Publish/Subscribe 방식의 메시지 전달 브로커이다.

[편집]

송신[편집]

#!/usr/bin/env python
import pika
connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
channel = connection.channel()
channel.queue_declare(queue='hello')
channel.basic_publish(exchange='', routing_key='hello', body='Hello World!')
print(" [x] Sent 'Hello World!'")
connection.close()

수신[편집]

#!/usr/bin/env python
import pika
connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
channel = connection.channel()
channel.queue_declare(queue='hello')
print(' [*] Waiting for messages. To exit press CTRL+C')
def callback(ch, method, properties, body):
    print(" [x] Received %r" % body)
channel.basic_consume('hello', callback)
channel.start_consuming()

같이 보기[편집]

외부 링크[편집]