This adjusts the `PulsarTemplate` to log a warning when a user provides a `ProducerBuilderCustomizer` that is implemented as a Java Lambda. This is important as the customizer is used as part of the producer cache key and if not implemented properly will effectively disable producer caching and write performance will degrade. See #809
69 lines
2.2 KiB
Groovy
69 lines
2.2 KiB
Groovy
plugins {
|
|
id 'org.springframework.pulsar.spring-unpublished-module'
|
|
id 'spring-pulsar.integration-test-conventions'
|
|
alias(libs.plugins.download)
|
|
}
|
|
|
|
description = 'Spring Pulsar Integration Tests'
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven { url 'https://repo.spring.io/milestone' }
|
|
maven { url 'https://repo.spring.io/snapshot' }
|
|
}
|
|
|
|
dependencies {
|
|
intTestImplementation project(':spring-pulsar')
|
|
intTestImplementation project(':spring-pulsar-reactive')
|
|
intTestImplementation project(':spring-pulsar-test')
|
|
intTestImplementation 'org.awaitility:awaitility'
|
|
intTestImplementation 'org.testcontainers:junit-jupiter'
|
|
intTestImplementation 'org.testcontainers:pulsar'
|
|
intTestImplementation 'org.testcontainers:rabbitmq'
|
|
intTestImplementation libs.spring.boot.starter.test
|
|
intTestImplementation libs.spring.boot.starter.amqp
|
|
// Exclude spring-pulsar from boot in order to use current changes in project
|
|
intTestImplementation(libs.spring.boot.starter.pulsar) {
|
|
exclude group: "org.springframework.pulsar", module: "spring-pulsar"
|
|
}
|
|
intTestImplementation(libs.spring.boot.starter.pulsar.reactive) {
|
|
exclude group: "org.springframework.pulsar", module: "spring-pulsar-reactive"
|
|
}
|
|
intTestImplementation libs.spring.boot.testcontainers
|
|
intTestRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
|
intTestRuntimeOnly libs.logback.classic
|
|
}
|
|
|
|
test {
|
|
testLogging.showStandardStreams = true
|
|
}
|
|
|
|
integrationTest {
|
|
maxHeapSize '2048m'
|
|
}
|
|
|
|
def versionCatalog = extensions.getByType(VersionCatalogsExtension).named("libs")
|
|
def pulsarVersion = versionCatalog.findVersion("pulsar").orElseThrow().displayName
|
|
|
|
task downloadRabbitConnector {
|
|
onlyIf {
|
|
System.getProperty("downloadRabbitConnector") == "true"
|
|
}
|
|
doLast {
|
|
try {
|
|
download.run {
|
|
println "Downloading Rabbit connector to 'src/intTest/resources/connectors/' (one time only if not already downloaded)..."
|
|
src "https://archive.apache.org/dist/pulsar/pulsar-${pulsarVersion}/connectors/pulsar-io-rabbitmq-${pulsarVersion}.nar"
|
|
dest "$buildDir/../src/intTest/resources/connectors/pulsar-io-rabbitmq-${pulsarVersion}.nar"
|
|
overwrite false
|
|
}
|
|
} catch (Exception ex) {
|
|
println "Failed to download rabbit connector: $ex"
|
|
}
|
|
}
|
|
}
|
|
|
|
project.afterEvaluate {
|
|
integrationTest.dependsOn downloadRabbitConnector
|
|
}
|