mirror of
https://gitee.com/52itstyle/spring-boot-seckill.git
synced 2026-02-18 18:30:17 +00:00
秒杀初交
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package com.itstyle.seckill.queue.redis;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.itstyle.seckill.service.ISeckillService;
|
||||
/**
|
||||
* 消费者
|
||||
* @author 科帮网 By https://blog.52itstyle.com
|
||||
*/
|
||||
@Service
|
||||
public class RedisConsumer {
|
||||
|
||||
@Autowired
|
||||
private ISeckillService seckillService;
|
||||
|
||||
public void receiveMessage(String message) {
|
||||
//收到通道的消息之后执行秒杀操作(超卖)
|
||||
String[] array = message.split(";");
|
||||
seckillService.startSeckil(Long.parseLong(array[0]), Long.parseLong(array[1]));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user