Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sample-form-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
sample-form-platform
Commits
aaab196b
Commit
aaab196b
authored
Jun 19, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加材料排序
parent
224d3fb0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
41 deletions
+7
-41
common-lib/pom.xml
common-lib/pom.xml
+7
-0
common-lib/src/main/java/com/mortals/xhx/system/RabbitConfig.java
...ib/src/main/java/com/mortals/xhx/system/RabbitConfig.java
+0
-41
No files found.
common-lib/pom.xml
View file @
aaab196b
...
@@ -53,6 +53,13 @@
...
@@ -53,6 +53,13 @@
<artifactId>
guava
</artifactId>
<artifactId>
guava
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
com.rabbitmq
</groupId>
<artifactId>
amqp-client
</artifactId>
<version>
4.8.0
</version>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-amqp
</artifactId>
<artifactId>
spring-boot-starter-amqp
</artifactId>
...
...
common-lib/src/main/java/com/mortals/xhx/system/RabbitConfig.java
deleted
100644 → 0
View file @
224d3fb0
package
com.mortals.xhx.system
;
import
org.springframework.amqp.rabbit.AsyncRabbitTemplate
;
import
org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory
;
import
org.springframework.amqp.rabbit.connection.ConnectionFactory
;
import
org.springframework.amqp.rabbit.core.RabbitTemplate
;
import
org.springframework.boot.autoconfigure.amqp.SimpleRabbitListenerContainerFactoryConfigurer
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
public
class
RabbitConfig
{
//@Bean(name = "consumerBatchContainerFactory")
public
SimpleRabbitListenerContainerFactory
consumerBatchContainerFactory
(
SimpleRabbitListenerContainerFactoryConfigurer
configurer
,
ConnectionFactory
connectionFactory
)
{
// 创建 SimpleRabbitListenerContainerFactory 对象
SimpleRabbitListenerContainerFactory
factory
=
new
SimpleRabbitListenerContainerFactory
();
configurer
.
configure
(
factory
,
connectionFactory
);
// 额外添加批量消费的属性
factory
.
setBatchListener
(
true
);
factory
.
setBatchSize
(
10
);
factory
.
setReceiveTimeout
(
30
*
1000L
);
factory
.
setConsumerBatchEnabled
(
true
);
return
factory
;
}
//修改系列和与反序列化转换器
// @Bean
// public MessageConverter messageConverter() {
// return new Jackson2JsonMessageConverter();
// }
//@Bean
public
AsyncRabbitTemplate
asyncRabbitTemplate
(
RabbitTemplate
rabbitTemplate
)
{
AsyncRabbitTemplate
asyncRabbitTemplate
=
new
AsyncRabbitTemplate
(
rabbitTemplate
);
asyncRabbitTemplate
.
setReceiveTimeout
(
10000
);
return
asyncRabbitTemplate
;
}
}
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