rabbitmq 中的文章

使用Prometheus监控RabbitMQ

RabbitMQ的Monitoring文档中介绍了各种监控RabbitMQ的方式。 其中推荐了第三方的Prometheus Plugin, 这是一个第三方实现RabbitMQ的管理插件,可以作为Prometheus的RabbitMQ Exporte……

阅读全文

使用RabbitMQ Java Client

Publishing Messages 连接到Broker 获取Channel 声明一个Exchange 创建一个Message 发布这个Message 关闭Channel 关闭Connection 1ConnectionFactory connectionFactory = new ConnectionFactory(); 2// AMQP URI amqp://userName:password@hostName:portNumber/virtualHost" 3connectionFactory.setUri("amqp://test:[email protected]:5672/demo"); 4Connection connection = connectionFactory.newConnection(); 5Channel channel = connection.createChannel(); 6channel.exchangeDeclare("first-exchange", "direct", true); 7byte[] msgBody = "Hello, World!".getBytes("UTF-8"); 8channel.basicPublish("first-exchange", "helloRoutingKey", null, msgBody); 9channel.close(); 10connection.close(); Receiving Messages by Subscription 1public static void main(String[] args) throws Exception { 2……

阅读全文