Package org.springframework.messaging

Examples of org.springframework.messaging.SubscribableChannel


    Assert.notNull(streamName, "streamName cannot be null");
    Assert.notNull(test, "test cannot be null");
    Assert.notNull(message, "message cannot be null");

    MessageChannel producer = getSourceOutputChannel(streamName);
    SubscribableChannel consumer = getSinkInputChannel(streamName);
    consumer.subscribe(test);
    producer.send(message);
    assertTrue(test.getMessageHandled());
  }
View Full Code Here


    deployStream(
        tapName,
        tapChannel + " > sink");

    MessageChannel producer = getSourceOutputChannel(streamName);
    SubscribableChannel consumer = getSinkInputChannel(tapName);
    SubscribableChannel streamConsumer = getSinkInputChannel(streamName);

    // Add a dummy consumer to the stream in case there is none
    streamConsumer.subscribe(new MessageHandler() {

      @Override
      public void handleMessage(Message<?> message) throws MessagingException {
      }
    });
View Full Code Here

    context.getEnvironment().getPropertySources().addLast(new PropertiesPropertySource("options", properties));
    context.register(TestConfiguration.class);
    context.refresh();

    MessageChannel input = context.getBean("input", MessageChannel.class);
    SubscribableChannel output = context.getBean("output", SubscribableChannel.class);

    final AtomicBoolean handled = new AtomicBoolean();
    output.subscribe(new MessageHandler() {
      @Override
      public void handleMessage(Message<?> message) throws MessagingException {
        handled.set(true);
        assertEquals("foohellobar", message.getPayload());
      }
View Full Code Here

    final Module module = new ResourceConfiguredModule(moduleDescriptor,
        new ModuleDeploymentProperties());

    final TestMessageBus messageBus = new TestMessageBus();
    final JobEventsListenerPlugin eventsListenerPlugin = new JobEventsListenerPlugin(messageBus);
    final SubscribableChannel jobExecutionEventsChannel = new PublishSubscribeChannel();
    final SubscribableChannel stepExecutionEventsChannel = new PublishSubscribeChannel();
    final SubscribableChannel chunkEventsChannel = new PublishSubscribeChannel();
    final SubscribableChannel itemEventsChannel = new PublishSubscribeChannel();
    final SubscribableChannel skipEventsChannel = new PublishSubscribeChannel();
    final SubscribableChannel aggregatedEventsChannel = new PublishSubscribeChannel();

    final Module spiedModule = spy(module);

    doReturn(messageBus).when(spiedModule).getComponent(MessageBus.class);
    doReturn(jobExecutionEventsChannel).when(spiedModule).getComponent("xd.job.jobExecutionEvents",
View Full Code Here

TOP

Related Classes of org.springframework.messaging.SubscribableChannel

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.