记得上下班打卡 | git大法好,push需谨慎

Commit 56e21e55 authored by anjiabin's avatar anjiabin

迁移NFT-sql消费-注释掉

parent 2a711542
package com.liquidnet.service.consumer.base.config; package com.liquidnet.service.consumer.base.config;
import com.liquidnet.common.cache.redis.config.RedisStreamConfig; import com.liquidnet.common.cache.redis.config.RedisStreamConfig;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.consumer.base.receiver.ConsumerCommonSQL0Receiver; import com.liquidnet.service.consumer.base.receiver.ConsumerCommonSQL0Receiver;
import com.liquidnet.service.consumer.base.receiver.ConsumerGoblinNftOrderRdsReceiver;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.stream.Consumer;
import org.springframework.data.redis.connection.stream.MapRecord;
import org.springframework.data.redis.connection.stream.ReadOffset;
import org.springframework.data.redis.connection.stream.StreamOffset;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.stream.StreamMessageListenerContainer;
import org.springframework.data.redis.stream.Subscription;
import java.util.ArrayList;
import java.util.List;
/** /**
* 公共的SQL队列消息消费器初始化配置 * 公共的SQL队列消息消费器初始化配置
...@@ -32,8 +19,8 @@ public class ConsumerCommonSqlRedisStreamConfig extends RedisStreamConfig { ...@@ -32,8 +19,8 @@ public class ConsumerCommonSqlRedisStreamConfig extends RedisStreamConfig {
@Autowired @Autowired
ConsumerCommonSQL0Receiver consumerCommonSQL0Receiver; ConsumerCommonSQL0Receiver consumerCommonSQL0Receiver;
@Autowired // @Autowired
ConsumerGoblinNftOrderRdsReceiver consumerGoblinNftOrderRdsReceiver; // ConsumerGoblinNftOrderRdsReceiver consumerGoblinNftOrderRdsReceiver;
// @Bean // @Bean
// public List<Subscription> subscriptionSQL0(RedisConnectionFactory factory) { // public List<Subscription> subscriptionSQL0(RedisConnectionFactory factory) {
...@@ -51,19 +38,19 @@ public class ConsumerCommonSqlRedisStreamConfig extends RedisStreamConfig { ...@@ -51,19 +38,19 @@ public class ConsumerCommonSqlRedisStreamConfig extends RedisStreamConfig {
// return subscriptionList; // return subscriptionList;
// } // }
@Bean// goblin NFT订单 // @Bean// goblin NFT订单
public List<Subscription> subscriptionSqlNftOrder(RedisConnectionFactory factory) { // public List<Subscription> subscriptionSqlNftOrder(RedisConnectionFactory factory) {
List<Subscription> subscriptionList = new ArrayList<>(); // List<Subscription> subscriptionList = new ArrayList<>();
MQConst.GoblinQueue stream = MQConst.GoblinQueue.GOBLIN_NFT_ORDER; // MQConst.GoblinQueue stream = MQConst.GoblinQueue.GOBLIN_NFT_ORDER;
this.initStream(stringRedisTemplate, stream.getKey(), stream.getGroup()); // this.initStream(stringRedisTemplate, stream.getKey(), stream.getGroup());
for (int i = 0; i < 20; i++) { // for (int i = 0; i < 20; i++) {
StreamMessageListenerContainer<String, MapRecord<String, String, String>> listenerContainer = this.buildStreamMessageListenerContainer(factory); // StreamMessageListenerContainer<String, MapRecord<String, String, String>> listenerContainer = this.buildStreamMessageListenerContainer(factory);
subscriptionList.add(listenerContainer.receiveAutoAck( // subscriptionList.add(listenerContainer.receiveAutoAck(
Consumer.from(stream.getGroup(), getConsumerName(stream.name() + i)), // Consumer.from(stream.getGroup(), getConsumerName(stream.name() + i)),
StreamOffset.create(stream.getKey(), ReadOffset.lastConsumed()), consumerGoblinNftOrderRdsReceiver // StreamOffset.create(stream.getKey(), ReadOffset.lastConsumed()), consumerGoblinNftOrderRdsReceiver
)); // ));
listenerContainer.start(); // listenerContainer.start();
} // }
return subscriptionList; // return subscriptionList;
} // }
} }
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