From 8c01e5717a28048430791eada2d6cfc4942709a6 Mon Sep 17 00:00:00 2001 From: ipipman Date: Sun, 14 Jul 2024 09:12:45 +0800 Subject: [PATCH] add mq sample --- .../demo/MqClientSpringDemoApplication.java | 2 -- .../spring/demo/sample}/ConsumerDemo1.java | 2 +- .../spring/demo/sample}/ConsumerDemo2.java | 2 +- .../spring/demo/sample}/ConsumerDemo3.java | 2 +- .../demo/{ => sample}/ListenerDemo.java | 2 +- .../spring/demo/sample}/NettyClientDemo.java | 2 +- .../demo/SpringAnnotationListenerDemo.java | 23 ------------------- 7 files changed, 5 insertions(+), 30 deletions(-) rename {mq-client/src/main/java/cn/ipman/mq/client/demo => mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/sample}/ConsumerDemo1.java (98%) rename {mq-client/src/main/java/cn/ipman/mq/client/demo => mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/sample}/ConsumerDemo2.java (95%) rename {mq-client/src/main/java/cn/ipman/mq/client/demo => mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/sample}/ConsumerDemo3.java (98%) rename mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/{ => sample}/ListenerDemo.java (89%) rename {mq-client/src/main/java/cn/ipman/mq/client/demo => mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/sample}/NettyClientDemo.java (99%) delete mode 100644 mq-client/src/main/java/cn/ipman/mq/client/demo/SpringAnnotationListenerDemo.java diff --git a/mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/MqClientSpringDemoApplication.java b/mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/MqClientSpringDemoApplication.java index e3f6a94..da78d1f 100644 --- a/mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/MqClientSpringDemoApplication.java +++ b/mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/MqClientSpringDemoApplication.java @@ -23,12 +23,10 @@ public static void main(String[] args) { SpringApplication.run(MqClientSpringDemoApplication.class, args); } - @Bean @SuppressWarnings("unchecked") public ApplicationRunner runner(@Autowired ApplicationContext context) { return x -> { - int ids = 0; String topic = "im.order"; diff --git a/mq-client/src/main/java/cn/ipman/mq/client/demo/ConsumerDemo1.java b/mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/sample/ConsumerDemo1.java similarity index 98% rename from mq-client/src/main/java/cn/ipman/mq/client/demo/ConsumerDemo1.java rename to mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/sample/ConsumerDemo1.java index d11ed6d..bb80aa2 100755 --- a/mq-client/src/main/java/cn/ipman/mq/client/demo/ConsumerDemo1.java +++ b/mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/sample/ConsumerDemo1.java @@ -1,4 +1,4 @@ -package cn.ipman.mq.client.demo; +package cn.ipman.mq.client.spring.demo.sample; import cn.ipman.mq.client.broker.MQBroker; import cn.ipman.mq.client.broker.MQConsumer; diff --git a/mq-client/src/main/java/cn/ipman/mq/client/demo/ConsumerDemo2.java b/mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/sample/ConsumerDemo2.java similarity index 95% rename from mq-client/src/main/java/cn/ipman/mq/client/demo/ConsumerDemo2.java rename to mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/sample/ConsumerDemo2.java index a9c3425..0e52635 100755 --- a/mq-client/src/main/java/cn/ipman/mq/client/demo/ConsumerDemo2.java +++ b/mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/sample/ConsumerDemo2.java @@ -1,4 +1,4 @@ -package cn.ipman.mq.client.demo; +package cn.ipman.mq.client.spring.demo.sample; import cn.ipman.mq.client.broker.MQBroker; import cn.ipman.mq.client.broker.MQConsumer; diff --git a/mq-client/src/main/java/cn/ipman/mq/client/demo/ConsumerDemo3.java b/mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/sample/ConsumerDemo3.java similarity index 98% rename from mq-client/src/main/java/cn/ipman/mq/client/demo/ConsumerDemo3.java rename to mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/sample/ConsumerDemo3.java index 50874d5..fae71f1 100755 --- a/mq-client/src/main/java/cn/ipman/mq/client/demo/ConsumerDemo3.java +++ b/mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/sample/ConsumerDemo3.java @@ -1,4 +1,4 @@ -package cn.ipman.mq.client.demo; +package cn.ipman.mq.client.spring.demo.sample; import cn.ipman.mq.client.broker.MQBroker; import cn.ipman.mq.client.broker.MQConsumer; diff --git a/mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/ListenerDemo.java b/mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/sample/ListenerDemo.java similarity index 89% rename from mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/ListenerDemo.java rename to mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/sample/ListenerDemo.java index 20cd18b..8f51a96 100644 --- a/mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/ListenerDemo.java +++ b/mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/sample/ListenerDemo.java @@ -1,4 +1,4 @@ -package cn.ipman.mq.client.spring.demo; +package cn.ipman.mq.client.spring.demo.sample; import cn.ipman.mq.client.annotation.MQListener; import cn.ipman.mq.metadata.model.Message; diff --git a/mq-client/src/main/java/cn/ipman/mq/client/demo/NettyClientDemo.java b/mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/sample/NettyClientDemo.java similarity index 99% rename from mq-client/src/main/java/cn/ipman/mq/client/demo/NettyClientDemo.java rename to mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/sample/NettyClientDemo.java index b79024c..aeebfab 100644 --- a/mq-client/src/main/java/cn/ipman/mq/client/demo/NettyClientDemo.java +++ b/mq-client-spring-demo/src/main/java/cn/ipman/mq/client/spring/demo/sample/NettyClientDemo.java @@ -1,4 +1,4 @@ -package cn.ipman.mq.client.demo; +package cn.ipman.mq.client.spring.demo.sample; import cn.ipman.mq.client.client.netty.NettyMQClient; diff --git a/mq-client/src/main/java/cn/ipman/mq/client/demo/SpringAnnotationListenerDemo.java b/mq-client/src/main/java/cn/ipman/mq/client/demo/SpringAnnotationListenerDemo.java deleted file mode 100644 index 67c1ea2..0000000 --- a/mq-client/src/main/java/cn/ipman/mq/client/demo/SpringAnnotationListenerDemo.java +++ /dev/null @@ -1,23 +0,0 @@ -package cn.ipman.mq.client.demo; - -import cn.ipman.mq.client.annotation.MQListener; -import cn.ipman.mq.metadata.model.Message; -import org.springframework.stereotype.Component; - - - -/** - * Description for this class - * - * @Author IpMan - * @Date 2024/6/29 20:07 - */ -@Component -public class SpringAnnotationListenerDemo { - - @MQListener(topic = {"im.order", "cn.ipman.test"}) - public void demo(Message msg) { - System.out.println("........." + msg); - } - -}