通过java client链接server@import url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
1. 通过设置参数
1 ConnectionFactory factory = new ConnectionFactory();
2 factory.setUsername(userName);
3 factory.setPassword(password);
4 factory.setVirtualHost(virtualHost);
5 factory.setHost(hostName);
6 factory.setPort(portNumber);
7 Connection conn = factory.newConnection();
1 ConnectionFactory factory = new ConnectionFactory();
2 factory.setUri("amqp://userName:password@hostName:portNumber/virtualHost");
3 Connection conn = factory.newConnection();
3.多地址
1 Address[] addrArr = new Address[]{ new Address(hostname1, portnumber1)
2 , new Address(hostname2, portnumber2)};
3 Connection conn = factory.newConnection(addrArr);
posted on 2013-04-11 10:27
hellxoul 阅读(363)
评论(0) 编辑 收藏 所属分类:
RabbitMQ