Package org.springframework.messaging.simp

Examples of org.springframework.messaging.simp.SimpMessagingTemplate


    assertTrue(messageConverter instanceof CompositeMessageConverter);

    CompositeMessageConverter compositeMessageConverter = this.appContext.getBean(CompositeMessageConverter.class);
    assertNotNull(compositeMessageConverter);

    SimpMessagingTemplate simpMessagingTemplate = this.appContext.getBean(SimpMessagingTemplate.class);
    assertNotNull(simpMessagingTemplate);
    assertEquals("/personal/", simpMessagingTemplate.getUserDestinationPrefix());

    List<MessageConverter> converters = compositeMessageConverter.getConverters();
    assertThat(converters.size(), Matchers.is(3));
    assertThat(converters.get(0), Matchers.instanceOf(StringMessageConverter.class));
    assertThat(converters.get(1), Matchers.instanceOf(ByteArrayMessageConverter.class));
View Full Code Here


  @Before
  public void setup() throws Exception {

    MockitoAnnotations.initMocks(this);

    SimpMessagingTemplate messagingTemplate = new SimpMessagingTemplate(this.messageChannel);
    messagingTemplate.setMessageConverter(new StringMessageConverter());

    this.handler = new SubscriptionMethodReturnValueHandler(messagingTemplate);

    Method method = this.getClass().getDeclaredMethod("getData");
    this.subscribeEventReturnType = new MethodParameter(method, -1);
View Full Code Here


  @Before
  public void setup() {
    SubscribableChannel channel = Mockito.mock(SubscribableChannel.class);
    SimpMessageSendingOperations brokerTemplate = new SimpMessagingTemplate(channel);

    this.messageHandler = new TestSimpAnnotationMethodMessageHandler(brokerTemplate, channel, channel);
    this.messageHandler.setApplicationContext(new StaticApplicationContext());
    this.messageHandler.setValidator(new StringTestValidator(TEST_INVALID_VALUE));
    this.messageHandler.afterPropertiesSet();
View Full Code Here

  @Before
  public void setup() throws Exception {

    MockitoAnnotations.initMocks(this);

    SimpMessagingTemplate messagingTemplate = new SimpMessagingTemplate(this.messageChannel);
    messagingTemplate.setMessageConverter(new StringMessageConverter());

    this.handler = new SendToMethodReturnValueHandler(messagingTemplate, true);
    this.handlerAnnotationNotRequired = new SendToMethodReturnValueHandler(messagingTemplate, false);

    Method method = this.getClass().getDeclaredMethod("handleNoAnnotations");
View Full Code Here

    return new UserDestinationMessageHandler(clientInboundChannel(), brokerChannel(), userDestinationResolver());
  }

  @Bean
  public SimpMessagingTemplate brokerMessagingTemplate() {
    SimpMessagingTemplate template = new SimpMessagingTemplate(brokerChannel());
    String prefix = getBrokerRegistry().getUserDestinationPrefix();
    if (prefix != null) {
      template.setUserDestinationPrefix(prefix);
    }
    template.setMessageConverter(brokerMessageConverter());
    return template;
  }
View Full Code Here

    Assert.notNull(brokerChannel, "'brokerChannel' must not be null");
    Assert.notNull(userDestinationResolver, "DestinationResolver must not be null");

    this.clientInboundChannel = clientInChannel;
    this.brokerChannel = brokerChannel;
    this.brokerMessagingTemplate = new SimpMessagingTemplate(brokerChannel);
    this.userDestinationResolver = userDestinationResolver;
  }
View Full Code Here

    Assert.notNull(clientInboundChannel, "clientInboundChannel must not be null");
    Assert.notNull(clientOutboundChannel, "clientOutboundChannel must not be null");
    Assert.notNull(brokerTemplate, "brokerTemplate must not be null");

    this.clientInboundChannel = clientInboundChannel;
    this.clientMessagingTemplate = new SimpMessagingTemplate(clientOutboundChannel);
    this.brokerTemplate = brokerTemplate;

    Collection<MessageConverter> converters = new ArrayList<MessageConverter>();
    converters.add(new StringMessageConverter());
    converters.add(new ByteArrayMessageConverter());
View Full Code Here

TOP

Related Classes of org.springframework.messaging.simp.SimpMessagingTemplate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.