Package org.springframework.integration.channel

Examples of org.springframework.integration.channel.QueueChannel


    return new DirectChannel();
  }

  @Bean
  public QueueChannel queueChannel() {
    return new QueueChannel();
  }
View Full Code Here


    final MessageChannel stdinToJmsoutChannel = applicationContext.getBean("stdinToJmsoutChannel", MessageChannel.class);

    stdinToJmsoutChannel.send(MessageBuilder.withPayload("jms test").build());

    final QueueChannel queueChannel = applicationContext.getBean("queueChannel", QueueChannel.class);

    @SuppressWarnings("unchecked")
    Message<String> reply = (Message<String>) queueChannel.receive(20000);
    Assert.assertNotNull(reply);
    String out = reply.getPayload();

    Assert.assertEquals("JMS response: JMS TEST", out);
View Full Code Here

    final MessageChannel stdinToJmsoutChannel = applicationContext.getBean("stdinToJmsoutChannel", MessageChannel.class);

    stdinToJmsoutChannel.send(MessageBuilder.withPayload("jms test").build());

    final QueueChannel queueChannel = applicationContext.getBean("queueChannel", QueueChannel.class);

    @SuppressWarnings("unchecked")
    Message<String> reply = (Message<String>) queueChannel.receive(20000);
    Assert.assertNotNull(reply);
    String out = reply.getPayload();
    Assert.assertEquals("jms test", out);

    applicationContext.close();
View Full Code Here

    Set<StepExecution> split = stepExecutionSplitter.split(masterStepExecution, gridSize);
    int count = 0;
   
    if (replyChannel == null) {
      replyChannel = new QueueChannel();
    }//end if
   
    for (StepExecution stepExecution : split) {
      Message<StepExecutionRequest> request = createMessage(count++, split.size(), new StepExecutionRequest(
          stepName, stepExecution.getJobExecutionId(), stepExecution.getId()), replyChannel);
View Full Code Here

  @Test
  public void testAggregatorWithShutdown() {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( "VoldemortMessageStoreAggregationTest-context.xml", getClass() );
    MessageChannel input = context.getBean( "inputChannel", MessageChannel.class );
    QueueChannel output = context.getBean( "outputChannel", QueueChannel.class );

    Message<?> message1 = MessageBuilder.withPayload( "1" )
                      .setSequenceNumber( 1 ).setSequenceSize( 3 ).setCorrelationId( 1 ).build();
    Message<?> message2 = MessageBuilder.withPayload( "2" )
                      .setSequenceNumber( 2 ).setSequenceSize( 3 ).setCorrelationId( 1 ).build();
    input.send( message1 );
    Assert.assertNull( output.receive( 1000 ) );
    input.send( message2 );
    Assert.assertNull( output.receive( 1000 ) );

    context.close();

    context = new ClassPathXmlApplicationContext( "VoldemortMessageStoreAggregationTest-context.xml", getClass() );
    input = context.getBean( "inputChannel", MessageChannel.class );
    output = context.getBean( "outputChannel", QueueChannel.class );

    Message<?> message3 = MessageBuilder.withPayload( "3" )
                      .setSequenceNumber( 3 ).setSequenceSize( 3 ).setCorrelationId( 1 ).build();
    input.send( message3 );
    Assert.assertNotNull( output.receive( 1000 ) );

    context.close();
  }
View Full Code Here

    generateMessage(ctx);
  }

  private static void generateMessage(ClassPathXmlApplicationContext ctx) {
    QueueChannel channel = ctx.getBean("outputToSplunkWithMessageStore", QueueChannel.class);

    SplunkData data = new SplunkData("spring", "spring:example");
    data.setCommonDesc("description");

    Message<SplunkData> msg = MessageBuilder.withPayload(data).build();
    channel.send(msg);
    msg = MessageBuilder.withPayload(data).build();
    channel.send(msg);
  }
View Full Code Here

  }

  @Test
  public void testPreReceive() throws Exception {
    MessageSourcePollerInterceptor interceptor = new MessageSourcePollerInterceptor(new TestMessageSource("foo"));
    QueueChannel channel = new QueueChannel();
    assertTrue(interceptor.preReceive(channel));
    assertEquals("foo", channel.receive(10L).getPayload());
  }
View Full Code Here

  }

  @Test
  public void testPreReceive() throws Exception {
    MessageSourcePollerInterceptor interceptor = new MessageSourcePollerInterceptor(new TestMessageSource("foo"));
    QueueChannel channel = new QueueChannel();
    assertTrue(interceptor.preReceive(channel));
    assertEquals("foo", channel.receive(10L).getPayload());
  }
View Full Code Here

    }

    int count = 0;

    if (replyChannel == null) {
      replyChannel = new QueueChannel();
    }//end if

    for (StepExecution stepExecution : split) {
      Message<StepExecutionRequest> request = createMessage(count++, split.size(), new StepExecutionRequest(
          stepName, stepExecution.getJobExecutionId(), stepExecution.getId()), replyChannel);
View Full Code Here

*/
public abstract class AbstractSingleNodeNamedChannelSink extends AbstractSingleNodeNamedChannelModule<QueueChannel>
    implements NamedChannelSink {

  protected AbstractSingleNodeNamedChannelSink(MessageBus messageBus, String sharedChannelName) {
    super(messageBus, new QueueChannel(), sharedChannelName);
  }
View Full Code Here

TOP

Related Classes of org.springframework.integration.channel.QueueChannel

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.