update rmq

This commit is contained in:
ynn
2019-02-24 18:17:54 +01:00
parent f5ccc868f9
commit f2d1a5ecba
3 changed files with 23 additions and 2 deletions

View File

@@ -11,7 +11,7 @@ public class Recv {
public static void main(String[] argv) throws Exception {
ConnectionFactory factory = new ConnectionFactory();
factory.setHost("localhost");
factory.setUri("amqp://admin:admin@localhost:8088/ipr");
Connection connection = factory.newConnection();
Channel channel = connection.createChannel();

View File

@@ -10,7 +10,7 @@ public class Send {
public static void main(String[] argv) throws Exception {
ConnectionFactory factory = new ConnectionFactory();
factory.setHost("localhost");
factory.setUri("amqp://admin:admin@localhost:8088/ipr");
try (Connection connection = factory.newConnection();
Channel channel = connection.createChannel()) {
channel.queueDeclare(QUEUE_NAME, false, false, false, null);