42
42
/**
43
43
* A "simple" message broker that recognizes the message types defined in
44
44
* {@link SimpMessageType}, keeps track of subscriptions with the help of a
45
- * {@link SubscriptionRegistry} and sends messages to subscribers.
45
+ * {@link SubscriptionRegistry}, and sends messages to subscribers.
46
46
*
47
47
* @author Rossen Stoyanchev
48
48
* @author Juergen Hoeller
49
+ * @author Sam Brannen
49
50
* @since 4.0
50
51
*/
51
52
public class SimpleBrokerMessageHandler extends AbstractBrokerMessageHandler {
@@ -97,11 +98,12 @@ public SimpleBrokerMessageHandler(SubscribableChannel clientInboundChannel, Mess
97
98
98
99
99
100
/**
100
- * Configure a custom SubscriptionRegistry to use for storing subscriptions.
101
- * <p><strong>Note</strong> that when a custom PathMatcher is configured via
102
- * {@link #setPathMatcher}, if the custom registry is not an instance of
103
- * {@link DefaultSubscriptionRegistry}, the provided PathMatcher is not used
104
- * and must be configured directly on the custom registry.
101
+ * Configure a custom {@link SubscriptionRegistry} to use for storing subscriptions.
102
+ * <p><strong>NOTE</strong>: If the custom registry is not an instance of
103
+ * {@link DefaultSubscriptionRegistry}, the configured {@link #setPathMatcher
104
+ * PathMatcher}, {@linkplain #setCacheLimit cache limit}, and
105
+ * {@linkplain #setSelectorHeaderName selector header name} are not used and
106
+ * must be configured directly on the custom registry.
105
107
*/
106
108
public void setSubscriptionRegistry (SubscriptionRegistry subscriptionRegistry ) {
107
109
Assert .notNull (subscriptionRegistry , "SubscriptionRegistry must not be null" );
@@ -119,6 +121,8 @@ public SubscriptionRegistry getSubscriptionRegistry() {
119
121
* When configured, the given PathMatcher is passed down to the underlying
120
122
* SubscriptionRegistry to use for matching destination to subscriptions.
121
123
* <p>Default is a standard {@link org.springframework.util.AntPathMatcher}.
124
+ * <p>Setting this property has no effect if the underlying SubscriptionRegistry
125
+ * is not an instance of {@link DefaultSubscriptionRegistry}.
122
126
* @since 4.1
123
127
* @see #setSubscriptionRegistry
124
128
* @see DefaultSubscriptionRegistry#setPathMatcher
@@ -140,6 +144,8 @@ private void initPathMatcherToUse() {
140
144
* underlying SubscriptionRegistry, overriding any default there.
141
145
* <p>With a standard {@link DefaultSubscriptionRegistry}, the default
142
146
* cache limit is 1024.
147
+ * <p>Setting this property has no effect if the underlying SubscriptionRegistry
148
+ * is not an instance of {@link DefaultSubscriptionRegistry}.
143
149
* @since 4.3.2
144
150
* @see #setSubscriptionRegistry
145
151
* @see DefaultSubscriptionRegistry#setCacheLimit
@@ -158,15 +164,18 @@ private void initCacheLimitToUse() {
158
164
159
165
/**
160
166
* Configure the name of a header that a subscription message can have for
161
- * the purpose of filtering messages matched to the subscription. The header
162
- * value is expected to be a Spring EL boolean expression to be applied to
163
- * the headers of messages matched to the subscription.
167
+ * the purpose of filtering messages matched to the subscription.
168
+ * <p>The header value is expected to be a Spring Expression Language (SpEL)
169
+ * boolean expression to be applied to the headers of messages matched to the
170
+ * subscription.
164
171
* <p>For example:
165
- * <pre>
172
+ * <pre style="code" >
166
173
* headers.foo == 'bar'
167
174
* </pre>
168
175
* <p>By default this is set to "selector". You can set it to a different
169
176
* name, or to {@code null} to turn off support for a selector header.
177
+ * <p>Setting this property has no effect if the underlying SubscriptionRegistry
178
+ * is not an instance of {@link DefaultSubscriptionRegistry}.
170
179
* @param selectorHeaderName the name to use for a selector header
171
180
* @since 4.3.17
172
181
* @see #setSubscriptionRegistry
0 commit comments