Skip to content
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

Add support for configuring Pulsar listener container concurrency #42062

Closed

Conversation

vpavic
Copy link
Contributor

@vpavic vpavic commented Aug 30, 2024

This commit adds configuration property that allows users to configure Pulsar message listener container concurrency.


In similar fashion to #42052, this is much needed to achieve optimal setup of message consumption, especially when dealing with partitioned topics.

/cc @onobc

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 30, 2024
Copy link
Contributor

@onobc onobc 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 contribution @vpavic . I believe this is another property that makes sense to make available via config props.

I have a couple of comments/suggestions to follow up on.

Thanks

@@ -801,6 +802,11 @@ public static class Listener {
*/
private SchemaType schemaType;

/**
* Number of threads used by listener container.
Copy link
Contributor

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:

Number of listener threads used by the container to process messages concurrently

Wdyt?

Copy link
Contributor Author

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:

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

tried to aligned property description with these

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.

@@ -195,6 +197,13 @@ private void customizePulsarContainerListenerProperties(PulsarContainerPropertie
map.from(properties::isObservationEnabled).to(containerProperties::setObservationEnabled);
}

<T> void customizeConcurrentPulsarListenerContainerFactory(
Copy link
Contributor

Choose a reason for hiding this comment

The 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 concurrency attribute between reactive and imperative. I created this issue to simplify the latter.
If you wanted to handle that issue first it would then simplify this PR so that we would not need this new customizeConcurrentPulsarListenerContainerFactory method and could simply map the property in customizePulsarContainerListenerProperties instead.

Copy link
Contributor Author

@vpavic vpavic Sep 2, 2024

Choose a reason for hiding this comment

The 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.

Copy link
Contributor

Choose a reason for hiding this comment

The 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 blocker until spring-projects/spring-pulsar#820 is resolved.

Thanks @vpavic . Yeh, I think we should do the spring-pulsar one first.

@philwebb philwebb added the status: waiting-for-feedback We need additional information before we can continue label Aug 30, 2024
This commit adds configuration property that allows users to configure
Pulsar message listener container concurrency.
@vpavic vpavic force-pushed the pulsar-listener-concurrency branch from 01e745e to 7601951 Compare September 2, 2024 15:17
@philwebb philwebb added type: enhancement A general enhancement and removed status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged labels Sep 3, 2024
@philwebb philwebb added this to the 3.4.x milestone Sep 3, 2024
philwebb pushed a commit that referenced this pull request Sep 4, 2024
Add a configuration property that allows users to configure Pulsar
message listener container concurrency.

See gh-42062
@philwebb philwebb closed this in 3570c69 Sep 4, 2024
@philwebb philwebb modified the milestones: 3.4.x, 3.4.0-M3 Sep 4, 2024
@philwebb
Copy link
Member

philwebb commented Sep 4, 2024

Thanks @vpavic!

@vpavic vpavic deleted the pulsar-listener-concurrency branch September 4, 2024 08:29
vpavic added a commit to vpavic/spring-boot that referenced this pull request Sep 4, 2024
This is a follow-up to spring-projectsgh-42062 that utilizes newly introduced
`concurrency` property in `PulsarContainerProperties` to simplify
auto-configuration support for Pulsar listener container concurrency.

See: spring-projects/spring-pulsar#820
@vpavic
Copy link
Contributor Author

vpavic commented Sep 4, 2024

@philwebb this was merged perhaps too soon as I didn't have chance to update this PR to benefit from the changes introduced in spring-projects/spring-pulsar#820.

I've opened #42120 to address that separately.

vpavic added a commit to vpavic/spring-boot that referenced this pull request Sep 4, 2024
This is a follow-up to spring-projectsgh-42062 that utilizes newly introduced
`concurrency` property in `PulsarContainerProperties` to simplify
auto-configuration support for Pulsar listener container concurrency.

See: spring-projects/spring-pulsar#820
vpavic added a commit to vpavic/spring-boot that referenced this pull request Sep 4, 2024
This is a follow-up to spring-projectsgh-42062 that utilizes newly introduced
`concurrency` property in `PulsarContainerProperties` to simplify
auto-configuration support for Pulsar listener container concurrency.

See: spring-projects/spring-pulsar#820
wilkinsona pushed a commit that referenced this pull request Sep 5, 2024
This is a follow-up to gh-42062 that utilizes newly introduced
`concurrency` property in `PulsarContainerProperties` to simplify
auto-configuration support for Pulsar listener container concurrency.

See: spring-projects/spring-pulsar#820

See gh-42120
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.

4 participants