cloud 代码示例结构调整
This commit is contained in:
parent
4686398cb2
commit
3ee0cef93b
|
@ -29,16 +29,16 @@
|
||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--rabbitmq消息队列-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.jeecgframework.boot</groupId>
|
|
||||||
<artifactId>jeecg-boot-starter-rabbitmq</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!--xxl-job定时任务-->
|
<!--xxl-job定时任务-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jeecgframework.boot</groupId>
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
<artifactId>jeecg-boot-starter-job</artifactId>
|
<artifactId>jeecg-boot-starter-job</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!--rabbitmq消息队列
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-boot-starter-rabbitmq</artifactId>
|
||||||
|
</dependency>-->
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package org.jeecg.modules.feigndemo.controller;
|
package org.jeecg.modules.cloud.feign.controller;
|
||||||
|
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.modules.feigndemo.feign.JeecgTestClient;
|
import org.jeecg.modules.cloud.feign.feign.JeecgTestClient;
|
||||||
import org.jeecg.modules.feigndemo.feign.JeecgTestClient2;
|
import org.jeecg.modules.cloud.feign.feign.JeecgTestClient2;
|
||||||
import org.jeecg.starter.cloud.feign.impl.JeecgFeignService;
|
import org.jeecg.starter.cloud.feign.impl.JeecgFeignService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.jeecg.modules.feigndemo.feign;
|
package org.jeecg.modules.cloud.feign.feign;
|
||||||
|
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.jeecg.modules.feigndemo.feign;
|
package org.jeecg.modules.cloud.feign.feign;
|
||||||
|
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.jeecg.modules.feigndemo.feign;
|
package org.jeecg.modules.cloud.feign.feign;
|
||||||
|
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@ -0,0 +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<BaseMap> {
|
||||||
|
//
|
||||||
|
// @RabbitHandler
|
||||||
|
// public void onMessage(BaseMap baseMap, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) {
|
||||||
|
// super.onMessage(baseMap, deliveryTag, channel, new MqListener<BaseMap>() {
|
||||||
|
// @Override
|
||||||
|
// public void handler(BaseMap map, Channel channel) {
|
||||||
|
// //业务处理
|
||||||
|
// String orderId = map.get("orderId").toString();
|
||||||
|
// System.out.println("Receiver1 : " + orderId);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//}
|
|
@ -0,0 +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<BaseMap> {
|
||||||
|
//
|
||||||
|
// @RabbitHandler
|
||||||
|
// public void onMessage(BaseMap baseMap, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) {
|
||||||
|
// super.onMessage(baseMap, deliveryTag, channel, new MqListener<BaseMap>() {
|
||||||
|
// @Override
|
||||||
|
// public void handler(BaseMap map, Channel channel) {
|
||||||
|
// //业务处理
|
||||||
|
// String orderId = map.get("orderId").toString();
|
||||||
|
// System.out.println("Receiver2 : " + orderId);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//}
|
|
@ -0,0 +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<BaseMap> {
|
||||||
|
//
|
||||||
|
// @RabbitHandler
|
||||||
|
// public void onMessage(BaseMap baseMap, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) {
|
||||||
|
// super.onMessage(baseMap, deliveryTag, channel, new MqListener<BaseMap>() {
|
||||||
|
// @Override
|
||||||
|
// public void handler(BaseMap map, Channel channel) {
|
||||||
|
// //业务处理
|
||||||
|
// String orderId = map.get("orderId").toString();
|
||||||
|
// System.out.println("Receiver1 : " + orderId);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//}
|
|
@ -1,29 +0,0 @@
|
||||||
package org.jeecg.modules.cloud.test;
|
|
||||||
|
|
||||||
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<BaseMap> {
|
|
||||||
|
|
||||||
@RabbitHandler
|
|
||||||
public void onMessage(BaseMap baseMap, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) {
|
|
||||||
super.onMessage(baseMap, deliveryTag, channel, new MqListener<BaseMap>() {
|
|
||||||
@Override
|
|
||||||
public void handler(BaseMap map, Channel channel) {
|
|
||||||
//业务处理
|
|
||||||
String orderId = map.get("orderId").toString();
|
|
||||||
System.out.println("Receiver1 : " + orderId);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
package org.jeecg.modules.cloud.test;
|
|
||||||
|
|
||||||
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<BaseMap> {
|
|
||||||
|
|
||||||
@RabbitHandler
|
|
||||||
public void onMessage(BaseMap baseMap, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) {
|
|
||||||
super.onMessage(baseMap, deliveryTag, channel, new MqListener<BaseMap>() {
|
|
||||||
@Override
|
|
||||||
public void handler(BaseMap map, Channel channel) {
|
|
||||||
//业务处理
|
|
||||||
String orderId = map.get("orderId").toString();
|
|
||||||
System.out.println("Receiver2 : " + orderId);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
package org.jeecg.modules.cloud.test;
|
|
||||||
|
|
||||||
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<BaseMap> {
|
|
||||||
|
|
||||||
@RabbitHandler
|
|
||||||
public void onMessage(BaseMap baseMap, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) {
|
|
||||||
super.onMessage(baseMap, deliveryTag, channel, new MqListener<BaseMap>() {
|
|
||||||
@Override
|
|
||||||
public void handler(BaseMap map, Channel channel) {
|
|
||||||
//业务处理
|
|
||||||
String orderId = map.get("orderId").toString();
|
|
||||||
System.out.println("Receiver1 : " + orderId);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
package org.jeecg.modules.cloud.test;;
|
package org.jeecg.modules.cloud.xxljob;;
|
||||||
|
|
||||||
|
|
||||||
import com.xxl.job.core.biz.model.ReturnT;
|
import com.xxl.job.core.biz.model.ReturnT;
|
Loading…
Reference in New Issue