本文整理汇总了Java中org.springframework.integration.endpoint.EventDrivenConsumer类的典型用法代码示例。如果您正苦于以下问题:Java EventDrivenConsumer类的具体用法?Java EventDrivenConsumer怎么用?Java EventDrivenConsumer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EventDrivenConsumer类属于org.springframework.integration.endpoint包,在下文中一共展示了EventDrivenConsumer类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: doRegisterProducer
点赞 3
import org.springframework.integration.endpoint.EventDrivenConsumer; //导入依赖的package包/类
private Binding<MessageChannel> doRegisterProducer(final String name, MessageChannel moduleOutputChannel,
ProducerProperties properties) {
Assert.isInstanceOf(SubscribableChannel.class, moduleOutputChannel);
MessageHandler handler = new SendingHandler(name, properties);
EventDrivenConsumer consumer = new EventDrivenConsumer((SubscribableChannel) moduleOutputChannel, handler);
consumer.setBeanFactory(this.getBeanFactory());
consumer.setBeanName("outbound." + name);
consumer.afterPropertiesSet();
DefaultBinding<MessageChannel> producerBinding =
new DefaultBinding<>(name, null, moduleOutputChannel, consumer);
String[] requiredGroups = properties.getRequiredGroups();
if (!ObjectUtils.isEmpty(requiredGroups)) {
for (String group : requiredGroups) {
this.redisOperations.boundZSetOps(CONSUMER_GROUPS_KEY_PREFIX + name).incrementScore(group, 1);
}
}
consumer.start();
return producerBinding;
}
开发者ID:spring-cloud,
项目名称:spring-cloud-stream-binder-redis,
代码行数:20,
代码来源:RedisMessageChannelBinder.java
示例2: outboundPermissions
点赞 3
import org.springframework.integration.endpoint.EventDrivenConsumer; //导入依赖的package包/类
@Test
public void outboundPermissions() {
EventDrivenConsumer consumer = context.getBean("sqs-outbound",
EventDrivenConsumer.class);
assertThat(consumer, is(notNullValue()));
final SqsExecutor executor = TestUtils.getPropertyValue(consumer,
"handler.sqsExecutor", SqsExecutor.class);
assertThat(executor, is(notNullValue()));
@SuppressWarnings("unchecked")
Set<Permission> permissions = (Set<Permission>) TestUtils
.getPropertyValue(executor, "permissions");
assertThat("permissions is not null", permissions, is(notNullValue()));
assertThat("all permissions loaded", permissions.size(), is(equalTo(1)));
}
开发者ID:3pillarlabs,
项目名称:spring-integration-aws,
代码行数:17,
代码来源:SqsPermissionsParserTests.java
示例3: outboundGatewayPermissions
点赞 3
import org.springframework.integration.endpoint.EventDrivenConsumer; //导入依赖的package包/类
@Test
public void outboundGatewayPermissions() {
EventDrivenConsumer consumer = context.getBean("sqs-gateway",
EventDrivenConsumer.class);
assertThat(consumer, is(notNullValue()));
final SqsExecutor executor = TestUtils.getPropertyValue(consumer,
"handler.sqsExecutor", SqsExecutor.class);
assertThat(executor, is(notNullValue()));
@SuppressWarnings("unchecked")
Set<Permission> permissions = (Set<Permission>) TestUtils
.getPropertyValue(executor, "permissions");
assertThat("permissions is not null", permissions, is(notNullValue()));
assertThat("all permissions loaded", permissions.size(), is(equalTo(1)));
}
开发者ID:3pillarlabs,
项目名称:spring-integration-aws,
代码行数:17,
代码来源:SqsPermissionsParserTests.java
示例4: outboundPermissions
点赞 3
import org.springframework.integration.endpoint.EventDrivenConsumer; //导入依赖的package包/类
@Test
public void outboundPermissions() {
EventDrivenConsumer consumer = context.getBean("sns-outbound",
EventDrivenConsumer.class);
assertThat(consumer, is(notNullValue()));
final SnsExecutor executor = TestUtils.getPropertyValue(consumer,
"handler.snsExecutor", SnsExecutor.class);
assertThat("snsExecutor is not null", executor, is(notNullValue()));
@SuppressWarnings("unchecked")
Set<Permission> permissions = (Set<Permission>) TestUtils
.getPropertyValue(executor, "permissions");
assertThat("permissions is not null", permissions, is(notNullValue()));
assertThat("all permissions loaded", permissions.size(), is(equalTo(1)));
}
开发者ID:3pillarlabs,
项目名称:spring-integration-aws,
代码行数:17,
代码来源:SnsPermissionsParserTests.java
示例5: outboundGatewayPermissions
点赞 3
import org.springframework.integration.endpoint.EventDrivenConsumer; //导入依赖的package包/类
@Test
public void outboundGatewayPermissions() {
EventDrivenConsumer consumer = context.getBean("sns-gateway",
EventDrivenConsumer.class);
assertThat(consumer, is(notNullValue()));
final SnsExecutor executor = TestUtils.getPropertyValue(consumer,
"handler.snsExecutor", SnsExecutor.class);
assertThat("snsExecutor is not null", executor, is(notNullValue()));
@SuppressWarnings("unchecked")
Set<Permission> permissions = (Set<Permission>) TestUtils
.getPropertyValue(executor, "permissions");
assertThat("permissions is not null", permissions, is(notNullValue()));
assertThat("all permissions loaded", permissions.size(), is(equalTo(1)));
}
开发者ID:3pillarlabs,
项目名称:spring-integration-aws,
代码行数:17,
代码来源:SnsPermissionsParserTests.java
示例6: doBindProducer
点赞 2
import org.springframework.integration.endpoint.EventDrivenConsumer; //导入依赖的package包/类
@Override
protected Binding<MessageChannel> doBindProducer(String name, MessageChannel channel, ExtendedProducerProperties<HermesProducerProperties> properties) {
Assert.isInstanceOf(SubscribableChannel.class, channel);
logger.debug("Binding Hermes client to topic " + name);
final MessageHandler handler = new HermesSendingHandler(name);
final EventDrivenConsumer consumer = createConsumer(name, (SubscribableChannel) channel, handler);
consumer.start();
return toBinding(name, channel, consumer);
}
开发者ID:jmnarloch,
项目名称:hermes-spring-cloud-starter-stream,
代码行数:11,
代码来源:HermesClientBinder.java
示例7: createConsumer
点赞 2
import org.springframework.integration.endpoint.EventDrivenConsumer; //导入依赖的package包/类
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();
return consumer;
}
开发者ID:jmnarloch,
项目名称:hermes-spring-cloud-starter-stream,
代码行数:8,
代码来源:HermesClientBinder.java
示例8: eventDrivenConsumer
点赞 2
import org.springframework.integration.endpoint.EventDrivenConsumer; //导入依赖的package包/类
/**
* Default endpoint
* @return
*/
@Bean(destroyMethod = "stop")
public EventDrivenConsumer eventDrivenConsumer() {
EventDrivenConsumer consumer = new EventDrivenConsumer(defaultInputChannel(), loggingHandler());
consumer.setAutoStartup(true);
return consumer;
}
开发者ID:bjornharvold,
项目名称:bearchoke,
代码行数:12,
代码来源:SpringIntegrationConfig.java
示例9: doBindProducer
点赞 2
import org.springframework.integration.endpoint.EventDrivenConsumer; //导入依赖的package包/类
@Override
protected Binding<MessageChannel> doBindProducer(String name, MessageChannel channel, ProducerProperties properties) {
Assert.isInstanceOf(SubscribableChannel.class, channel);
logger.debug("Binding Consul client to eventName " + name);
ConsulSendingHandler sendingHandler = new ConsulSendingHandler(this.eventService.getConsulClient(), name);
EventDrivenConsumer consumer = new EventDrivenConsumer((SubscribableChannel) channel, sendingHandler);
consumer.setBeanFactory(getBeanFactory());
consumer.setBeanName(String.format(BEAN_NAME_TEMPLATE, name));
consumer.afterPropertiesSet();
consumer.start();
return new DefaultBinding<>(name, null, channel, consumer);
}
开发者ID:spring-cloud,
项目名称:spring-cloud-consul,
代码行数:16,
代码来源:ConsulBinder.java
示例10: outboundAdapterConfig
点赞 2
import org.springframework.integration.endpoint.EventDrivenConsumer; //导入依赖的package包/类
@Test
public void outboundAdapterConfig() {
final EventDrivenConsumer consumer = context.getBean("sqsOutbound",
EventDrivenConsumer.class);
checkMessageMarshallerRef(getSqsExecutor(consumer,
"handler.sqsExecutor"));
}
开发者ID:3pillarlabs,
项目名称:spring-integration-aws,
代码行数:9,
代码来源:SqsMessageMarshallerTests.java
示例11: outboundGatewayConfig
点赞 2
import org.springframework.integration.endpoint.EventDrivenConsumer; //导入依赖的package包/类
@Test
public void outboundGatewayConfig() {
final EventDrivenConsumer consumer = context.getBean("sqsGateway",
EventDrivenConsumer.class);
checkMessageMarshallerRef(getSqsExecutor(consumer,
"handler.sqsExecutor"));
}
开发者ID:3pillarlabs,
项目名称:spring-integration-aws,
代码行数:9,
代码来源:SqsMessageMarshallerTests.java
示例12: outboundAdapterConfig
点赞 2
import org.springframework.integration.endpoint.EventDrivenConsumer; //导入依赖的package包/类
@Test
public void outboundAdapterConfig() {
final EventDrivenConsumer consumer = context.getBean("snsOutbound",
EventDrivenConsumer.class);
checkMessageMarshallerRef(getSnsExecutor(consumer,
"handler.snsExecutor"));
}
开发者ID:3pillarlabs,
项目名称:spring-integration-aws,
代码行数:9,
代码来源:SnsMessageMarshallerTests.java
示例13: outboundGatewayConfig
点赞 2
import org.springframework.integration.endpoint.EventDrivenConsumer; //导入依赖的package包/类
@Test
public void outboundGatewayConfig() {
final EventDrivenConsumer consumer = context.getBean("snsGateway",
EventDrivenConsumer.class);
checkMessageMarshallerRef(getSnsExecutor(consumer,
"handler.snsExecutor"));
}
开发者ID:3pillarlabs,
项目名称:spring-integration-aws,
代码行数:9,
代码来源:SnsMessageMarshallerTests.java
示例14: toBinding
点赞 2
import org.springframework.integration.endpoint.EventDrivenConsumer; //导入依赖的package包/类
private DefaultBinding<MessageChannel> toBinding(String name, MessageChannel channel, EventDrivenConsumer consumer) {
return new DefaultBinding<>(name, null, channel, consumer);
}
开发者ID:jmnarloch,
项目名称:hermes-spring-cloud-starter-stream,
代码行数:4,
代码来源:HermesClientBinder.java
示例15: setUp
点赞 2
import org.springframework.integration.endpoint.EventDrivenConsumer; //导入依赖的package包/类
public void setUp(String name, Class<?> cls) {
context = new ClassPathXmlApplicationContext(name, cls);
consumer = this.context.getBean("sqsOutboundChannelAdapter",
EventDrivenConsumer.class);
messageMarshaller = new JsonMessageMarshaller();
}
开发者ID:3pillarlabs,
项目名称:spring-integration-aws,
代码行数:7,
代码来源:SqsMessageHandlerParserTests.java
示例16: setUp
点赞 2
import org.springframework.integration.endpoint.EventDrivenConsumer; //导入依赖的package包/类
public void setUp(String name, Class<?> cls, String gatewayId) {
context = new ClassPathXmlApplicationContext(name, cls);
consumer = this.context.getBean(gatewayId, EventDrivenConsumer.class);
}
开发者ID:3pillarlabs,
项目名称:spring-integration-aws,
代码行数:5,
代码来源:SqsOutboundGatewayParserTests.java
示例17: testSnsMessageHandlerParser
点赞 2
import org.springframework.integration.endpoint.EventDrivenConsumer; //导入依赖的package包/类
@Test
public void testSnsMessageHandlerParser() throws Exception {
context = new ClassPathXmlApplicationContext(
"SnsMessageHandlerParserTests.xml", getClass());
EventDrivenConsumer consumer = context.getBean(
"snsOutboundChannelAdapter", EventDrivenConsumer.class);
final AbstractMessageChannel inputChannel = TestUtils.getPropertyValue(
consumer, "inputChannel", AbstractMessageChannel.class);
assertEquals("target", inputChannel.getComponentName());
final SnsExecutor snsExecutor = TestUtils.getPropertyValue(consumer,
"handler.snsExecutor", SnsExecutor.class);
assertNotNull(snsExecutor);
final String topicNameProperty = TestUtils.getPropertyValue(
snsExecutor, "topicName", String.class);
assertEquals("testTopic", topicNameProperty);
}
开发者ID:3pillarlabs,
项目名称:spring-integration-aws,
代码行数:25,
代码来源:SnsMessageHandlerParserTests.java