记得上下班打卡 | 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
5f440e28
Commit
5f440e28
authored
May 11, 2022
by
zhanggb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~consumer-order:queue.listener;
parent
07ec3da0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
142 additions
and
142 deletions
+142
-142
ConsumerOrderCloseRedisStreamConfig.java
...mer/order/config/ConsumerOrderCloseRedisStreamConfig.java
+142
-142
No files found.
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-order/src/main/java/com/liquidnet/service/consumer/order/config/ConsumerOrderCloseRedisStreamConfig.java
View file @
5f440e28
...
@@ -59,149 +59,149 @@ public class ConsumerOrderCloseRedisStreamConfig extends RedisStreamConfig {
...
@@ -59,149 +59,149 @@ public class ConsumerOrderCloseRedisStreamConfig extends RedisStreamConfig {
return
subscriptionList
;
return
subscriptionList
;
}
}
@Bean
// 订单超时关闭
// @Bean// 订单超时关闭
public
List
<
Subscription
>
subscriptionBizOrderClose1
(
RedisConnectionFactory
factory
)
{
// public List<Subscription> subscriptionBizOrderClose1(RedisConnectionFactory factory) {
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
// List<Subscription> subscriptionList = new ArrayList<>();
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
GOBLIN_UN_PAY_1
;
// MQConst.GoblinQueue stream = MQConst.GoblinQueue.GOBLIN_UN_PAY_1;
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
// this.initStream(stringRedisTemplate, stream.getKey(), stream.getGroup());
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
// for (int i = 0; i < 10; 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
()),
consumerOrderClose1RdsReceiver
// StreamOffset.create(stream.getKey(), ReadOffset.lastConsumed()), consumerOrderClose1RdsReceiver
));
// ));
listenerContainer
.
start
();
// listenerContainer.start();
}
// }
return
subscriptionList
;
// return subscriptionList;
}
// }
@Bean
// 订单超时关闭
public
List
<
Subscription
>
subscriptionBizOrderClose2
(
RedisConnectionFactory
factory
)
{
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
GOBLIN_UN_PAY_2
;
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
for
(
int
i
=
0
;
i
<
10
;
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
()),
consumerOrderClose2RdsReceiver
));
listenerContainer
.
start
();
}
return
subscriptionList
;
}
@Bean
// 订单超时关闭
public
List
<
Subscription
>
subscriptionBizOrderClose3
(
RedisConnectionFactory
factory
)
{
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
GOBLIN_UN_PAY_3
;
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
for
(
int
i
=
0
;
i
<
10
;
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
()),
consumerOrderClose3RdsReceiver
));
listenerContainer
.
start
();
}
return
subscriptionList
;
}
@Bean
// 订单超时关闭
public
List
<
Subscription
>
subscriptionBizOrderClose4
(
RedisConnectionFactory
factory
)
{
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
GOBLIN_UN_PAY_4
;
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
for
(
int
i
=
0
;
i
<
10
;
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
()),
consumerOrderClose4RdsReceiver
));
listenerContainer
.
start
();
}
return
subscriptionList
;
}
@Bean
// 订单超时关闭
public
List
<
Subscription
>
subscriptionBizOrderClose5
(
RedisConnectionFactory
factory
)
{
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
GOBLIN_UN_PAY_5
;
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
for
(
int
i
=
0
;
i
<
10
;
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
()),
consumerOrderClose5RdsReceiver
));
listenerContainer
.
start
();
}
return
subscriptionList
;
}
@Bean
// 订单超时关闭
public
List
<
Subscription
>
subscriptionBizOrderClose6
(
RedisConnectionFactory
factory
)
{
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
GOBLIN_UN_PAY_6
;
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
for
(
int
i
=
0
;
i
<
10
;
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
()),
consumerOrderClose6RdsReceiver
));
listenerContainer
.
start
();
}
return
subscriptionList
;
}
@Bean
// 订单超时关闭
public
List
<
Subscription
>
subscriptionBizOrderClose7
(
RedisConnectionFactory
factory
)
{
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
GOBLIN_UN_PAY_7
;
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
for
(
int
i
=
0
;
i
<
10
;
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
()),
consumerOrderClose7RdsReceiver
));
listenerContainer
.
start
();
}
return
subscriptionList
;
}
@Bean
// 订单超时关闭
public
List
<
Subscription
>
subscriptionBizOrderClose8
(
RedisConnectionFactory
factory
)
{
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
GOBLIN_UN_PAY_8
;
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
for
(
int
i
=
0
;
i
<
10
;
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
()),
consumerOrderClose8RdsReceiver
));
listenerContainer
.
start
();
}
return
subscriptionList
;
}
@Bean
// 订单超时关闭
// @Bean// 订单超时关闭
public
List
<
Subscription
>
subscriptionBizOrderClose9
(
RedisConnectionFactory
factory
)
{
// public List<Subscription> subscriptionBizOrderClose2(RedisConnectionFactory factory) {
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
// List<Subscription> subscriptionList = new ArrayList<>();
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
GOBLIN_UN_PAY_9
;
// MQConst.GoblinQueue stream = MQConst.GoblinQueue.GOBLIN_UN_PAY_2;
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
// this.initStream(stringRedisTemplate, stream.getKey(), stream.getGroup());
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
// for (int i = 0; i < 10; 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
()),
consumerOrderClose9RdsReceiver
// StreamOffset.create(stream.getKey(), ReadOffset.lastConsumed()), consumerOrderClose2RdsReceiver
));
// ));
listenerContainer
.
start
();
// listenerContainer.start();
}
// }
return
subscriptionList
;
// return subscriptionList;
}
// }
//
// @Bean// 订单超时关闭
// public List<Subscription> subscriptionBizOrderClose3(RedisConnectionFactory factory) {
// List<Subscription> subscriptionList = new ArrayList<>();
// MQConst.GoblinQueue stream = MQConst.GoblinQueue.GOBLIN_UN_PAY_3;
// this.initStream(stringRedisTemplate, stream.getKey(), stream.getGroup());
// for (int i = 0; i < 10; 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()), consumerOrderClose3RdsReceiver
// ));
// listenerContainer.start();
// }
// return subscriptionList;
// }
//
// @Bean// 订单超时关闭
// public List<Subscription> subscriptionBizOrderClose4(RedisConnectionFactory factory) {
// List<Subscription> subscriptionList = new ArrayList<>();
// MQConst.GoblinQueue stream = MQConst.GoblinQueue.GOBLIN_UN_PAY_4;
// this.initStream(stringRedisTemplate, stream.getKey(), stream.getGroup());
// for (int i = 0; i < 10; 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()), consumerOrderClose4RdsReceiver
// ));
// listenerContainer.start();
// }
// return subscriptionList;
// }
//
// @Bean// 订单超时关闭
// public List<Subscription> subscriptionBizOrderClose5(RedisConnectionFactory factory) {
// List<Subscription> subscriptionList = new ArrayList<>();
// MQConst.GoblinQueue stream = MQConst.GoblinQueue.GOBLIN_UN_PAY_5;
// this.initStream(stringRedisTemplate, stream.getKey(), stream.getGroup());
// for (int i = 0; i < 10; 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()), consumerOrderClose5RdsReceiver
// ));
// listenerContainer.start();
// }
// return subscriptionList;
// }
//
// @Bean// 订单超时关闭
// public List<Subscription> subscriptionBizOrderClose6(RedisConnectionFactory factory) {
// List<Subscription> subscriptionList = new ArrayList<>();
// MQConst.GoblinQueue stream = MQConst.GoblinQueue.GOBLIN_UN_PAY_6;
// this.initStream(stringRedisTemplate, stream.getKey(), stream.getGroup());
// for (int i = 0; i < 10; 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()), consumerOrderClose6RdsReceiver
// ));
// listenerContainer.start();
// }
// return subscriptionList;
// }
//
// @Bean// 订单超时关闭
// public List<Subscription> subscriptionBizOrderClose7(RedisConnectionFactory factory) {
// List<Subscription> subscriptionList = new ArrayList<>();
// MQConst.GoblinQueue stream = MQConst.GoblinQueue.GOBLIN_UN_PAY_7;
// this.initStream(stringRedisTemplate, stream.getKey(), stream.getGroup());
// for (int i = 0; i < 10; 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()), consumerOrderClose7RdsReceiver
// ));
// listenerContainer.start();
// }
// return subscriptionList;
// }
//
// @Bean// 订单超时关闭
// public List<Subscription> subscriptionBizOrderClose8(RedisConnectionFactory factory) {
// List<Subscription> subscriptionList = new ArrayList<>();
// MQConst.GoblinQueue stream = MQConst.GoblinQueue.GOBLIN_UN_PAY_8;
// this.initStream(stringRedisTemplate, stream.getKey(), stream.getGroup());
// for (int i = 0; i < 10; 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()), consumerOrderClose8RdsReceiver
// ));
// listenerContainer.start();
// }
// return subscriptionList;
// }
//
// @Bean// 订单超时关闭
// public List<Subscription> subscriptionBizOrderClose9(RedisConnectionFactory factory) {
// List<Subscription> subscriptionList = new ArrayList<>();
// MQConst.GoblinQueue stream = MQConst.GoblinQueue.GOBLIN_UN_PAY_9;
// this.initStream(stringRedisTemplate, stream.getKey(), stream.getGroup());
// for (int i = 0; i < 10; 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()), consumerOrderClose9RdsReceiver
// ));
// listenerContainer.start();
// }
// return subscriptionList;
// }
// private Subscription receiveOrderClose0(StreamMessageListenerContainer<String, MapRecord<String, String, String>> listenerContainer, int t) {
// private Subscription receiveOrderClose0(StreamMessageListenerContainer<String, MapRecord<String, String, String>> listenerContainer, int t) {
...
...
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