当前位置: 首页>>代码示例>>Java>>正文


Java MessageListenerAdapter类代码示例

本文整理汇总了Java中org.springframework.data.redis.listener.adapter.MessageListenerAdapter的典型用法代码示例。如果您正苦于以下问题:Java MessageListenerAdapter类的具体用法?Java MessageListenerAdapter怎么用?Java MessageListenerAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MessageListenerAdapter类属于org.springframework.data.redis.listener.adapter包,在下文中一共展示了MessageListenerAdapter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: listenerAdapter

import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; //导入依赖的package包/类
@Bean
MessageListenerAdapter listenerAdapter(RedisReceiver receiver)
{
    /*
     * The message listener adapter is also configured to call the
     * receiveMessage() method on Receiver when a message arrives
     */
    return new MessageListenerAdapter(receiver, "receiveMessage");
}
 
开发者ID:huangye177,项目名称:spring4probe,代码行数:10,代码来源:RedisConfig.java

示例2: listenerAdapter

import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; //导入依赖的package包/类
@Bean
public MessageListenerAdapter listenerAdapter() {
    return new MessageListenerAdapter((MessageListener) (message, bytes) -> {
        byte[] body = message.getBody();
        try {
            testStart(new String(body, Charset.defaultCharset()));
        } catch (IOException e) {
            LOGGER.error(e.getMessage(), e);
        }
    });
}
 
开发者ID:globocom,项目名称:groot,代码行数:12,代码来源:TestListenerService.java

示例3: setupListener

