记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
0b5650b8
Commit
0b5650b8
authored
Jun 06, 2022
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
迁移NFT-sql消费
parent
a9e6e471
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
ConsumerCommonSqlRedisStreamConfig.java
...sumer/base/config/ConsumerCommonSqlRedisStreamConfig.java
+20
-0
ConsumerGoblinNftOrderRdsReceiver.java
...umer/base/receiver/ConsumerGoblinNftOrderRdsReceiver.java
+17
-0
No files found.
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-base/src/main/java/com/liquidnet/service/consumer/base/config/ConsumerCommonSqlRedisStreamConfig.java
View file @
0b5650b8
...
...
@@ -3,6 +3,7 @@ package com.liquidnet.service.consumer.base.config;
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.ConsumerGoblinNftOrderRdsReceiver
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -31,6 +32,9 @@ public class ConsumerCommonSqlRedisStreamConfig extends RedisStreamConfig {
@Autowired
ConsumerCommonSQL0Receiver
consumerCommonSQL0Receiver
;
@Autowired
ConsumerGoblinNftOrderRdsReceiver
consumerGoblinNftOrderRdsReceiver
;
// @Bean
// public List<Subscription> subscriptionSQL0(RedisConnectionFactory factory) {
// List<Subscription> subscriptionList = new ArrayList<>();
...
...
@@ -46,4 +50,20 @@ public class ConsumerCommonSqlRedisStreamConfig extends RedisStreamConfig {
// }
// return subscriptionList;
// }
@Bean
// goblin NFT订单
public
List
<
Subscription
>
subscriptionSqlNftOrder
(
RedisConnectionFactory
factory
)
{
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
GOBLIN_NFT_ORDER
;
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
for
(
int
i
=
0
;
i
<
20
;
i
++)
{
StreamMessageListenerContainer
<
String
,
MapRecord
<
String
,
String
,
String
>>
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
subscriptionList
.
add
(
listenerContainer
.
receiveAutoAck
(
Consumer
.
from
(
stream
.
getGroup
(),
getConsumerName
(
stream
.
name
()
+
i
)),
StreamOffset
.
create
(
stream
.
getKey
(),
ReadOffset
.
lastConsumed
()),
consumerGoblinNftOrderRdsReceiver
));
listenerContainer
.
start
();
}
return
subscriptionList
;
}
}
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-base/src/main/java/com/liquidnet/service/consumer/base/receiver/ConsumerGoblinNftOrderRdsReceiver.java
0 → 100644
View file @
0b5650b8
package
com
.
liquidnet
.
service
.
consumer
.
base
.
receiver
;
import
com.liquidnet.service.base.constant.MQConst
;
import
org.springframework.stereotype.Component
;
@Component
public
class
ConsumerGoblinNftOrderRdsReceiver
extends
AbstractSqlRedisReceiver
{
@Override
protected
String
getRedisStreamKey
()
{
return
MQConst
.
GoblinQueue
.
GOBLIN_NFT_ORDER
.
getKey
();
}
@Override
protected
String
getRedisStreamGroup
()
{
return
MQConst
.
GoblinQueue
.
GOBLIN_NFT_ORDER
.
getGroup
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment