Search in sources :

Example 1 with DefaultSubscriptionRegistry

use of org.springframework.messaging.simp.broker.DefaultSubscriptionRegistry in project spring-framework by spring-projects.

the class MessageBrokerConfigurationTests method customPathMatcher.

@Test
public void customPathMatcher() {
    SimpleBrokerMessageHandler broker = this.customContext.getBean(SimpleBrokerMessageHandler.class);
    DefaultSubscriptionRegistry registry = (DefaultSubscriptionRegistry) broker.getSubscriptionRegistry();
    assertEquals("a.a", registry.getPathMatcher().combine("a", "a"));
    SimpAnnotationMethodMessageHandler handler = this.customContext.getBean(SimpAnnotationMethodMessageHandler.class);
    assertEquals("a.a", handler.getPathMatcher().combine("a", "a"));
    DefaultUserDestinationResolver resolver = this.customContext.getBean(DefaultUserDestinationResolver.class);
    assertNotNull(resolver);
    assertEquals(false, new DirectFieldAccessor(resolver).getPropertyValue("keepLeadingSlash"));
}
Also used : DefaultSubscriptionRegistry(org.springframework.messaging.simp.broker.DefaultSubscriptionRegistry) SimpleBrokerMessageHandler(org.springframework.messaging.simp.broker.SimpleBrokerMessageHandler) DirectFieldAccessor(org.springframework.beans.DirectFieldAccessor) SimpAnnotationMethodMessageHandler(org.springframework.messaging.simp.annotation.support.SimpAnnotationMethodMessageHandler) DefaultUserDestinationResolver(org.springframework.messaging.simp.user.DefaultUserDestinationResolver) Test(org.junit.Test)

Example 2 with DefaultSubscriptionRegistry

use of org.springframework.messaging.simp.broker.DefaultSubscriptionRegistry in project spring-framework by spring-projects.

the class MessageBrokerConfigurationTests method customCacheLimit.

@Test
public void customCacheLimit() {
    SimpleBrokerMessageHandler broker = this.customContext.getBean(SimpleBrokerMessageHandler.class);
    DefaultSubscriptionRegistry registry = (DefaultSubscriptionRegistry) broker.getSubscriptionRegistry();
    assertEquals(8192, registry.getCacheLimit());
}
Also used : DefaultSubscriptionRegistry(org.springframework.messaging.simp.broker.DefaultSubscriptionRegistry) SimpleBrokerMessageHandler(org.springframework.messaging.simp.broker.SimpleBrokerMessageHandler) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 DefaultSubscriptionRegistry (org.springframework.messaging.simp.broker.DefaultSubscriptionRegistry)2 SimpleBrokerMessageHandler (org.springframework.messaging.simp.broker.SimpleBrokerMessageHandler)2 DirectFieldAccessor (org.springframework.beans.DirectFieldAccessor)1 SimpAnnotationMethodMessageHandler (org.springframework.messaging.simp.annotation.support.SimpAnnotationMethodMessageHandler)1 DefaultUserDestinationResolver (org.springframework.messaging.simp.user.DefaultUserDestinationResolver)1