Skip to content

Conversation

@onobc
Copy link
Contributor

@onobc onobc commented Mar 25, 2023

Adds initial support for Spring for Apache Pulsar.

Work remaining:

  • docs

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 25, 2023
@wilkinsona wilkinsona added status: on-hold We can't start working on this issue yet and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 28, 2023
@wilkinsona wilkinsona added this to the 3.x milestone Mar 28, 2023
@wilkinsona wilkinsona added the type: enhancement A general enhancement label Mar 28, 2023
@onobc onobc force-pushed the cbono-add-spring-pulsar branch 2 times, most recently from 2f389ef to 62f8300 Compare April 8, 2023 16:10
@onobc onobc force-pushed the cbono-add-spring-pulsar branch 2 times, most recently from 311750f to 225f4fa Compare April 18, 2023 17:56
@onobc onobc force-pushed the cbono-add-spring-pulsar branch 3 times, most recently from 3ed0990 to 8dac932 Compare April 21, 2023 17:17
@onobc onobc marked this pull request as draft April 28, 2023 19:07
@onobc onobc force-pushed the cbono-add-spring-pulsar branch from 8dac932 to 58c4232 Compare May 11, 2023 04:06
@onobc onobc marked this pull request as ready for review May 11, 2023 14:29
@onobc
Copy link
Contributor Author

onobc commented May 26, 2023

I have also added support for the following:

  • Pulsar connection details in auto-config
  • Pulsar service connection from testcontainers
  • Pulsar docker compose support + service connections from docker compose

These changes are in my fork (based off this same PR branch) in 3 separate commits, queued up and ready to PR once this base PR is merged:

@vpavic
Copy link
Contributor

vpavic commented Jul 12, 2023

Is this expected to target Spring Boot 3.2 as hinted in this blog post? I'm asking because this is still in 3.x milestone and work on 3.2 is well underway.

@wilkinsona wilkinsona self-assigned this Jul 14, 2023
@wilkinsona wilkinsona removed the status: on-hold We can't start working on this issue yet label Jul 14, 2023
@wilkinsona wilkinsona removed this from the 3.x milestone Jul 14, 2023
@onobc
Copy link
Contributor Author

onobc commented Aug 8, 2023

