-
Notifications
You must be signed in to change notification settings - Fork 41.3k
Add support for configuring Pulsar listener container concurrency #42062
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ | |
|
||
import org.springframework.boot.context.properties.PropertyMapper; | ||
import org.springframework.boot.json.JsonWriter; | ||
import org.springframework.pulsar.config.ConcurrentPulsarListenerContainerFactory; | ||
import org.springframework.pulsar.core.PulsarTemplate; | ||
import org.springframework.pulsar.listener.PulsarContainerProperties; | ||
import org.springframework.pulsar.reader.PulsarReaderContainerProperties; | ||
|
@@ -198,6 +199,13 @@ private void customizePulsarContainerListenerProperties(PulsarContainerPropertie | |
map.from(properties::isObservationEnabled).to(containerProperties::setObservationEnabled); | ||
} | ||
|
||
<T> void customizeConcurrentPulsarListenerContainerFactory( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just noticed that the listener containers on the framework side are inconsistent w/ the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, I can pick up that issue on Spring Pulsar side. So basically this PR is then blocked until spring-projects/spring-pulsar#820 is resolved. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Thanks @vpavic . Yeh, I think we should do the spring-pulsar one first. |
||
ConcurrentPulsarListenerContainerFactory<T> listenerContainerFactory) { | ||
PulsarProperties.Listener properties = this.properties.getListener(); | ||
PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull(); | ||
map.from(properties::getConcurrency).to(listenerContainerFactory::setConcurrency); | ||
} | ||
|
||
<T> void customizeReaderBuilder(ReaderBuilder<T> readerBuilder) { | ||
PulsarProperties.Reader properties = this.properties.getReader(); | ||
PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be helpful to elaborate on this one just a bit, maybe something like:
Wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to aligned property description with these:
spring-boot/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java
Lines 976 to 979 in c06027b
spring-boot/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsProperties.java
Lines 171 to 180 in c06027b
spring-boot/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java
Lines 852 to 860 in c06027b
As a user I'd probably prefer consistency in describing the same concept in different parts of auto-configuration, but whatever Spring Boot team prefers here is fine with me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I saw those descriptions as well. I think there is room for improvement in the spring-kafka properties. This is really a nit and consistency is a good thing. As you said, let's see what Boot peepz think.