-
Notifications
You must be signed in to change notification settings - Fork 68
Use type safe structures to configure the consumer #188
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
Conversation
5fc1979
to
8e78150
Compare
spring-pulsar/src/main/java/org/springframework/pulsar/core/DefaultPulsarConsumerFactory.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/springframework/pulsar/listener/DefaultPulsarMessageListenerContainer.java
Show resolved
Hide resolved
8e78150
to
a285a7c
Compare
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.
@cbornet thanks for this code proposal. I am all for using the type-safe configuration options but I am wondering if the benefits are outweighing the drawbacks at this point.
Concern 1 - added field mappings
The manual mappings (aka the heroics) we are having to do in the DPMLC and the DPCF may outweigh the benefits of this type-safe change. I do realize some of this is due to bugs in the config data impl and will eventually be addressed.
Concern 2 - is config data public?
In digging around for the client and producer config data side of things, I noticed that all of these config datas are in the "impl" package and are not exposed by the interfaces. They are only exposed by the default implementations. I believe this is the reason there is only a loadConf(Map)
and not a loadConf(<type>ConfigurationData)
. I think before going forward we need to be sure that the config data is considered part of the public API. It does not seem that way to me after digging in a bit.
I reviewed all of the changes except for the tests/**. I want to wait until we talk about the above concerns before I invest in reviewing the tests (but mostly because it is late now 😄 )
...t-autoconfigure/src/main/java/org/springframework/pulsar/autoconfigure/PulsarProperties.java
Outdated
Show resolved
Hide resolved
...t-autoconfigure/src/main/java/org/springframework/pulsar/autoconfigure/PulsarProperties.java
Outdated
Show resolved
Hide resolved
spring-pulsar/src/main/java/org/springframework/pulsar/core/PulsarConsumerFactory.java
Outdated
Show resolved
Hide resolved
spring-pulsar/src/main/java/org/springframework/pulsar/core/DefaultPulsarConsumerFactory.java
Outdated
Show resolved
Hide resolved
spring-pulsar/src/main/java/org/springframework/pulsar/core/DefaultPulsarConsumerFactory.java
Show resolved
Hide resolved
spring-pulsar/src/main/java/org/springframework/pulsar/core/DefaultPulsarConsumerFactory.java
Outdated
Show resolved
Hide resolved
spring-pulsar/src/main/java/org/springframework/pulsar/core/DefaultPulsarConsumerFactory.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/springframework/pulsar/listener/DefaultPulsarMessageListenerContainer.java
Show resolved
Hide resolved
...src/main/java/org/springframework/pulsar/listener/DefaultPulsarMessageListenerContainer.java
Show resolved
Hide resolved
You're totally right that My preference goes to option 2/ |
a285a7c
to
c2d539c
Compare
spring-pulsar/src/main/java/org/springframework/pulsar/core/PulsarConsumerFactory.java
Outdated
Show resolved
Hide resolved
spring-pulsar/src/main/java/org/springframework/pulsar/core/PulsarConsumerFactory.java
Outdated
Show resolved
Hide resolved
spring-pulsar/src/main/java/org/springframework/pulsar/core/PulsarConsumerFactory.java
Show resolved
Hide resolved
spring-pulsar/src/main/java/org/springframework/pulsar/core/DefaultPulsarConsumerFactory.java
Show resolved
Hide resolved
spring-pulsar/src/main/java/org/springframework/pulsar/core/DefaultPulsarConsumerFactory.java
Outdated
Show resolved
Hide resolved
spring-pulsar/src/main/java/org/springframework/pulsar/core/DefaultPulsarConsumerFactory.java
Show resolved
Hide resolved
...src/main/java/org/springframework/pulsar/listener/DefaultPulsarMessageListenerContainer.java
Show resolved
Hide resolved
...src/main/java/org/springframework/pulsar/listener/DefaultPulsarMessageListenerContainer.java
Show resolved
Hide resolved
Superseded by #192 |
ConsumerBuilderCustomizer
to customize the consumer when creating itBatchReceivePolicy
from thecreateConsumer
params as it can now be configured throughConsumerBuilderCustomizer
createConsumer(Schema<T> schema, Collection<String> topics, Map<String, String> properties, List<ConsumerBuilderCustomizer<T>> customizers)
to be able to replace the topics and the consumer properties (the builder methods can only add to the default).ackTimeoutMillis
to 1000 instead of 1 in tests as the ack timeout must not be below 1 second (and now it's checked by the code 🙂)