Example usage for org.springframework.integration.endpoint EventDrivenConsumer EventDrivenConsumer

List of usage examples for org.springframework.integration.endpoint EventDrivenConsumer EventDrivenConsumer

Introduction

In this page you can find the example usage for org.springframework.integration.endpoint EventDrivenConsumer EventDrivenConsumer.

Prototype

public EventDrivenConsumer(SubscribableChannel inputChannel, MessageHandler handler) 

Source Link

Usage

From source file:org.springframework.integration.x.rabbit.RabbitChannelRegistry.java

@Override
public void createOutbound(final String name, MessageChannel moduleOutputChannel, boolean aliasHint) {
    Assert.isInstanceOf(SubscribableChannel.class, moduleOutputChannel);
    MessageHandler handler = new CompositeHandler(name);
    EventDrivenConsumer consumer = new EventDrivenConsumer((SubscribableChannel) moduleOutputChannel, handler);
    consumer.setBeanName("outbound." + name);
    consumer.afterPropertiesSet();/*from  ww w.j a  v a  2s .c  om*/
    this.lifecycleBeans.add(consumer);
    consumer.start();
}

From source file:org.springframework.integration.x.rabbit.RabbitMessageBus.java

private void doRegisterProducer(final String name, MessageChannel moduleOutputChannel, MessageHandler delegate,
        String replyTo) {//from w w  w  .  j  a  v  a2 s.  c  om
    Assert.isInstanceOf(SubscribableChannel.class, moduleOutputChannel);
    MessageHandler handler = new SendingHandler(delegate, replyTo);
    EventDrivenConsumer consumer = new EventDrivenConsumer((SubscribableChannel) moduleOutputChannel, handler);
    consumer.setBeanName("outbound." + name);
    consumer.afterPropertiesSet();
    addBinding(Binding.forProducer(moduleOutputChannel, consumer));
    consumer.start();
}

From source file:org.springframework.integration.x.redis.RedisChannelRegistry.java

@Override
public void outbound(final String name, MessageChannel channel) {
    Assert.isInstanceOf(SubscribableChannel.class, channel);
    MessageHandler handler = new CompositeHandler(name, this.redisTemplate.getConnectionFactory());
    EventDrivenConsumer consumer = new EventDrivenConsumer((SubscribableChannel) channel, handler);
    consumer.setBeanName("outbound." + name);
    consumer.afterPropertiesSet();/*from w w w.j  a  va2 s  .  c om*/
    this.lifecycleBeans.add(consumer);
    consumer.start();
}

From source file:org.springframework.xd.dirt.integration.bus.MessageBusSupport.java

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();//  w ww  .  ja va2 s. co  m
    Binding binding = Binding.forDirectProducer(name, producerChannel, consumer, properties);
    addBinding(binding);
    binding.start();
    if (logger.isInfoEnabled()) {
        logger.info("Producer bound directly: " + binding);
    }
}

From source file:org.springframework.xd.dirt.integration.rabbit.RabbitMessageBus.java

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();//from w w  w .  j a v a  2s  .  c om
    Binding producerBinding = Binding.forProducer(name, moduleOutputChannel, consumer, properties);
    addBinding(producerBinding);
    producerBinding.start();
}

From source file:org.springframework.yarn.integration.IntegrationAppmasterService.java

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