com.lmaye.cloud.starter.delay.queue.service.impl.DelayQueueServiceImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lms-cloud-starter-delay-queue Show documentation
Show all versions of lms-cloud-starter-delay-queue Show documentation
LMS Cloud Delay Queue Starter project for Spring Boot
package com.lmaye.cloud.starter.delay.queue.service.impl;
import com.lmaye.cloud.core.utils.GsonUtils;
import com.lmaye.cloud.starter.delay.queue.DelayQueueProperties;
import com.lmaye.cloud.starter.delay.queue.entity.DelayQueueBody;
import com.lmaye.cloud.starter.delay.queue.producer.KafkaProducer;
import com.lmaye.cloud.starter.delay.queue.service.DelayQueueService;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.util.Set;
import java.util.concurrent.TimeUnit;
/**
* -- Delay Queue Service
*
* @author Lmay Zhou
* @date 2021/12/17 10:33
* @email [email protected]
* @since JDK1.8
*/
@Slf4j
@Service
public class DelayQueueServiceImpl implements DelayQueueService {
/**
* Redis Template
*/
@Autowired
private RedisTemplate redisTemplate;
/**
* Redisson Client
*/
@Autowired
private RedissonClient redissonClient;
/**
* Kafka Producer
*/
@Autowired
private KafkaProducer kafkaProducer;
/**
* Delay Queue Properties
*/
@Autowired
private DelayQueueProperties properties;
/**
* 任务处理
*/
@Async
@Override
public void taskHandle() {
Set
© 2015 - 2024 Weber Informatics LLC | Privacy Policy