## ## RabbitMQ 3.8.5## ############ Copyright (c) 2007-2020 VMware, Inc. or its affiliates.###### ############ Licensed under the MPL 1.1. Website: https://rabbitmq.com Doc guides: https://rabbitmq.com/documentation.html
Support: https://rabbitmq.com/contact.html
Tutorials: https://rabbitmq.com/getstarted.html
Monitoring: https://rabbitmq.com/monitoring.html
Logs: /var/log/rabbitmq/rabbit@william-pc.log
/var/log/rabbitmq/rabbit@william-pc_upgrade.log
Config file(s): (none) Starting broker... completed with 0 plugins.
插件管理
需要先启动插件,然后在启动 rabbitmq 服务
1
sudo rabbitmq-plugins enable rabbitmq_management
启动成功后
1
2
3
4
5
6
7
8
9
10
11
12
13
Enabling plugins on node rabbit@william-pc:
rabbitmq_management
The following plugins have been configured:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
Applying plugin configuration to rabbit@william-pc...
The following plugins have been enabled:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
started 3 plugins.
这样
先启动插件管理
然后启动服务
产生以下结果
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
## ## RabbitMQ 3.8.5## ############ Copyright (c) 2007-2020 VMware, Inc. or its affiliates.###### ############ Licensed under the MPL 1.1. Website: https://rabbitmq.comDoc guides: https://rabbitmq.com/documentation.html
Support: https://rabbitmq.com/contact.html
Tutorials: https://rabbitmq.com/getstarted.html
Monitoring: https://rabbitmq.com/monitoring.html
Logs: /var/log/rabbitmq/rabbit@william-pc.log
/var/log/rabbitmq/rabbit@william-pc_upgrade.log
Config file(s): (none)Starting broker... completed with 3 plugins.
importpikaconnection=pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))channel=connection.channel()channel.exchange_declare(exchange='logs',exchange_type='fanout',durable=True)result=channel.queue_declare(queue="",exclusive=True,durable=True)queue_name=result.method.queuechannel.queue_bind(exchange='logs',queue=queue_name)print(' [*] Waiting for logs. To exit press CTRL+C')defcallback(ch,method,properties,body):print(" [x] %r"%body)channel.basic_qos(prefetch_count=1)channel.basic_consume(on_message_callback=callback,queue=queue_name,auto_ack=True)channel.start_consuming()
C++
AMQP-CPP
这个项目相对比较活跃,而且支持 C++11 标准。
AMQP-CPP is a C++ library for communicating with a RabbitMQ message broker. The library can be used to parse incoming data from a RabbitMQ server, and to generate frames that can be sent to a RabbitMQ server.
AMQP-CPP is fully asynchronous and does not do any blocking (system) calls, so it can be used in high performance applications without the need for threads.