List of usage examples for org.springframework.integration.endpoint EventDrivenConsumer setBeanName
@Override public final void setBeanName(String beanName)
From source file:io.jmnarloch.spring.cloud.stream.binder.hermes.HermesClientBinder.java
private EventDrivenConsumer createConsumer(String name, SubscribableChannel channel, MessageHandler handler) { EventDrivenConsumer consumer = new EventDrivenConsumer(channel, handler); consumer.setBeanFactory(getBeanFactory()); consumer.setBeanName(String.format(BEAN_NAME_TEMPLATE, name)); consumer.afterPropertiesSet();/*from ww w . j a v a2 s.c om*/ return consumer; }
From source file:org.springframework.integration.x.gemfire.GemFireMessageBus.java
private void doRegisterProducer(final String name, MessageChannel moduleOutputChannel, MessageHandler handler) { Assert.isInstanceOf(SubscribableChannel.class, moduleOutputChannel); EventDrivenConsumer consumer = new EventDrivenConsumer((SubscribableChannel) moduleOutputChannel, handler); consumer.setBeanName("outbound." + name); consumer.afterPropertiesSet();/*from ww w . ja v a2s. co m*/ addBinding(Binding.forProducer(moduleOutputChannel, consumer)); consumer.start(); }
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();// ww w. j a v a 2 s. 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 o m*/ 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();/*w w w . ja v a 2s.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();/*from w w w. j a v a 2 s . c o 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 .jav a 2 s . c o m*/ Binding producerBinding = Binding.forProducer(name, moduleOutputChannel, consumer, properties); addBinding(producerBinding); producerBinding.start(); }