@wilkinsona I have covered all of the recent concerns other than:

  • too many modules (this will require change in Pulsar)
  • too many config props (I don't see a way to reduce this currently)
  • don't expose imperative components in reactive app (big effort to do this)
  • Add Kotlin examples to docs (would like to do in subsequent PR)

Thanks

@philwebb
Copy link
Member

philwebb commented Aug 8, 2023

I find the number of configuration properties quite a concern too. I wonder if we can just add the properties that we think will be popular and lean on PulsarClientBuilderCustomizer for the more exotic ones?

One thing we've learnt from previous features is it's easier to add properties later when they are needed than take them away because they aren't.

@wilkinsona
Copy link
Member

We discussed the properties in a team meeting yesterday (without Phil, he was on PTO) and came to the same conclusion. @snicoll reminded my that our Kafka support has got to where it is having evolved over many releases. This makes its large number of properties somewhat easier to justify. Our feeling is that we shouldn't jump straight into such a position with Pulsar and should instead provide plenty of room for things to evolve based on community feedback.

As Phil suggests, the room to evolve can be provided by using one or more customizer callbacks to configure things not covered by configuration properties. It then becomes a question of what should be a configuration property. We'd defer to you on that as we lack the Pulsar expertise to have an informed opinion. As a general rule of thumb, settings that change from environment to environment (dev, staging, prod and so on) are the strongest candidates for configuration properties. Next would be settings that are really commonly tuned. Ideally we'd see a 5-10x reduction in the number of properties that we offer to begin with.

Copy link
Member

@wilkinsona wilkinsona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the latest upgrades, @onobc. The main two points still to address are SSL and the configuration properties. Apologies again for only identifying SSL now. Hopefully there isn't anything else major that's still lurking.

@onobc
Copy link
Contributor Author

onobc commented Aug 8, 2023

Thanks for the latest upgrades, @onobc. The main two points still to address are SSL and the configuration properties. Apologies again for only identifying SSL now. Hopefully there isn't anything else major that's still lurking.

No worries on the SSL @wilkinsona - it is a big PR, there are many moving pieces - really thank you for the thorough reviews.

Also, I think it is a good thing to reduce the config props - the user still can get at any "switch" they need via the customizer (as pointed out by yourself and @philwebb ). Then the community will ask for what they want to be a property. I will sync w/ @sobychacko and we will come up w/ the reduced list.

@onobc
Copy link
Contributor Author

onobc commented Aug 9, 2023

We took a first pass and were able to knock it down from ~ 196 -> 136 which is about a 30% reduction.

We also verified that for all of the properties we are removing, the user has a way to customize them (we are good on that front).

NOTE This has not been committed yet - just wanted to run the numbers by the team while the tests are being updated etc..

Data below

NOTE: the Admin and Client have 8 + 12 and 30 + 14, respectively. These are the regular + ssl props. I believe the SSL related ones may go away when we move to SSL bundles but I am not 100% sure so I left it like this for now so we can see the count w/ and w/o the SSL props.

PulsarProperties Before After
Admin 8 + 12 8 + 12
Cache 3 3
Client 30 + 14 7 + 13
Defaults 1 1
Function 3 3
Listener 6 6
Reader 7 7
Template 1 1
ConsumerConfigProps 36 26
ProducerConfigProps 27 17
Total 122 79
ReactivePulsarProperties Before After
Cache 3 3
Consumer 34 27
Listener 3 3
Reader 8 8
Sender 26 16
Total 74 57
Original Total New Total
196 136

Which is about a 30% reduction.

The consumer and producer/sender config props (both imperative and reactive) are where most of the properties are. I am going to take another pass at those and see if we can drop it down further.

@onobc
Copy link
Contributor Author

onobc commented Aug 9, 2023

@wilkinsona @philwebb config props reduced ~50% w/ the latest commit.

Data below

NOTE: the Admin and Client have 8 + 12 and 30 + 14, respectively. These are the regular + ssl props. I believe the SSL related ones may go away when we move to SSL bundles but I am not 100% sure so I left it like this for now so we can see the count w/ and w/o the SSL props.

PulsarProperties Before After
Admin 8 + 12 8 + 12
Client 30 + 14 7 + 13
Defaults 1 1
Function 3 3
Listener 6 6
Reader 7 6
Template 1 1
ConsumerConfigProps 36 15
ProducerConfigProps 27 12
Total 119 59
ReactivePulsarProperties Before After
Consumer 34 17
Listener 3 3
Reader 8 6
Sender 26 12
Total 71 38
Original Total New Total % Reduction
190 97 51.05%

onobc and others added 4 commits September 4, 2023 13:32
Add support for Apache Pulsar using the Spring for Apache Pulsar
project.

Co-authored-by: Phillip Webb <pwebb@vmware.com>
* Add tests for customizers
* Break autoconfig out for cache/non-cache
* Add smoke tests
* Add consumer to the PulsarAutoConfigurationIntegrationTests
* Fix PulsarProperties.Consumer.DeadLetterPolicy
@onobc onobc force-pushed the cbono-add-spring-pulsar branch from 307c0af to 4940606 Compare September 4, 2023 18:33
@philwebb philwebb modified the milestones: 3.2.x, 3.2.0-M3 Sep 6, 2023
philwebb added a commit that referenced this pull request Sep 6, 2023
Add support for Apache Pulsar using the Spring for Apache Pulsar
project.

See gh-34763

Co-authored-by: Phillip Webb <pwebb@vmware.com>
@philwebb philwebb closed this in 59e591c Sep 6, 2023
@philwebb philwebb changed the title Add Spring for Apache Pulsar Add support for Spring for Apache Pulsar Sep 6, 2023
philwebb added a commit that referenced this pull request Sep 6, 2023
philwebb added a commit that referenced this pull request Oct 19, 2023
Prefer `null` to `-1` for the default timeout.

See gh-34763
@onobc onobc deleted the cbono-add-spring-pulsar branch May 28, 2024 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants