Thuật ngữ liên quan RabbitMAQ
- AMQP – Advanced Message Queueing Protocol
- EAI – Enterprise Application Integration
- BPM – Business Process Management
- ESB – Enterprise Service Bus
- SOA – Service Orientated Architecture
- MOM – Message Orientated Middleware
- WCF – Windows Communication Foundation
Trước khi tìm hiểu về RabbitMQ là gì? Bạn cần xem sự phát triển của nó: Messaging => AMQP => RabbitMQ
Messaging là gì ?
Làm thế nào bạn có thể tích hợp nhiều ứng dụng để chúng làm việc cùng nhau và có thể trao đổi thông tin lẫn nhau
Đặc điểm của Messaging là gì ?
- Asynchronous - Bất đồng bộ
- Reliable - Đúng đắn
- Durable - Bền vững
- Routing - Định tuyến
- Many message formats - Nhiều định dạng
- Recipient pulls message from queue - Nhận thông báo từ hàng đợi
Lịch sử của Messaging
- 1986 The Information Bus (TIB) developed
- 1993 IBM MQSeries released
- 1997 Microsoft MSMQ released
- 2001 Java Messaging Service released
Tại sao Messaging lại không hoạt động
- Nhắn tin đã có hàng thế kỷ
- Giải pháp tin nhắn là chìa khóa cho rất nhiều hệ thống giải quyết các vấn đề về liên kết với nhau
- Nhưng khó khăn của nó là:
- Việc xây dựng hệ thống đó rất khó khăn
- Việc mua và sử dụng chúng tốn rất nhiều tiền
- Khó kết nối tới nhiều ứng dụng
- Các nhà cung cấp đã cố gắng để xây dựng các sản phẩm quá phức tạp
AMQP là gì ?
- Advanced Message Queue Protocol - Giao thức Message Queue nâng cao
- Developed by JP Morgan Chase and iMatix
- Open standard protocol for messaging - Mở giao thức chuẩn cho Messaging
- Wire level protocol like HTTP
- Vendor agnostic protocol for messaging systems
Lịch sử của AMQP
- 2003 AMQP starts development at JP Morgan
- 2005 AMQP working group formed
- 2006 June AMQP 0-8 released December AMQP 0-9 released
- 2006 Rabbit technologies formed RabbitMQ first release
- 2011 AMQP 1.0 released by AMQP working group
- October 2012 AMQP 1.0 approved as an OASIS standard
Chìa khóa chính của AMQP là gì
- Message Broker
- Exchanges
- Direct
- Fan-out
- Topic
- Headers
- Queues
- Bindings
Sơ đồ hoạt động của AMQP
AMQP Message Brokers
- RabbitMQ
- Windows Azure Service Bus
- Apache Qpid
- Apache ActiveMQ
- SwiftMQ
- StormMQ
- WSO2 message broker
- OpenAMQ
RabbitMQ là gì ?
- RabbitMQ is an AMQP message broker
- Open source built upon Erlang
Sơ đồ hoạt động của RabbitMQ
- Producer: thực hiện quá trình gửi bản tin lên RabbitMQ server
- Exchange: thực hiện nhiệm vụ phân phối bản tin, có 3 kiểu phân phối bản tin direct, topic, fanout
- Queues: có nhiệm vụ lưu trữ bản tin được gửi lên
- Consumber: thực hiện việc lấy các bản tin từ queue về
Client Libraries & Community Libraries
- net/WCF
- Java
- Python
- Ruby
- Spring
Protocol Gateways
- XMPP
- Stomp
- Smtp
- Http
Tại sao lại sử dụng Rabbit MQ
- Giúp các phần mềm kết nối với nhau và mở rộng.
- Hỗ trợ hầu hết các ngôn ngữ thông dụng hiện nay
- RabbitMQ có giao diện quản lý dễ sử dụng cho phép bạn giám sát và kiểm soát mọi hoạt động.
- RabbitMQ hỗ trợ nhắn tin qua nhiều giao thức nhắn tin
- RabbitMQ cung cấp nhiều plugin mở rộng nhiều cách khác nhau và bạn cũng có thể viết thư riêng
Ứng dụng thật tế của RabbitMQ
Cài đặt RabbitMQ
Bước 1: Cài đặt erlang http://erlang.org/download/otp_win64_19.0.exe
Bước 2: Cài đặt RabbitMQ https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.2/rabbitmq-server-3.6.2.exe
Cài đặt RabbitMQ sử dụng winservice
Cài đặt RabbitMQ sử dụng console làm server
Uninstalling RabbitMQ and Erlang OTP
If RabbitMQ and Erlang are not uninstalled completely, you may encounter problems attempting to install RabbitMQ and Erlang on the same machine.
To uninstall RabbitMQ and Erlang from the machine completely, do the following:
- Open the Windows Control Panel.
- Double-click Programs and Features.
- In the list of currently installed programs, right-click RabbitMQ Server, and then click Uninstall
- In the list of currently installed programs, right-click Erlang OTP, and then click Uninstall.
- Open the Windows Task Manager
- In the Task Manager, look for the process epmd.exe. If this process is still running, right-click it and then click End Process.
- Delete all the installation directories for both RabbitMQ and Erlang.
- Delete the file C:\Windows\.erlang.cookie (if present).
- Go to the User folder: C:\Users\[username], and then delete the file .erlang.cookie.
- Also in the User folder, go to AppData\Roaming\RabbitMQ.
- Backup the Log folder to a secure location, and then delete the folder.