Package org.springframework.integration.endpoint

Examples of org.springframework.integration.endpoint.EventDrivenConsumer


    messagingTemplate = new MessagingTemplate();
  }

  @Override
  protected void doStart() {
    consumer = new EventDrivenConsumer(messageChannel, new ReplyProducingHandler());
    consumer.start();
  }
View Full Code Here


      ResequencingMessageHandler handler = new ResequencingMessageHandler(new ResequencingMessageGroupProcessor());
      handler.setReleasePartialSequences(true);
      DirectChannel resequenced = new DirectChannel();
      resequenced.setBeanName("resequencedWSFrames");
      handler.setOutputChannel(resequenced);
      this.resequencer = new EventDrivenConsumer(this.resequenceChannel, handler);
      resequenced.subscribe(new MessageHandler() {

        @Override
        public void handleMessage(Message<?> message) throws MessagingException {
          doOnMessage(message);
View Full Code Here

  private void doRegisterProducer(final String name, MessageChannel moduleOutputChannel,
      AmqpOutboundEndpoint delegate, String replyTo, RabbitPropertiesAccessor properties) {
    Assert.isInstanceOf(SubscribableChannel.class, moduleOutputChannel);
    MessageHandler handler = new SendingHandler(delegate, replyTo, properties);
    EventDrivenConsumer consumer = new EventDrivenConsumer((SubscribableChannel) moduleOutputChannel, handler);
    consumer.setBeanFactory(getBeanFactory());
    consumer.setBeanName("outbound." + name);
    consumer.afterPropertiesSet();
    Binding producerBinding = Binding.forProducer(name, moduleOutputChannel, consumer, properties);
    addBinding(producerBinding);
    producerBinding.start();
  }
View Full Code Here

  }

  private void bindProducerDirectly(String name, SubscribableChannel producerChannel,
      MessageChannel consumerChannel, AbstractBusPropertiesAccessor properties) {
    DirectHandler handler = new DirectHandler(consumerChannel);
    EventDrivenConsumer consumer = new EventDrivenConsumer(producerChannel, handler);
    consumer.setBeanFactory(getBeanFactory());
    consumer.setBeanName("outbound." + name);
    consumer.afterPropertiesSet();
    Binding binding = Binding.forDirectProducer(name, producerChannel, consumer, properties);
    addBinding(binding);
    binding.start();
    if (logger.isInfoEnabled()) {
      logger.info("Producer bound directly: " + binding);
View Full Code Here

        }
      };

      Assert.isInstanceOf(SubscribableChannel.class, moduleOutputChannel);
      MessageHandler handler = new SendingHandler(messageHandler, topicName, accessor);
      EventDrivenConsumer consumer = new EventDrivenConsumer((SubscribableChannel) moduleOutputChannel, handler);
      consumer.setBeanFactory(this.getBeanFactory());
      consumer.setBeanName("outbound." + name);
      consumer.afterPropertiesSet();
      Binding producerBinding = Binding.forProducer(name, moduleOutputChannel, consumer, accessor);
      addBinding(producerBinding);
      producerBinding.start();

    }
View Full Code Here

    final KafkaStream<Integer, byte[]> stream = consumerMap.get(topic).iterator().next();

    final DirectChannel bridge = new DirectChannel();
    ReceivingHandler rh = new ReceivingHandler(connector);
    rh.setOutputChannel(moduleInputChannel);
    EventDrivenConsumer edc = new EventDrivenConsumer(bridge, rh);
    edc.setBeanName("inbound." + name);

    Binding consumerBinding = Binding.forConsumer(name, edc, moduleInputChannel, accessor);
    addBinding(consumerBinding);
    consumerBinding.start();
View Full Code Here

  @Test
  public void testParser() {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
        "org/springframework/xd/integration/hadoop/config/DatasetOutboundChannelAdapterParserTests.xml");
    EventDrivenConsumer adapter = context.getBean("adapter", EventDrivenConsumer.class);
    HdfsWritingMessageHandler handler = (HdfsWritingMessageHandler) new DirectFieldAccessor(adapter).getPropertyValue("handler");
    DirectFieldAccessor handlerAccessor = new DirectFieldAccessor(handler);
    assertEquals(false, handlerAccessor.getPropertyValue("autoStartup"));
    DatasetWriterFactory writerFactory = (DatasetWriterFactory) handlerAccessor.getPropertyValue("hdfsWriterFactory");
    DatasetOperations datasetOperations = (DatasetOperations) new DirectFieldAccessor(writerFactory).getPropertyValue("datasetOperations");
View Full Code Here

  @Test
  public void test() {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
        "org/springframework/xd/integration/hadoop/config/HdfsOutboundChannelAdapterParserTests.xml");
    EventDrivenConsumer adapter = context.getBean("adapter", EventDrivenConsumer.class);
    HdfsStoreMessageHandler handler = (HdfsStoreMessageHandler) new DirectFieldAccessor(adapter).getPropertyValue("handler");
    DirectFieldAccessor handlerAccessor = new DirectFieldAccessor(handler);
    assertEquals(false, handlerAccessor.getPropertyValue("autoStartup"));

    TextFileWriter storeWriter = (TextFileWriter) handlerAccessor.getPropertyValue("storeWriter");
View Full Code Here

  private void doRegisterProducer(final String name, MessageChannel moduleOutputChannel, MessageHandler delegate,
      String replyTo, RedisPropertiesAccessor properties) {
    Assert.isInstanceOf(SubscribableChannel.class, moduleOutputChannel);
    MessageHandler handler = new SendingHandler(delegate, replyTo, properties);
    EventDrivenConsumer consumer = new EventDrivenConsumer((SubscribableChannel) moduleOutputChannel, handler);
    consumer.setBeanFactory(this.getBeanFactory());
    consumer.setBeanName("outbound." + name);
    consumer.afterPropertiesSet();
    Binding producerBinding = Binding.forProducer(name, moduleOutputChannel, consumer, properties);
    addBinding(producerBinding);
    producerBinding.start();
  }
View Full Code Here

TOP

Related Classes of org.springframework.integration.endpoint.EventDrivenConsumer

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.