import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; //导入依赖的package包/类
private void setupListener(RedisSerializer<?> listenerSerializer) throws InterruptedException {
	MessageListenerAdapter listener = new MessageListenerAdapter();
	listener.setDelegate(new Listener(latch));
	listener.setSerializer(listenerSerializer);
	listener.afterPropertiesSet();

	this.container = new RedisMessageListenerContainer();
	container.setConnectionFactory(connectionFactory);
	container.afterPropertiesSet();
	container.addMessageListener(listener, Collections.<Topic> singletonList(new ChannelTopic(TOPIC)));
	container.start();
	Thread.sleep(1000);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-stream-binder-redis,代码行数:14,代码来源:RedisPublishingMessageHandlerTests.java

示例4: redisMessageListenerContainer

import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; //导入依赖的package包/类
@Bean
public RedisMessageListenerContainer redisMessageListenerContainer(
        RedisConnectionFactory connectionFactory,
        MessageListenerAdapter listenerAdapter) {

    RedisMessageListenerContainer container = new RedisMessageListenerContainer();
    container.setConnectionFactory(connectionFactory);
    container.addMessageListener(listenerAdapter, new PatternTopic("__key*__:*"));

    return container;
}
 
开发者ID:joelchartier,项目名称:slackbot-pomodoro,代码行数:12,代码来源:RedisListenerConfiguration.java

示例5: listenerAdapter

import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; //导入依赖的package包/类
@Bean
MessageListenerAdapter listenerAdapter(Receiver receiver) {
	return new MessageListenerAdapter(receiver, "receiveMessage");
}
 
开发者ID:SystemOfAProg,项目名称:VS2Labor,代码行数:5,代码来源:Application.java

示例6: messageListener

import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; //导入依赖的package包/类
@Bean
MessageListenerAdapter messageListener() {
    return new MessageListenerAdapter(new MessageSubscriber());
}
 
开发者ID:michaelcgood,项目名称:spring-data-redis-example,代码行数:5,代码来源:RedisConfig.java

示例7: messageListener

import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; //导入依赖的package包/类
@Bean
MessageListenerAdapter messageListener() {
    return new MessageListenerAdapter(new RedisInfoSubscriber());
}
 
开发者ID:V-I-C-T-O-R,项目名称:DataM,代码行数:5,代码来源:RedisConfig.java

示例8: listenerAdapter

import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; //导入依赖的package包/类
@Bean
MessageListenerAdapter listenerAdapter(Consumer consumer) {
	return new MessageListenerAdapter(consumer, "messageHandler");
}
 
开发者ID:Apress,项目名称:pro-spring-boot,代码行数:5,代码来源:RedisConfig.java

示例9: listenerAdapter

import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; //导入依赖的package包/类
@Bean
MessageListenerAdapter listenerAdapter(CompletedPomodoroNotifier receiver) {
    return new MessageListenerAdapter(receiver, "notifyUser");
}
 
开发者ID:joelchartier,项目名称:slackbot-pomodoro,代码行数:5,代码来源:RedisListenerConfiguration.java

示例10: gameMessageListener

import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; //导入依赖的package包/类
@Bean
public MessageListener gameMessageListener(SimpMessagingTemplate simpMessagingTemplate) {
    return new MessageListenerAdapter(new GameEventConsumer(simpMessagingTemplate));
}
 
开发者ID:Turbots,项目名称:SpringOne2016,代码行数:5,代码来源:RedisConfiguration.java

示例11: chatMessageListener

import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; //导入依赖的package包/类
@Bean
public MessageListener chatMessageListener(SimpMessagingTemplate simpMessagingTemplate) {
    return new MessageListenerAdapter(new ChatEventConsumer(simpMessagingTemplate));
}
 
开发者ID:Turbots,项目名称:SpringOne2016,代码行数:5,代码来源:RedisConfiguration.java

示例12: creditApplicationApprovedMessageListener

import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; //导入依赖的package包/类
@Bean
MessageListenerAdapter creditApplicationApprovedMessageListener(CreditApplicationApprovedEventReceiver receiver) {
    MessageListenerAdapter messageListenerAdapter = new MessageListenerAdapter(receiver, "receiveMessage");
    messageListenerAdapter.setSerializer(new Jackson2JsonRedisSerializer<CreditApplicationApprovedEvent>(CreditApplicationApprovedEvent.class));
    return messageListenerAdapter;
}
 
开发者ID:mploed,项目名称:ddd-strategic-design-spring-boot,代码行数:7,代码来源:RedisConfiguration.java

示例13: creditApplicationDeclinedMessageListener

import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; //导入依赖的package包/类
@Bean
MessageListenerAdapter creditApplicationDeclinedMessageListener(CreditApplicationDeclinedEventReceiver receiver) {
    MessageListenerAdapter messageListenerAdapter = new MessageListenerAdapter(receiver, "receiveMessage");
    messageListenerAdapter.setSerializer(new Jackson2JsonRedisSerializer<CreditApplicationDeclinedEvent>(CreditApplicationDeclinedEvent.class));
    return messageListenerAdapter;
}
 
开发者ID:mploed,项目名称:ddd-strategic-design-spring-boot,代码行数:7,代码来源:RedisConfiguration.java

示例14: customerCreatedMessageListener

import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; //导入依赖的package包/类
@Bean
MessageListenerAdapter customerCreatedMessageListener(CustomerCreatedEventReceiver receiver) {
    MessageListenerAdapter messageListenerAdapter = new MessageListenerAdapter(receiver, "receiveMessage");
    messageListenerAdapter.setSerializer(new Jackson2JsonRedisSerializer<CustomerCreatedEvent>(CustomerCreatedEvent.class));
    return messageListenerAdapter;
}
 
开发者ID:mploed,项目名称:ddd-strategic-design-spring-boot,代码行数:7,代码来源:RedisConfiguration.java

示例15: sampleMessageListener

import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; //导入依赖的package包/类
@Bean
MessageListenerAdapter sampleMessageListener() {
	return new MessageListenerAdapter( new MessageListenerImpl() );
}
 
开发者ID:qwefgh90,项目名称:ChangTalk,代码行数:5,代码来源:Application.java


注:本文中的org.springframework.data.redis.listener.adapter.MessageListenerAdapter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。