forked from TencentBlueKing/bk-ci
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 引擎等MQ场景接入SCS框架 TencentBlueKing#7443
- Loading branch information
1 parent
79278a2
commit 25c1ab9
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
.../kotlin/com/tencent/devops/common/stream/customizer/BkProducerMessageHandlerCustomizer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.tencent.devops.common.stream.customizer | ||
|
||
import org.slf4j.LoggerFactory | ||
import org.springframework.cloud.stream.config.ProducerMessageHandlerCustomizer | ||
import org.springframework.integration.amqp.outbound.AmqpOutboundEndpoint | ||
|
||
class BkProducerMessageHandlerCustomizer : ProducerMessageHandlerCustomizer<AmqpOutboundEndpoint> { | ||
override fun configure(handler: AmqpOutboundEndpoint, destinationName: String) { | ||
logger.info("handler customizer , destinationName: $destinationName , handler: ${handler.beanName}") | ||
handler.rabbitTemplate?.isUsePublisherConnection = false // 生产者和消费者共享连接池, 提高性能 | ||
} | ||
|
||
companion object { | ||
private val logger = LoggerFactory.getLogger(BkProducerMessageHandlerCustomizer::class.java) | ||
} | ||
} |