Gradle实用整理

使用账号密码访问受保护的maven仓库 当nexus中禁用了匿名用户(Anonymous)对仓库的访问时,我们需要在构建脚本中指定访问仓库的账号和密码。 1repositories { 2 maven { 3 url "http://192.168.1.10:8081/nexus/content/repositories/releases/" 4 credentials { 5 username 'user' 6 password 'password' 7 } 8 } 9} 上门的配置虽然能达到目的,但是用户名和密码是明……

阅读全文

使用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……

阅读全文

安装RabbitMQ

RabbitMQ是一个开源的AMQP实现,服务端使用Erlang语言编写,支持多种客户端, 如:Python、Ruby、.NET、Java、JMS、C、PHP、ActionScript、XMPP、STOPMP等。 构建和安装Erlang 提前安装……

阅读全文

AMQP协议简介

简介 AMQP即Advanced Message Queuing Protocol,高级消息队列协议,是面向消息中间件设计的应用层协议的一个开放标准。 它的主要特点是面向消息、队列、路由(包括点对点和发布/订阅)]、可靠性和安全。 AMQP允许来自不同供应商的消息生产者和消费……

阅读全文