From 6650f6c70040f2e1bd02bd98d897e932b3929957 Mon Sep 17 00:00:00 2001 From: javahongxi Date: Sat, 12 Jan 2019 07:37:59 +0800 Subject: [PATCH] optimise --- pom.xml | 4 ++- .../hongxi/whatsmars/rabbitmq/Consumer.java | 32 ------------------- .../hongxi/whatsmars/rabbitmq/Producer.java | 27 ---------------- whatsmars-spring-boot/pom.xml | 5 +++ 4 files changed, 8 insertions(+), 60 deletions(-) delete mode 100644 whatsmars-mq/whatsmars-mq-rabbitmq/src/main/java/org/hongxi/whatsmars/rabbitmq/Consumer.java delete mode 100644 whatsmars-mq/whatsmars-mq-rabbitmq/src/main/java/org/hongxi/whatsmars/rabbitmq/Producer.java diff --git a/pom.xml b/pom.xml index 7801cdda..b5dad9b4 100644 --- a/pom.xml +++ b/pom.xml @@ -223,7 +223,9 @@ https://github.com/javahongxi/whatsmars - https://github.com/javahongxi/whatsmars.git + scm:git:https://github.com/javahongxi/whatsmars.git + scm:git:https://github.com/javahongxi/whatsmars.git + HEAD diff --git a/whatsmars-mq/whatsmars-mq-rabbitmq/src/main/java/org/hongxi/whatsmars/rabbitmq/Consumer.java b/whatsmars-mq/whatsmars-mq-rabbitmq/src/main/java/org/hongxi/whatsmars/rabbitmq/Consumer.java deleted file mode 100644 index 4d0caf6a..00000000 --- a/whatsmars-mq/whatsmars-mq-rabbitmq/src/main/java/org/hongxi/whatsmars/rabbitmq/Consumer.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.hongxi.whatsmars.rabbitmq; - -import com.rabbitmq.client.Channel; -import com.rabbitmq.client.Connection; -import com.rabbitmq.client.ConnectionFactory; -import com.rabbitmq.client.QueueingConsumer; - -/** - * Created by shenhongxi on 2017/9/8. - */ -public class Consumer { - - public static void main(String[] args) throws Exception { - String queueName = "TestQueue"; - ConnectionFactory factory = new ConnectionFactory(); - factory.setHost("127.0.0.1"); - Connection connection = factory.newConnection(); - Channel channel = connection.createChannel(); - - channel.queueDeclare(queueName, false, false, false, null); - System.out.println(" [*] Waiting for messages..."); - - QueueingConsumer consumer = new QueueingConsumer(channel); - channel.basicConsume(queueName, true, consumer); - - while (true) { - QueueingConsumer.Delivery delivery = consumer.nextDelivery(); - String message = new String(delivery.getBody()); - System.out.println(" [x] Received '" + message + "'"); - } - } -} diff --git a/whatsmars-mq/whatsmars-mq-rabbitmq/src/main/java/org/hongxi/whatsmars/rabbitmq/Producer.java b/whatsmars-mq/whatsmars-mq-rabbitmq/src/main/java/org/hongxi/whatsmars/rabbitmq/Producer.java deleted file mode 100644 index 9a14c256..00000000 --- a/whatsmars-mq/whatsmars-mq-rabbitmq/src/main/java/org/hongxi/whatsmars/rabbitmq/Producer.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.hongxi.whatsmars.rabbitmq; - -import com.rabbitmq.client.Channel; -import com.rabbitmq.client.Connection; -import com.rabbitmq.client.ConnectionFactory; - -/** - * Created by shenhongxi on 2017/9/8. - */ -public class Producer { - - public static void main(String[] args) throws Exception { - String queueName = "TestQueue"; - ConnectionFactory factory = new ConnectionFactory(); - factory.setHost("127.0.0.1"); - Connection connection = factory.newConnection(); - Channel channel = connection.createChannel(); - - channel.queueDeclare(queueName, false, false, false, null); - String message = "Hello World!"; - channel.basicPublish("", queueName, null, message.getBytes()); - System.out.println(" [x] Sent '" + message + "'"); - - channel.close(); - connection.close(); - } -} diff --git a/whatsmars-spring-boot/pom.xml b/whatsmars-spring-boot/pom.xml index 250770e7..09c33a27 100644 --- a/whatsmars-spring-boot/pom.xml +++ b/whatsmars-spring-boot/pom.xml @@ -81,6 +81,11 @@ gson + + javax.servlet + javax.servlet-api + + org.hongxi whatsmars-common -- GitLab