Package org.springframework.messaging

Examples of org.springframework.messaging.PollableChannel.receive()


    ConfigurableApplicationContext ctx =
      new ClassPathXmlApplicationContext("META-INF/spring/integration/FtpInboundChannelAdapterSample-context.xml");

    PollableChannel ftpChannel = ctx.getBean("ftpChannel", PollableChannel.class);

    Message<?> message1 = ftpChannel.receive(2000);
    Message<?> message2 = ftpChannel.receive(2000);
    Message<?> message3 = ftpChannel.receive(1000);

    LOGGER.info(String.format("Received first file message: %s.", message1));
    LOGGER.info(String.format("Received second file message: %s.", message2));
View Full Code Here


      new ClassPathXmlApplicationContext("META-INF/spring/integration/FtpInboundChannelAdapterSample-context.xml");

    PollableChannel ftpChannel = ctx.getBean("ftpChannel", PollableChannel.class);

    Message<?> message1 = ftpChannel.receive(2000);
    Message<?> message2 = ftpChannel.receive(2000);
    Message<?> message3 = ftpChannel.receive(1000);

    LOGGER.info(String.format("Received first file message: %s.", message1));
    LOGGER.info(String.format("Received second file message: %s.", message2));
    LOGGER.info(String.format("Received nothing else: %s.", message3));
View Full Code Here

    PollableChannel ftpChannel = ctx.getBean("ftpChannel", PollableChannel.class);

    Message<?> message1 = ftpChannel.receive(2000);
    Message<?> message2 = ftpChannel.receive(2000);
    Message<?> message3 = ftpChannel.receive(1000);

    LOGGER.info(String.format("Received first file message: %s.", message1));
    LOGGER.info(String.format("Received second file message: %s.", message2));
    LOGGER.info(String.format("Received nothing else: %s.", message3));
View Full Code Here

  private void waitForJobCompletion(String jobName) {
    // could match on parameters if necessary (for disambiguation of concurrent executions)
    PollableChannel channel = jobTapChannels.get(jobName);
    Message<?> message = null;
    do {
      message = channel.receive(10000);
      if (message != null) {
        Object payload = message.getPayload();
        if (payload instanceof JobExecution) {
          // could add a waitForJobLaunch that returns as soon as it sees STARTED status
          if (BatchStatus.COMPLETED.equals(((JobExecution) payload).getStatus())) {
View Full Code Here

    when(module.getComponent("stepExecutionReplies.output", MessageChannel.class)).thenReturn(stepResultsOut);
    jobPartitionerPlugin.preProcessModule(module);
    jobPartitionerPlugin.postProcessModule(module);
    checkBusBound(messageBus);
    stepsOut.send(new GenericMessage<String>("foo"));
    Message<?> stepExecutionRequest = stepsIn.receive(10000);
    assertThat(stepExecutionRequest, hasPayload("foo"));
    stepResultsOut.send(MessageBuilder.withPayload("bar")
        .copyHeaders(stepExecutionRequest.getHeaders()) // replyTo
        .build());
    assertThat(stepResultsIn.receive(10000), hasPayload("bar"));
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.