Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
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
YZG
yzg-util
Commits
f1d8fa8a
Commit
f1d8fa8a
authored
Dec 10, 2019
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口文档的支持
parent
85a5cbc8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
MqConsumeDynamic.java
...c/main/java/com/yanzuoguang/mq/base/MqConsumeDynamic.java
+12
-3
No files found.
yzg-util-mq/src/main/java/com/yanzuoguang/mq/base/MqConsumeDynamic.java
View file @
f1d8fa8a
...
...
@@ -26,15 +26,24 @@ public class MqConsumeDynamic {
@Resource
private
RabbitAdmin
rabbitAdmin
;
@Value
(
"${yzg.onOfConsumer:10}"
)
private
int
onOfConsumer
;
@Value
(
"${spring.rabbitmq.listener.concurrency:1}"
)
private
int
concurrency
;
@Value
(
"${spring.rabbitmq.listener.max-concurrency:10}"
)
private
int
maxConcurrency
;
@Value
(
"${spring.rabbitmq.listener.prefetch:100}"
)
private
int
prefetch
;
@Value
(
"${spring.rabbitmq.listener.transaction-size:100}"
)
private
int
txSize
;
public
SimpleMessageListenerContainer
init
(
String
queueName
,
ChannelAwareMessageListener
messageListener
)
{
ConsumerSimpleMessageListenerContainer
container
=
new
ConsumerSimpleMessageListenerContainer
();
container
.
setConnectionFactory
(
connectionFactory
);
container
.
setAcknowledgeMode
(
AcknowledgeMode
.
MANUAL
);
container
.
setQueueNames
(
queueName
);
container
.
setConcurrentConsumers
(
onOfConsumer
);
container
.
setConcurrentConsumers
(
concurrency
);
container
.
setMaxConcurrentConsumers
(
maxConcurrency
);
container
.
setPrefetchCount
(
prefetch
);
container
.
setTxSize
(
txSize
);
container
.
setMessageListener
(
new
MessageListenerAdapter
(
messageListener
));
container
.
start
();
return
container
;
...
...
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