From ae0f9edb27c48ba1f59103ca7f716330209f01b6 Mon Sep 17 00:00:00 2001 From: zhangdaiscott Date: Sun, 24 Jan 2021 00:06:48 +0800 Subject: [PATCH] =?UTF-8?q?JeecgBoot=202.4.2=20=E7=A7=AF=E6=9C=A8=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E7=89=88=E6=9C=AC=E5=8F=91=E5=B8=83=EF=BC=8C=E5=9F=BA?= =?UTF-8?q?=E4=BA=8ESpringBoot=E7=9A=84=E4=BD=8E=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- .../cloud/rabbitmq/HelloReceiver1.java | 58 +++++++++---------- .../cloud/rabbitmq/HelloReceiver2.java | 58 +++++++++---------- .../cloud/rabbitmq/HelloTimeReceiver.java | 58 +++++++++---------- 4 files changed, 88 insertions(+), 88 deletions(-) diff --git a/README.md b/README.md index decfc584..dc7778fe 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ JEECG BOOT 低代码开发平台(前后端分离版本) [![AUR](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://github.com/zhangdaiscott/jeecg-boot/blob/master/LICENSE) [![](https://img.shields.io/badge/Author-北京国炬软件-orange.svg)](http://www.jeecg.com) -[![](https://img.shields.io/badge/version-2.4-brightgreen.svg)](https://github.com/zhangdaiscott/jeecg-boot) +[![](https://img.shields.io/badge/version-2.4.2-brightgreen.svg)](https://github.com/zhangdaiscott/jeecg-boot) [![GitHub stars](https://img.shields.io/github/stars/zhangdaiscott/jeecg-boot.svg?style=social&label=Stars)](https://github.com/zhangdaiscott/jeecg-boot) [![GitHub forks](https://img.shields.io/github/forks/zhangdaiscott/jeecg-boot.svg?style=social&label=Fork)](https://github.com/zhangdaiscott/jeecg-boot) diff --git a/jeecg-boot/jeecg-cloud-module/jeecg-cloud-system-start/src/main/java/org/jeecg/modules/cloud/rabbitmq/HelloReceiver1.java b/jeecg-boot/jeecg-cloud-module/jeecg-cloud-system-start/src/main/java/org/jeecg/modules/cloud/rabbitmq/HelloReceiver1.java index f79647f2..1bd18122 100644 --- a/jeecg-boot/jeecg-cloud-module/jeecg-cloud-system-start/src/main/java/org/jeecg/modules/cloud/rabbitmq/HelloReceiver1.java +++ b/jeecg-boot/jeecg-cloud-module/jeecg-cloud-system-start/src/main/java/org/jeecg/modules/cloud/rabbitmq/HelloReceiver1.java @@ -1,29 +1,29 @@ -//package org.jeecg.modules.cloud.rabbitmq; -// -//import com.rabbitmq.client.Channel; -//import org.jeecg.boot.starter.rabbitmq.core.BaseRabbiMqHandler; -//import org.jeecg.boot.starter.rabbitmq.listenter.MqListener; -//import org.jeecg.common.annotation.RabbitComponent; -//import org.jeecg.common.base.BaseMap; -//import org.springframework.amqp.rabbit.annotation.RabbitHandler; -//import org.springframework.amqp.rabbit.annotation.RabbitListener; -//import org.springframework.amqp.support.AmqpHeaders; -//import org.springframework.messaging.handler.annotation.Header; -// -//@RabbitListener(queues = "jeecg_place_order") -//@RabbitComponent(value = "helloReceiver1") -//public class HelloReceiver1 extends BaseRabbiMqHandler { -// -// @RabbitHandler -// public void onMessage(BaseMap baseMap, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) { -// super.onMessage(baseMap, deliveryTag, channel, new MqListener() { -// @Override -// public void handler(BaseMap map, Channel channel) { -// //业务处理 -// String orderId = map.get("orderId").toString(); -// System.out.println("Receiver1 : " + orderId); -// } -// }); -// } -// -//} \ No newline at end of file +package org.jeecg.modules.cloud.rabbitmq; + +import com.rabbitmq.client.Channel; +import org.jeecg.boot.starter.rabbitmq.core.BaseRabbiMqHandler; +import org.jeecg.boot.starter.rabbitmq.listenter.MqListener; +import org.jeecg.common.annotation.RabbitComponent; +import org.jeecg.common.base.BaseMap; +import org.springframework.amqp.rabbit.annotation.RabbitHandler; +import org.springframework.amqp.rabbit.annotation.RabbitListener; +import org.springframework.amqp.support.AmqpHeaders; +import org.springframework.messaging.handler.annotation.Header; + +@RabbitListener(queues = "jeecg_place_order") +@RabbitComponent(value = "helloReceiver1") +public class HelloReceiver1 extends BaseRabbiMqHandler { + + @RabbitHandler + public void onMessage(BaseMap baseMap, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) { + super.onMessage(baseMap, deliveryTag, channel, new MqListener() { + @Override + public void handler(BaseMap map, Channel channel) { + //业务处理 + String orderId = map.get("orderId").toString(); + System.out.println("Receiver1 : " + orderId); + } + }); + } + +} \ No newline at end of file diff --git a/jeecg-boot/jeecg-cloud-module/jeecg-cloud-system-start/src/main/java/org/jeecg/modules/cloud/rabbitmq/HelloReceiver2.java b/jeecg-boot/jeecg-cloud-module/jeecg-cloud-system-start/src/main/java/org/jeecg/modules/cloud/rabbitmq/HelloReceiver2.java index 4bb0a027..eba796a7 100644 --- a/jeecg-boot/jeecg-cloud-module/jeecg-cloud-system-start/src/main/java/org/jeecg/modules/cloud/rabbitmq/HelloReceiver2.java +++ b/jeecg-boot/jeecg-cloud-module/jeecg-cloud-system-start/src/main/java/org/jeecg/modules/cloud/rabbitmq/HelloReceiver2.java @@ -1,29 +1,29 @@ -//package org.jeecg.modules.cloud.rabbitmq; -// -//import com.rabbitmq.client.Channel; -//import org.jeecg.boot.starter.rabbitmq.core.BaseRabbiMqHandler; -//import org.jeecg.boot.starter.rabbitmq.listenter.MqListener; -//import org.jeecg.common.annotation.RabbitComponent; -//import org.jeecg.common.base.BaseMap; -//import org.springframework.amqp.rabbit.annotation.RabbitHandler; -//import org.springframework.amqp.rabbit.annotation.RabbitListener; -//import org.springframework.amqp.support.AmqpHeaders; -//import org.springframework.messaging.handler.annotation.Header; -// -//@RabbitListener(queues = "jeecg_place_order") -//@RabbitComponent(value = "helloReceiver2") -//public class HelloReceiver2 extends BaseRabbiMqHandler { -// -// @RabbitHandler -// public void onMessage(BaseMap baseMap, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) { -// super.onMessage(baseMap, deliveryTag, channel, new MqListener() { -// @Override -// public void handler(BaseMap map, Channel channel) { -// //业务处理 -// String orderId = map.get("orderId").toString(); -// System.out.println("Receiver2 : " + orderId); -// } -// }); -// } -// -//} \ No newline at end of file +package org.jeecg.modules.cloud.rabbitmq; + +import com.rabbitmq.client.Channel; +import org.jeecg.boot.starter.rabbitmq.core.BaseRabbiMqHandler; +import org.jeecg.boot.starter.rabbitmq.listenter.MqListener; +import org.jeecg.common.annotation.RabbitComponent; +import org.jeecg.common.base.BaseMap; +import org.springframework.amqp.rabbit.annotation.RabbitHandler; +import org.springframework.amqp.rabbit.annotation.RabbitListener; +import org.springframework.amqp.support.AmqpHeaders; +import org.springframework.messaging.handler.annotation.Header; + +@RabbitListener(queues = "jeecg_place_order") +@RabbitComponent(value = "helloReceiver2") +public class HelloReceiver2 extends BaseRabbiMqHandler { + + @RabbitHandler + public void onMessage(BaseMap baseMap, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) { + super.onMessage(baseMap, deliveryTag, channel, new MqListener() { + @Override + public void handler(BaseMap map, Channel channel) { + //业务处理 + String orderId = map.get("orderId").toString(); + System.out.println("Receiver2 : " + orderId); + } + }); + } + +} \ No newline at end of file diff --git a/jeecg-boot/jeecg-cloud-module/jeecg-cloud-system-start/src/main/java/org/jeecg/modules/cloud/rabbitmq/HelloTimeReceiver.java b/jeecg-boot/jeecg-cloud-module/jeecg-cloud-system-start/src/main/java/org/jeecg/modules/cloud/rabbitmq/HelloTimeReceiver.java index 50411e49..97fa05d7 100644 --- a/jeecg-boot/jeecg-cloud-module/jeecg-cloud-system-start/src/main/java/org/jeecg/modules/cloud/rabbitmq/HelloTimeReceiver.java +++ b/jeecg-boot/jeecg-cloud-module/jeecg-cloud-system-start/src/main/java/org/jeecg/modules/cloud/rabbitmq/HelloTimeReceiver.java @@ -1,29 +1,29 @@ -//package org.jeecg.modules.cloud.rabbitmq; -// -//import com.rabbitmq.client.Channel; -//import org.jeecg.boot.starter.rabbitmq.core.BaseRabbiMqHandler; -//import org.jeecg.boot.starter.rabbitmq.listenter.MqListener; -//import org.jeecg.common.annotation.RabbitComponent; -//import org.jeecg.common.base.BaseMap; -//import org.springframework.amqp.rabbit.annotation.RabbitHandler; -//import org.springframework.amqp.rabbit.annotation.RabbitListener; -//import org.springframework.amqp.support.AmqpHeaders; -//import org.springframework.messaging.handler.annotation.Header; -// -//@RabbitListener(queues = "jeecg_place_order_time") -//@RabbitComponent(value = "helloTimeReceiver") -//public class HelloTimeReceiver extends BaseRabbiMqHandler { -// -// @RabbitHandler -// public void onMessage(BaseMap baseMap, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) { -// super.onMessage(baseMap, deliveryTag, channel, new MqListener() { -// @Override -// public void handler(BaseMap map, Channel channel) { -// //业务处理 -// String orderId = map.get("orderId").toString(); -// System.out.println("Receiver1 : " + orderId); -// } -// }); -// } -// -//} \ No newline at end of file +package org.jeecg.modules.cloud.rabbitmq; + +import com.rabbitmq.client.Channel; +import org.jeecg.boot.starter.rabbitmq.core.BaseRabbiMqHandler; +import org.jeecg.boot.starter.rabbitmq.listenter.MqListener; +import org.jeecg.common.annotation.RabbitComponent; +import org.jeecg.common.base.BaseMap; +import org.springframework.amqp.rabbit.annotation.RabbitHandler; +import org.springframework.amqp.rabbit.annotation.RabbitListener; +import org.springframework.amqp.support.AmqpHeaders; +import org.springframework.messaging.handler.annotation.Header; + +@RabbitListener(queues = "jeecg_place_order_time") +@RabbitComponent(value = "helloTimeReceiver") +public class HelloTimeReceiver extends BaseRabbiMqHandler { + + @RabbitHandler + public void onMessage(BaseMap baseMap, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) { + super.onMessage(baseMap, deliveryTag, channel, new MqListener() { + @Override + public void handler(BaseMap map, Channel channel) { + //业务处理 + String orderId = map.get("orderId").toString(); + System.out.println("Receiver1 : " + orderId); + } + }); + } + +} \ No newline at end of file