SubscriptionRegistry that stores subscriptions
in memory and uses a PathMatcher
for matching destinations.
This class also supports an optional selector header on subscription messages with Spring Expression Language (SpEL) expressions evaluated against the headers to filter out messages in addition to destination matching. As of Spring Framework 6.1, the SpEL support is disabled by default, but it can be enabled by setting a selector header name.
| Modifier and Type | Class and Description |
|---|---|
| private class | DefaultSubscriptionRegistry.DestinationCache
Cache for destinations resolved previously via
|
| private static class | DefaultSubscriptionRegistry.SessionInfo
Container for the subscriptions of a session. |
| private static class | DefaultSubscriptionRegistry.SessionRegistry
Registry for all session and their subscriptions. |
| private static class | |
| private static class | DefaultSubscriptionRegistry.Subscription
Represents a subscription. |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| public static final int | DEFAULT_CACHE_LIMIT
Default maximum number of entries for the destination cache: 1024. |
| private final DefaultSubscriptionRegistry. | |
| private final ExpressionParser | |
| private static final EvaluationContext | messageEvalContext
Static evaluation context to reuse. |
| private PathMatcher | |
| private volatile boolean | |
| private String | |
| private final DefaultSubscriptionRegistry. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | addSubscriptionInternal(String sessionId, String subscriptionId, String destination, Message<?> message)
Implements abstract org. |
| private boolean | |
| protected MultiValueMap | findSubscriptionsInternal(String destination, Message<?> message)
Implements abstract org. |
| public int | |
| public PathMatcher | |
| private Expression | |
| public String | |
| protected void | removeSubscriptionInternal(String sessionId, String subscriptionId, Message<?> message)
Implements abstract org. |
| public void | setCacheLimit(int cacheLimit)
Specify the maximum number of entries for the resolved destination cache. |
| public void | |
| public void | setSelectorHeaderName(String
the name to use for a selector header, or selectorHeaderName)null
or blank to disable selector header supportConfigure the name of a header that a subscription message can have for the purpose of filtering messages matched to the subscription. |
| public void | unregisterAllSubscriptions(String sessionId)
Implements org. |