Commit a2a010f0 authored by yanzg's avatar yanzg

将源码打包进jar包

parent a6395665
......@@ -7,36 +7,23 @@ import com.yanzuoguang.redis.PlanInfo;
import com.yanzuoguang.redis.service.PlanService;
import com.yanzuoguang.util.helper.JsonHelper;
import org.springframework.amqp.core.Message;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;
import java.nio.charset.StandardCharsets;
/**
* 任务消费
*
* @author 颜佐光
*/
@Component
public class PlanConsumer implements InitializingBean {
public class PlanConsumer {
private final MqService mqService;
private final PlanProcedure planProcedure;
private final PlanService planService;
public PlanConsumer(MqService mqService, PlanProcedure planProcedure, PlanService planService) {
public PlanConsumer(MqService mqService, PlanService planService) {
this.mqService = mqService;
this.planProcedure = planProcedure;
this.planService = planService;
}
@Override
public void afterPropertiesSet() {
// 应用程序级的任务交给队列处理
planProcedure.initQueue((message, channel) ->
PlanConsumer.this.plan(new String(message.getBody(), StandardCharsets.UTF_8), message, channel)
);
}
/**
* 消费任务
*
......
package com.yanzuoguang.redis.mq;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;
import java.nio.charset.StandardCharsets;
/**
* 任务消费
*
* @author 颜佐光
*/
@Component
public class PlanConsumerInit implements InitializingBean {
private final PlanProcedure planProcedure;
private final PlanConsumer planConsumer;
public PlanConsumerInit(PlanProcedure planProcedure, PlanConsumer planConsumer) {
this.planProcedure = planProcedure;
this.planConsumer = planConsumer;
}
@Override
public void afterPropertiesSet() {
// 应用程序级的任务交给队列处理
planProcedure.initQueue((message, channel) ->
planConsumer.plan(new String(message.getBody(), StandardCharsets.UTF_8), message, channel)
);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment