Package org.springframework.integration

Examples of org.springframework.integration.MessageChannel.send()


    final Person lukasz = new Person( "lukasz", "Lukasz", "Antoniak" );
    final Person copy = new Person( "lukasz", "Lukasz", "Antoniak" );

    // when
    final Message<Person> message = MessageBuilder.withPayload( lukasz ).build();
    voldemortOrderChannel.send( message );

    // then
    messageUpdater.updatePerson( copy );
    final Versioned found = storeClient.get( lukasz.getId() );
    Assert.assertEquals( copy, found.getValue() );
View Full Code Here


    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();
View Full Code Here

                      .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() );
View Full Code Here

    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

    assertTrue(messageSource instanceof FileTransferringMessageHandler);

    MessageChannel smbChannel = ac.getBean("smbOutboundChannel", MessageChannel.class);

    for (int i = 0; i < fileNames.length; i++) {
      smbChannel.send(new GenericMessage<File>(new File(testLocalDir + fileNames[i])));
    }

    Thread.sleep(3000);

    // retrieve the session factory bean to check the test files are present in the remote location
View Full Code Here

        System.out.print("\nPlease enter the path to the file you want to upload: ");
        filePath = scanner.nextLine();

        final MessageChannel messageChannel = context.getBean("s3channel", MessageChannel.class);
        messageChannel.send(MessageBuilder.withPayload(new File(filePath)).build());

        break;

      }
      else if("2".equals(input.trim())) {
View Full Code Here

  public static void main(String[] args) {
    ActiveMqTestUtils.prepare();
    ApplicationContext context = new ClassPathXmlApplicationContext("lb-config.xml", LbFailoverDemo.class);
    MessageChannel inputChannel = context.getBean("inputChannel", MessageChannel.class);
    inputChannel.send(new GenericMessage<String>("A"));
    inputChannel.send(new GenericMessage<String>("B"));
    inputChannel.send(new GenericMessage<String>("C"));
  }

}
View Full Code Here

  public static void main(String[] args) {
    ActiveMqTestUtils.prepare();
    ApplicationContext context = new ClassPathXmlApplicationContext("lb-config.xml", LbFailoverDemo.class);
    MessageChannel inputChannel = context.getBean("inputChannel", MessageChannel.class);
    inputChannel.send(new GenericMessage<String>("A"));
    inputChannel.send(new GenericMessage<String>("B"));
    inputChannel.send(new GenericMessage<String>("C"));
  }

}
View Full Code Here

    ActiveMqTestUtils.prepare();
    ApplicationContext context = new ClassPathXmlApplicationContext("lb-config.xml", LbFailoverDemo.class);
    MessageChannel inputChannel = context.getBean("inputChannel", MessageChannel.class);
    inputChannel.send(new GenericMessage<String>("A"));
    inputChannel.send(new GenericMessage<String>("B"));
    inputChannel.send(new GenericMessage<String>("C"));
  }

}
View Full Code Here

    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("aggregator-config.xml", TimeBasedAggregationDemo.class);
   
    MessageChannel inChannel = context.getBean("inChannel", MessageChannel.class);
    Random random = new Random();
    while (true) {
      inChannel.send(MessageBuilder.withPayload("VMW").setHeader("price", 95 + random.nextDouble()).build());
      Thread.sleep(random.nextInt(687));
    }
  }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.