记得上下班打卡 | 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
f343908f
Commit
f343908f
authored
Jun 15, 2022
by
zhanggb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~queue:goblin.SQL_STORE、SQL_GOODS、SQL_COUPON、SQL_ARTWORK_GEN;
parent
fd709cc4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
227 additions
and
88 deletions
+227
-88
ConsumerCommonSqlRedisStreamConfig.java
...sumer/base/config/ConsumerCommonSqlRedisStreamConfig.java
+88
-17
ConsumerGoblinSqlArtworkGenRdsReceiver.java
...base/receiver/ConsumerGoblinSqlArtworkGenRdsReceiver.java
+17
-0
ConsumerGoblinSqlCouponRdsReceiver.java
...mer/base/receiver/ConsumerGoblinSqlCouponRdsReceiver.java
+17
-0
ConsumerGoblinSqlGoodsRdsReceiver.java
...umer/base/receiver/ConsumerGoblinSqlGoodsRdsReceiver.java
+17
-0
ConsumerGoblinSqlStoreRdsReceiver.java
...umer/base/receiver/ConsumerGoblinSqlStoreRdsReceiver.java
+17
-0
ConsumerCommonSqlRedisStreamConfig.java
...mer/slowly/config/ConsumerCommonSqlRedisStreamConfig.java
+71
-71
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 @
f343908f
...
...
@@ -2,8 +2,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
com.liquidnet.service.consumer.base.receiver.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -34,6 +33,30 @@ public class ConsumerCommonSqlRedisStreamConfig extends RedisStreamConfig {
@Autowired
ConsumerGoblinNftOrderRdsReceiver
consumerGoblinNftOrderRdsReceiver
;
@Autowired
ConsumerGoblinSqlStoreRdsReceiver
consumerGoblinSqlStoreRdsReceiver
;
@Autowired
ConsumerGoblinSqlGoodsRdsReceiver
consumerGoblinSqlGoodsRdsReceiver
;
@Autowired
ConsumerGoblinSqlCouponRdsReceiver
consumerGoblinSqlCouponRdsReceiver
;
@Autowired
ConsumerGoblinSqlArtworkGenRdsReceiver
consumerGoblinSqlArtworkGenRdsReceiver
;
// @Bean
// public List<Subscription> subscriptionSQL0(RedisConnectionFactory factory) {
// List<Subscription> subscriptionList = new ArrayList<>();
// MQConst.CommonQueue stream = MQConst.CommonQueue.SQL0;
// this.initStream(stringRedisTemplate, stream.getKey(), stream.getGroup());
// for (int i = 0; i < 5; 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()), consumerCommonSQL0Receiver
// ));
// listenerContainer.start();
// }
// return subscriptionList;
// }
/**
* goblinNFT订单
...
...
@@ -56,19 +79,67 @@ public class ConsumerCommonSqlRedisStreamConfig extends RedisStreamConfig {
return
subscriptionList
;
}
// @Bean
// public List<Subscription> subscriptionSQL0(RedisConnectionFactory factory) {
// List<Subscription> subscriptionList = new ArrayList<>();
// MQConst.CommonQueue stream = MQConst.CommonQueue.SQL0;
// this.initStream(stringRedisTemplate, stream.getKey(), stream.getGroup());
// for (int i = 0; i < 5; 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()), consumerCommonSQL0Receiver
// ));
// listenerContainer.start();
// }
// return subscriptionList;
// }
@Bean
// 店铺相关
public
List
<
Subscription
>
subscriptionGoblinSqlStore
(
RedisConnectionFactory
factory
)
{
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
SQL_STORE
;
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
for
(
int
i
=
0
;
i
<
1
;
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
()),
consumerGoblinSqlStoreRdsReceiver
));
listenerContainer
.
start
();
}
return
subscriptionList
;
}
@Bean
// 商品相关
public
List
<
Subscription
>
subscriptionGoblinSqlGoods
(
RedisConnectionFactory
factory
)
{
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
SQL_GOODS
;
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
for
(
int
i
=
0
;
i
<
1
;
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
()),
consumerGoblinSqlGoodsRdsReceiver
));
listenerContainer
.
start
();
}
return
subscriptionList
;
}
@Bean
// 店铺优惠券相关
public
List
<
Subscription
>
subscriptionGoblinSqlStoreCoupon
(
RedisConnectionFactory
factory
)
{
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
SQL_COUPON
;
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
for
(
int
i
=
0
;
i
<
1
;
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
()),
consumerGoblinSqlCouponRdsReceiver
));
listenerContainer
.
start
();
}
return
subscriptionList
;
}
@Bean
// 藏品生成
public
List
<
Subscription
>
subscriptionGoblinSqlArtworkGen
(
RedisConnectionFactory
factory
)
{
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
SQL_ARTWORK_GEN
;
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
for
(
int
i
=
0
;
i
<
5
;
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
()),
consumerGoblinSqlArtworkGenRdsReceiver
));
listenerContainer
.
start
();
}
return
subscriptionList
;
}
}
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-base/src/main/java/com/liquidnet/service/consumer/base/receiver/ConsumerGoblinSqlArtworkGenRdsReceiver.java
0 → 100644
View file @
f343908f
package
com
.
liquidnet
.
service
.
consumer
.
base
.
receiver
;
import
com.liquidnet.service.base.constant.MQConst
;
import
org.springframework.stereotype.Component
;
@Component
public
class
ConsumerGoblinSqlArtworkGenRdsReceiver
extends
AbstractSqlRedisReceiver
{
@Override
protected
String
getRedisStreamKey
()
{
return
MQConst
.
GoblinQueue
.
SQL_ARTWORK_GEN
.
getKey
();
}
@Override
protected
String
getRedisStreamGroup
()
{
return
MQConst
.
GoblinQueue
.
SQL_ARTWORK_GEN
.
getGroup
();
}
}
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-base/src/main/java/com/liquidnet/service/consumer/base/receiver/ConsumerGoblinSqlCouponRdsReceiver.java
0 → 100644
View file @
f343908f
package
com
.
liquidnet
.
service
.
consumer
.
base
.
receiver
;
import
com.liquidnet.service.base.constant.MQConst
;
import
org.springframework.stereotype.Component
;
@Component
public
class
ConsumerGoblinSqlCouponRdsReceiver
extends
AbstractSqlRedisReceiver
{
@Override
protected
String
getRedisStreamKey
()
{
return
MQConst
.
GoblinQueue
.
SQL_COUPON
.
getKey
();
}
@Override
protected
String
getRedisStreamGroup
()
{
return
MQConst
.
GoblinQueue
.
SQL_COUPON
.
getGroup
();
}
}
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-base/src/main/java/com/liquidnet/service/consumer/base/receiver/ConsumerGoblinSqlGoodsRdsReceiver.java
0 → 100644
View file @
f343908f
package
com
.
liquidnet
.
service
.
consumer
.
base
.
receiver
;
import
com.liquidnet.service.base.constant.MQConst
;
import
org.springframework.stereotype.Component
;
@Component
public
class
ConsumerGoblinSqlGoodsRdsReceiver
extends
AbstractSqlRedisReceiver
{
@Override
protected
String
getRedisStreamKey
()
{
return
MQConst
.
GoblinQueue
.
SQL_GOODS
.
getKey
();
}
@Override
protected
String
getRedisStreamGroup
()
{
return
MQConst
.
GoblinQueue
.
SQL_GOODS
.
getGroup
();
}
}
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-base/src/main/java/com/liquidnet/service/consumer/base/receiver/ConsumerGoblinSqlStoreRdsReceiver.java
0 → 100644
View file @
f343908f
package
com
.
liquidnet
.
service
.
consumer
.
base
.
receiver
;
import
com.liquidnet.service.base.constant.MQConst
;
import
org.springframework.stereotype.Component
;
@Component
public
class
ConsumerGoblinSqlStoreRdsReceiver
extends
AbstractSqlRedisReceiver
{
@Override
protected
String
getRedisStreamKey
()
{
return
MQConst
.
GoblinQueue
.
SQL_STORE
.
getKey
();
}
@Override
protected
String
getRedisStreamGroup
()
{
return
MQConst
.
GoblinQueue
.
SQL_STORE
.
getGroup
();
}
}
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-slowly/src/main/java/com/liquidnet/service/consumer/slowly/config/ConsumerCommonSqlRedisStreamConfig.java
View file @
f343908f
...
...
@@ -22,80 +22,80 @@ import java.util.List;
public
class
ConsumerCommonSqlRedisStreamConfig
extends
RedisStreamConfig
{
@Autowired
StringRedisTemplate
stringRedisTemplate
;
@Autowired
ConsumerGoblinSqlStoreRdsReceiver
consumerGoblinSqlStoreRdsReceiver
;
@Autowired
ConsumerGoblinSqlGoodsRdsReceiver
consumerGoblinSqlGoodsRdsReceiver
;
@Autowired
ConsumerGoblinSqlCouponRdsReceiver
consumerGoblinSqlCouponRdsReceiver
;
@Autowired
ConsumerGoblinSqlArtworkGenRdsReceiver
consumerGoblinSqlArtworkGenRdsReceiver
;
//
@Autowired
//
ConsumerGoblinSqlStoreRdsReceiver consumerGoblinSqlStoreRdsReceiver;
//
@Autowired
//
ConsumerGoblinSqlGoodsRdsReceiver consumerGoblinSqlGoodsRdsReceiver;
//
@Autowired
//
ConsumerGoblinSqlCouponRdsReceiver consumerGoblinSqlCouponRdsReceiver;
//
@Autowired
//
ConsumerGoblinSqlArtworkGenRdsReceiver consumerGoblinSqlArtworkGenRdsReceiver;
// @Autowired
// ConsumerGoblinNftOrderRdsReceiver consumerGoblinNftOrderRdsReceiver;
@Bean
// 店铺相关
public
List
<
Subscription
>
subscriptionSqlStore
(
RedisConnectionFactory
factory
)
{
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
SQL_STORE
;
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
for
(
int
i
=
0
;
i
<
1
;
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
()),
consumerGoblinSqlStoreRdsReceiver
));
listenerContainer
.
start
();
}
return
subscriptionList
;
}
@Bean
// 商品相关
public
List
<
Subscription
>
subscriptionSqlGoods
(
RedisConnectionFactory
factory
)
{
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
SQL_GOODS
;
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
for
(
int
i
=
0
;
i
<
1
;
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
()),
consumerGoblinSqlGoodsRdsReceiver
));
listenerContainer
.
start
();
}
return
subscriptionList
;
}
@Bean
// 店铺优惠券相关
public
List
<
Subscription
>
subscriptionSqlStoreCoupon
(
RedisConnectionFactory
factory
)
{
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
SQL_COUPON
;
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
for
(
int
i
=
0
;
i
<
1
;
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
()),
consumerGoblinSqlCouponRdsReceiver
));
listenerContainer
.
start
();
}
return
subscriptionList
;
}
@Bean
// 藏品生成
public
List
<
Subscription
>
subscriptionSqlArtworkGen
(
RedisConnectionFactory
factory
)
{
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
SQL_ARTWORK_GEN
;
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
for
(
int
i
=
0
;
i
<
5
;
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
()),
consumerGoblinSqlArtworkGenRdsReceiver
));
listenerContainer
.
start
();
}
return
subscriptionList
;
}
//
@Bean// 店铺相关
//
public List<Subscription> subscriptionSqlStore(RedisConnectionFactory factory) {
//
List<Subscription> subscriptionList = new ArrayList<>();
//
MQConst.GoblinQueue stream = MQConst.GoblinQueue.SQL_STORE;
//
this.initStream(stringRedisTemplate, stream.getKey(), stream.getGroup());
//
for (int i = 0; i < 1; 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()), consumerGoblinSqlStoreRdsReceiver
//
));
//
listenerContainer.start();
//
}
//
return subscriptionList;
//
}
//
//
@Bean// 商品相关
//
public List<Subscription> subscriptionSqlGoods(RedisConnectionFactory factory) {
//
List<Subscription> subscriptionList = new ArrayList<>();
//
MQConst.GoblinQueue stream = MQConst.GoblinQueue.SQL_GOODS;
//
this.initStream(stringRedisTemplate, stream.getKey(), stream.getGroup());
//
for (int i = 0; i < 1; 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()), consumerGoblinSqlGoodsRdsReceiver
//
));
//
listenerContainer.start();
//
}
//
return subscriptionList;
//
}
//
//
@Bean// 店铺优惠券相关
//
public List<Subscription> subscriptionSqlStoreCoupon(RedisConnectionFactory factory) {
//
List<Subscription> subscriptionList = new ArrayList<>();
//
MQConst.GoblinQueue stream = MQConst.GoblinQueue.SQL_COUPON;
//
this.initStream(stringRedisTemplate, stream.getKey(), stream.getGroup());
//
for (int i = 0; i < 1; 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()), consumerGoblinSqlCouponRdsReceiver
//
));
//
listenerContainer.start();
//
}
//
return subscriptionList;
//
}
//
//
@Bean// 藏品生成
//
public List<Subscription> subscriptionSqlArtworkGen(RedisConnectionFactory factory) {
//
List<Subscription> subscriptionList = new ArrayList<>();
//
MQConst.GoblinQueue stream = MQConst.GoblinQueue.SQL_ARTWORK_GEN;
//
this.initStream(stringRedisTemplate, stream.getKey(), stream.getGroup());
//
for (int i = 0; i < 5; 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()), consumerGoblinSqlArtworkGenRdsReceiver
//
));
//
listenerContainer.start();
//
}
//
return subscriptionList;
//
}
// @Bean// NFT订单
// public List<Subscription> subscriptionSqlNftOrder(RedisConnectionFactory factory) {
...
...
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