Package org.springframework.messaging

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


    Path filepath0 = new Path(basepath, YYYYMM + "/0_hash/foos_list/testfile-0");
    Path filepath1 = new Path(basepath, YYYYMM + "/0_hash/bars_list/testfile-0");

    fileSystem.delete(basepath, true);

    channel.send(MessageBuilder.withPayload("foo").build());
    channel.send(MessageBuilder.withPayload("bar").build());
    context.close();
    assertTrue(fileSystem.exists(basepath));
    assertTrue(fileSystem.exists(filepath0));
    assertTrue(fileSystem.exists(filepath1));
View Full Code Here


    Path filepath1 = new Path(basepath, YYYYMM + "/0_hash/bars_list/testfile-0");

    fileSystem.delete(basepath, true);

    channel.send(MessageBuilder.withPayload("foo").build());
    channel.send(MessageBuilder.withPayload("bar").build());
    context.close();
    assertTrue(fileSystem.exists(basepath));
    assertTrue(fileSystem.exists(filepath0));
    assertTrue(fileSystem.exists(filepath1));
    BufferedReader reader0 = new BufferedReader(new InputStreamReader(fileSystem.open(filepath0)));
View Full Code Here

    MessageChannel channel = context.getBean("datasetOut", MessageChannel.class);
    TestPojo t1 = new TestPojo();
    t1.setId(1);
    t1.setTimestamp(System.currentTimeMillis());
    t1.setDescription("foo");
    channel.send(MessageBuilder.withPayload(Collections.singletonList(t1)).build());
    TestPojo t2 = new TestPojo();
    t2.setId(2);
    t2.setTimestamp(System.currentTimeMillis());
    t2.setDescription("x"); //TODO: this is temporary, due to changes in Kite SDK 0.17.0
    channel.send(MessageBuilder.withPayload(Collections.singletonList(t2)).build());
View Full Code Here

    channel.send(MessageBuilder.withPayload(Collections.singletonList(t1)).build());
    TestPojo t2 = new TestPojo();
    t2.setId(2);
    t2.setTimestamp(System.currentTimeMillis());
    t2.setDescription("x"); //TODO: this is temporary, due to changes in Kite SDK 0.17.0
    channel.send(MessageBuilder.withPayload(Collections.singletonList(t2)).build());

    DatasetOperations datasetOperations = context.getBean("datasetOperations", DatasetOperations.class);
    String path = context.getBean("path", String.class);
    assertTrue("Dataset path created", new File(path).exists());
    assertTrue("Dataset storage created",
View Full Code Here

  @Test
  public void testWritingDataset() throws Exception {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
        "org/springframework/xd/integration/hadoop/config/DatasetOutboundChannelAdapterIntegrationTests.xml");
    MessageChannel channel = context.getBean("datasetOut", MessageChannel.class);
    channel.send(MessageBuilder.withPayload("foo").build());
    channel.send(MessageBuilder.withPayload("bar").build());
    DatasetOperations datasetOperations = context.getBean("datasetOperations", DatasetOperations.class);
    String path = context.getBean("path", String.class);
    assertTrue("Dataset path created", new File(path).exists());
    assertTrue("Dataset storage created",
View Full Code Here

  public void testWritingDataset() throws Exception {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
        "org/springframework/xd/integration/hadoop/config/DatasetOutboundChannelAdapterIntegrationTests.xml");
    MessageChannel channel = context.getBean("datasetOut", MessageChannel.class);
    channel.send(MessageBuilder.withPayload("foo").build());
    channel.send(MessageBuilder.withPayload("bar").build());
    DatasetOperations datasetOperations = context.getBean("datasetOperations", DatasetOperations.class);
    String path = context.getBean("path", String.class);
    assertTrue("Dataset path created", new File(path).exists());
    assertTrue("Dataset storage created",
        new File(path + "/" + "test/" + datasetOperations.getDatasetName(String.class)).exists());
View Full Code Here

        latch.countDown();
      }
    });
    bus.bindConsumer("queue:foo", testChannel, null);
    assertEquals(0, received.size());
    registered.send(MessageBuilder.withPayload("hello").build());
    try {
      assertTrue("latch timed out", latch.await(1, TimeUnit.SECONDS));
    }
    catch (InterruptedException e) {
      Thread.currentThread().interrupt();
View Full Code Here

        }
      });
      bus.bindPubSubConsumer("topic:bar", testChannel, null);
    }
    assertEquals(0, received.size());
    registered.send(MessageBuilder.withPayload("hello").build());
    try {
      assertTrue("latch timed out", latch.await(1, TimeUnit.SECONDS));
    }
    catch (InterruptedException e) {
      Thread.currentThread().interrupt();
View Full Code Here

      public void handleMessage(Message<?> message) throws MessagingException {
        handled.set(true);
        assertEquals("foohellobar", message.getPayload());
      }
    });
    input.send(new GenericMessage<String>("hello"));
    assertTrue(handled.get());
  }

  @Configuration
  @Import(ModuleConfiguration.class)
View Full Code Here

    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"));
    jobPartitionerPlugin.removeModule(module);
    checkBusUnbound(messageBus);
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.