Package org.springframework.integration.core

Examples of org.springframework.integration.core.PollableChannel


  @Test
  public void testDeleteAfterPoll() {
    final ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( "VoldemortInboundAdapterTest-context.xml", getClass() );
    final StoreClient storeClient = context.getBean( "storeClient", StoreClient.class );
    final PollableChannel inboundChannel = context.getBean( "voldemortInboundChannel", PollableChannel.class );

    // given
    final Person robert = new Person( "robert", "Robert", "Antoniak" );
    storeClient.put( robert.getId(), robert );

    // when
    final Message<Person> received = (Message<Person>) inboundChannel.receive();

    // then
    Assert.assertEquals( robert, received.getPayload() );
    final Versioned found = storeClient.get( robert.getId() );
    Assert.assertNull( found );
View Full Code Here


    //mock
    StepExecution masterStepExecution = mock(StepExecution.class);
    StepExecutionSplitter stepExecutionSplitter = mock(StepExecutionSplitter.class);
    MessagingOperations operations = mock(MessagingOperations.class);
    Message message = mock(Message.class);
    PollableChannel replyChannel = mock(PollableChannel.class);
    //when
    when(message.getPayload()).thenReturn(Collections.emptyList());
    when(operations.receive(replyChannel)).thenReturn(message);
    //set
    messageChannelPartitionHandler.setMessagingOperations(operations);
View Full Code Here

public class GatewayDemo {

  public static void main(String[] args) {
    ApplicationContext context = new ClassPathXmlApplicationContext("siia/jms/gateways.xml");
    MessageChannel toJMS = context.getBean("toJMS", MessageChannel.class);
    PollableChannel jmsReplies = context.getBean("jmsReplies", PollableChannel.class);
    MessagingTemplate template = new MessagingTemplate();
    template.convertAndSend(toJMS, "echo");
    Object response = template.receiveAndConvert(jmsReplies);
    System.out.println("response: " + response);
  }
View Full Code Here

public class ChannelAdapterDemo {

  public static void main(String[] args) {
    ApplicationContext context = new ClassPathXmlApplicationContext("siia/jms/channel-adapters.xml");
    MessageChannel toJMS = context.getBean("toJMS", MessageChannel.class);
    PollableChannel fromJMS = context.getBean("fromJMS", PollableChannel.class);
    MessagingTemplate template = new MessagingTemplate();
    template.convertAndSend(toJMS, "echo");
    Object response = template.receiveAndConvert(fromJMS);
    System.out.println("response: " + response);
  }
View Full Code Here

TOP

Related Classes of org.springframework.integration.core.PollableChannel

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.