秒杀初交

This commit is contained in:
小柒2012
2018-05-15 18:30:33 +08:00
parent efa656ec9e
commit 786dc6c311
51 changed files with 2861 additions and 0 deletions

View File

@@ -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]));
}
}