Ability to configure a default topic and namespace
There is not currently a way to configure the default tenant and namespace to use.
As a result, users have to specify the tenant and namespace in their topic references - otherwise the default public/default is used.
It would improve user experience if there was a config property for tenant and namespace.
Original ask on Stackoverflow: https://stackoverflow.com/questions/78797365/configuring-namespace-and-tenant-for-spring-pulsar
I asked it Gen AI the same question and it came back with setting spring.pulsar.client.namespace and spring.pulsar.client.tenant. That seems to work. Is there a reason that wouldn't work?
Hi @eljefe6a
That seems to work.
Did you see it actually work :)
Is there a reason that wouldn't work?
Gen AI did pretty good in that is exactly what the property will be once implemented. It is not available currently (see PulsarProperties). Gen AI is smart enough to know the prefix is spring.pulsar and that it is likely in the client properties.
I can see this is flagged "needs auto-configuration". This broke the Spring Boot build and the deprecation note isn't helpful as the topic builder isn't auto-configured. Also, creating a new builder works so I am wondering if the deprecation note is correct or is Spring Pulsar only meant to be used with Spring Boot?
Thanks for the heads up @snicoll.
This broke the Spring Boot build
My bad, I did not realize that SB main had already updated to the 1.2.0-SNAPSHOT. I was already in the process of submitting a PR that updates to the latest.
and the deprecation note isn't helpful as the topic builder isn't auto-configured
The intent is to auto-configure it (PR mentioned above).
Also, creating a new builder works so I am wondering if the deprecation note is correct or is Spring Pulsar only meant to be used with Spring Boot?
Good point. I will adjust the deprecation note to include the non-SB usage as well.
I should have something submitted end-of-day.
Closing via https://github.com/spring-projects/spring-pulsar/commit/6d23378fbb57a50c3a302be136f9173d2854085d
Here is the SB PR https://github.com/spring-projects/spring-boot/pull/41851