Skip to content

Add tests for SpEL attributes on @PulsarListener #549

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

Merged
merged 6 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
import org.apache.pulsar.common.schema.SchemaType;

import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.pulsar.config.PulsarListenerContainerFactory;
import org.springframework.pulsar.reactive.config.ReactivePulsarListenerContainerFactory;
import org.springframework.pulsar.reactive.config.ReactivePulsarListenerEndpointRegistry;
import org.springframework.pulsar.reactive.core.ReactiveMessageConsumerBuilderCustomizer;

/**
* Annotation that marks a method to be the target of a Pulsar message listener on the
Expand Down Expand Up @@ -67,7 +67,9 @@

/**
* Pulsar subscription name associated with this listener.
* @return the {@code subscriptionName} for this Pulsar listener endpoint.
* <p>
* SpEL {@code #{...}} and property placeholders {@code ${...}} are supported.
* @return the subscription name for this listener
*/
String subscriptionName() default "";

Expand All @@ -86,8 +88,8 @@
SchemaType schemaType() default SchemaType.NONE;

/**
* The bean name of the {@link ReactivePulsarListenerContainerFactory} to use to
* create the message listener container responsible to serve this endpoint.
* The bean name of the {@link PulsarListenerContainerFactory} to use to create the
* message listener container responsible to serve this endpoint.
* <p>
* If not specified, the default container factory is used, if any. If a SpEL
* expression is provided ({@code #{...}}), the expression can either evaluate to a
Expand All @@ -98,24 +100,28 @@

/**
* Topics to listen to.
* @return a comma separated list of topics to listen from.
* <p>
* SpEL {@code #{...}} and property placeholders {@code ${...}} are supported.
* @return an array of topics to listen to
*/
String[] topics() default {};

/**
* Topic patten to listen to.
* @return topic pattern to listen to.
* <p>
* SpEL {@code #{...}} and property placeholders {@code ${...}} are supported.
* @return topic pattern to listen to
*/
String topicPattern() default "";

/**
* Set to true or false, to override the default setting in the container factory. May
* be a property placeholder or SpEL expression that evaluates to a {@link Boolean} or
* a {@link String}, in which case the {@link Boolean#parseBoolean(String)} is used to
* obtain the value.
* Whether to automatically start the container for this listener.
* <p>
* SpEL {@code #{...}} and property place holders {@code ${...}} are supported.
* @return true to auto start, false to not auto start.
* The value can be a literal string representation of boolean (e.g. {@code 'true'})
* or a property placeholder {@code ${...}} that resolves to a literal. SpEL
* {@code #{...}} expressions that evaluate to a {@link Boolean} or a literal are
* supported.
* @return whether to automatically start the container for this listener
*/
String autoStartup() default "";

Expand All @@ -136,12 +142,13 @@
String beanRef() default "__listener";

/**
* Override the container factory's {@code concurrency} setting for this listener. May
* be a property placeholder or SpEL expression that evaluates to a {@link Number}, in
* which case {@link Number#intValue()} is used to obtain the value.
* Override the container factory's {@code concurrency} setting for this listener.
* <p>
* SpEL {@code #{...}} and property placeholders {@code ${...}} are supported.
* @return the concurrency.
* The value can be a literal string representation of {@link Number} (e.g.
* {@code '3'}) or a property placeholder {@code ${...}} that resolves to a literal.
* SpEL {@code #{...}} expressions that evaluate to a {@link Number} or a literal are
* supported.
* @return the concurrency for this listener
*/
String concurrency() default "";

Expand All @@ -158,17 +165,19 @@
String useKeyOrderedProcessing() default "";

/**
* The bean name or a 'SpEL' expression that resolves to a
* The bean name or a SpEL expression that resolves to a
* {@link org.apache.pulsar.client.api.DeadLetterPolicy} to use on the consumer to
* configure a dead letter policy for message redelivery.
* @return the bean name or empty string to not set any dead letter policy.
*/
String deadLetterPolicy() default "";

/**
* The bean name or a 'SpEL' expression that resolves to a
* {@link ReactiveMessageConsumerBuilderCustomizer} to use to configure the consumer.
* @return the bean name or empty string to not configure the consumer.
* The bean name or a SpEL expression that resolves to a
* {@link ReactivePulsarListenerMessageConsumerBuilderCustomizer} to use to configure
* the underlying consumer.
* @return the bean name or SpEL expression to the customizer or an empty string to
* not customize the consumer
*/
String consumerCustomizer() default "";

Expand Down
Loading