|
26 | 26 | import org.apache.pulsar.common.schema.SchemaType; |
27 | 27 |
|
28 | 28 | import org.springframework.messaging.handler.annotation.MessageMapping; |
| 29 | +import org.springframework.pulsar.config.PulsarListenerContainerFactory; |
29 | 30 | import org.springframework.pulsar.reactive.config.ReactivePulsarListenerContainerFactory; |
30 | 31 | import org.springframework.pulsar.reactive.config.ReactivePulsarListenerEndpointRegistry; |
31 | | -import org.springframework.pulsar.reactive.core.ReactiveMessageConsumerBuilderCustomizer; |
32 | 32 |
|
33 | 33 | /** |
34 | 34 | * Annotation that marks a method to be the target of a Pulsar message listener on the |
|
67 | 67 |
|
68 | 68 | /** |
69 | 69 | * Pulsar subscription name associated with this listener. |
70 | | - * @return the {@code subscriptionName} for this Pulsar listener endpoint. |
| 70 | + * <p> |
| 71 | + * SpEL {@code #{...}} and property placeholders {@code ${...}} are supported. |
| 72 | + * @return the subscription name for this listener |
71 | 73 | */ |
72 | 74 | String subscriptionName() default ""; |
73 | 75 |
|
|
86 | 88 | SchemaType schemaType() default SchemaType.NONE; |
87 | 89 |
|
88 | 90 | /** |
89 | | - * The bean name of the {@link ReactivePulsarListenerContainerFactory} to use to |
90 | | - * create the message listener container responsible to serve this endpoint. |
| 91 | + * The bean name of the {@link PulsarListenerContainerFactory} to use to create the |
| 92 | + * message listener container responsible to serve this endpoint. |
91 | 93 | * <p> |
92 | 94 | * If not specified, the default container factory is used, if any. If a SpEL |
93 | 95 | * expression is provided ({@code #{...}}), the expression can either evaluate to a |
|
98 | 100 |
|
99 | 101 | /** |
100 | 102 | * Topics to listen to. |
101 | | - * @return a comma separated list of topics to listen from. |
| 103 | + * <p> |
| 104 | + * SpEL {@code #{...}} and property placeholders {@code ${...}} are supported. |
| 105 | + * @return an array of topics to listen to |
102 | 106 | */ |
103 | 107 | String[] topics() default {}; |
104 | 108 |
|
105 | 109 | /** |
106 | 110 | * Topic patten to listen to. |
107 | | - * @return topic pattern to listen to. |
| 111 | + * <p> |
| 112 | + * SpEL {@code #{...}} and property placeholders {@code ${...}} are supported. |
| 113 | + * @return topic pattern to listen to |
108 | 114 | */ |
109 | 115 | String topicPattern() default ""; |
110 | 116 |
|
111 | 117 | /** |
112 | | - * Set to true or false, to override the default setting in the container factory. May |
113 | | - * be a property placeholder or SpEL expression that evaluates to a {@link Boolean} or |
114 | | - * a {@link String}, in which case the {@link Boolean#parseBoolean(String)} is used to |
115 | | - * obtain the value. |
| 118 | + * Whether to automatically start the container for this listener. |
116 | 119 | * <p> |
117 | | - * SpEL {@code #{...}} and property place holders {@code ${...}} are supported. |
118 | | - * @return true to auto start, false to not auto start. |
| 120 | + * The value can be a literal string representation of boolean (e.g. {@code 'true'}) |
| 121 | + * or a property placeholder {@code ${...}} that resolves to a literal. SpEL |
| 122 | + * {@code #{...}} expressions that evaluate to a {@link Boolean} or a literal are |
| 123 | + * supported. |
| 124 | + * @return whether to automatically start the container for this listener |
119 | 125 | */ |
120 | 126 | String autoStartup() default ""; |
121 | 127 |
|
|
136 | 142 | String beanRef() default "__listener"; |
137 | 143 |
|
138 | 144 | /** |
139 | | - * Override the container factory's {@code concurrency} setting for this listener. May |
140 | | - * be a property placeholder or SpEL expression that evaluates to a {@link Number}, in |
141 | | - * which case {@link Number#intValue()} is used to obtain the value. |
| 145 | + * Override the container factory's {@code concurrency} setting for this listener. |
142 | 146 | * <p> |
143 | | - * SpEL {@code #{...}} and property placeholders {@code ${...}} are supported. |
144 | | - * @return the concurrency. |
| 147 | + * The value can be a literal string representation of {@link Number} (e.g. |
| 148 | + * {@code '3'}) or a property placeholder {@code ${...}} that resolves to a literal. |
| 149 | + * SpEL {@code #{...}} expressions that evaluate to a {@link Number} or a literal are |
| 150 | + * supported. |
| 151 | + * @return the concurrency for this listener |
145 | 152 | */ |
146 | 153 | String concurrency() default ""; |
147 | 154 |
|
|
158 | 165 | String useKeyOrderedProcessing() default ""; |
159 | 166 |
|
160 | 167 | /** |
161 | | - * The bean name or a 'SpEL' expression that resolves to a |
| 168 | + * The bean name or a SpEL expression that resolves to a |
162 | 169 | * {@link org.apache.pulsar.client.api.DeadLetterPolicy} to use on the consumer to |
163 | 170 | * configure a dead letter policy for message redelivery. |
164 | 171 | * @return the bean name or empty string to not set any dead letter policy. |
165 | 172 | */ |
166 | 173 | String deadLetterPolicy() default ""; |
167 | 174 |
|
168 | 175 | /** |
169 | | - * The bean name or a 'SpEL' expression that resolves to a |
170 | | - * {@link ReactiveMessageConsumerBuilderCustomizer} to use to configure the consumer. |
171 | | - * @return the bean name or empty string to not configure the consumer. |
| 176 | + * The bean name or a SpEL expression that resolves to a |
| 177 | + * {@link ReactivePulsarListenerMessageConsumerBuilderCustomizer} to use to configure |
| 178 | + * the underlying consumer. |
| 179 | + * @return the bean name or SpEL expression to the customizer or an empty string to |
| 180 | + * not customize the consumer |
172 | 181 | */ |
173 | 182 | String consumerCustomizer() default ""; |
174 | 183 |
|
|
0 commit comments