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


Java RedisMessageListenerContainer类代码示例

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


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

示例1: redisMessageListenerContainer

import org.springframework.data.redis.listener.RedisMessageListenerContainer; //导入依赖的package包/类
@Bean
public RedisMessageListenerContainer redisMessageListenerContainer() {
	RedisMessageListenerContainer container = new RedisMessageListenerContainer();
	container.setConnectionFactory(this.redisConnectionFactory);
	if (this.redisTaskExecutor != null) {
		container.setTaskExecutor(this.redisTaskExecutor);
	}
	if (this.redisSubscriptionExecutor != null) {
		container.setSubscriptionExecutor(this.redisSubscriptionExecutor);
	}
	container.addMessageListener(sessionRepository(),
			Arrays.asList(new PatternTopic("[email protected]*:del"),
					new PatternTopic("[email protected]*:expired")));
	container.addMessageListener(sessionRepository(),
			Collections.singletonList(new PatternTopic(
					sessionRepository().getSessionCreatedChannelPrefix() + "*")));
	return container;
}
 
开发者ID:spring-projects,项目名称:spring-session,代码行数:19,代码来源:RedisHttpSessionConfiguration.java

示例2: redisMessageListenerContainer

import org.springframework.data.redis.listener.RedisMessageListenerContainer; //导入依赖的package包/类
@Bean
RedisMessageListenerContainer redisMessageListenerContainer() {
    final RedisMessageListenerContainer container = new RedisMessageListenerContainer();

    container.setConnectionFactory( getConnectionFactory() );
    container.addMessageListener( messageListenerAdapter(), createTopic() );

    return container;
}
 
开发者ID:omanand,项目名称:spring-data-redis-demo,代码行数:10,代码来源:AppConfiguration.java

示例3: redisContainer

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

示例4: redisContainer

import org.springframework.data.redis.listener.RedisMessageListenerContainer; //导入依赖的package包/类
@Bean
RedisMessageListenerContainer redisContainer() {
    final RedisMessageListenerContainer container = new RedisMessageListenerContainer();
    container.setConnectionFactory(jedisConnectionFactory());
    container.addMessageListener(messageListener(), topic());
    return container;
}
 
开发者ID:michaelcgood,项目名称:spring-data-redis-example,代码行数:8,代码来源:RedisConfig.java

示例5: redisMessageListenerContainer

import org.springframework.data.redis.listener.RedisMessageListenerContainer; //导入依赖的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

示例6: setUp

import org.springframework.data.redis.listener.RedisMessageListenerContainer; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
   RedisConnectionFactory connectionFactory = TestRedis.connectionFactory();

   WorkerDaoImpl workerDao = new WorkerDaoImpl();
   workerDao.setConnectionFactory(connectionFactory);
   workerDao.setNamespace("test");
   workerDao.afterPropertiesSet();

   RedisMessageListenerContainer listenerContainer = new RedisMessageListenerContainer();
   listenerContainer.setConnectionFactory(connectionFactory);
   listenerContainer.afterPropertiesSet();
   listenerContainer.start();

   ChannelDaoImpl channelDao = new ChannelDaoImpl();
   channelDao.setConnectionFactory(connectionFactory);
   channelDao.setNamespace("test");
   channelDao.setExecutions(new TestExecutionRedisSerializer(TestJob.class));
   channelDao.afterPropertiesSet();

   ChannelWorkerFactoryBean factory = new ChannelWorkerFactoryBean();
   factory.setWorkerDao(workerDao);
   factory.setChannelDao(channelDao);
   factory.setChannels("test-channel");
   factory.setListenerContainer(listenerContainer);
   factory.setApplicationEventPublisher(eventBus);
   factory.setJobRunnerFactory(new TestJobRunnerFactory());
   factory.afterPropertiesSet();

   channelWorker = factory.getObject();
   this.channelDao = channelWorker.getChannelDao();
   channelWorker.start();

   // Wait for subscription of worker to the channel.
   Thread.sleep(1000);
}
 
开发者ID:shopping24,项目名称:redjob,代码行数:37,代码来源:ChannelWorkerIT.java

示例7: setupListener

import org.springframework.data.redis.listener.RedisMessageListenerContainer; //导入依赖的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

示例8: redisContainer

import org.springframework.data.redis.listener.RedisMessageListenerContainer; //导入依赖的package包/类
@Bean
public RedisMessageListenerContainer redisContainer(SimpMessagingTemplate simpMessagingTemplate) {
    RedisMessageListenerContainer container = new RedisMessageListenerContainer();
    container.setConnectionFactory(redisConnectionFactory());
    container.addMessageListener(gameMessageListener(simpMessagingTemplate), gameTopic());
    container.addMessageListener(chatMessageListener(simpMessagingTemplate), chatTopic());

    return container;
}
 
开发者ID:Turbots,项目名称:SpringOne2016,代码行数:10,代码来源:RedisConfiguration.java

示例9: SubscriptionManagement

import org.springframework.data.redis.listener.RedisMessageListenerContainer; //导入依赖的package包/类
@Autowired
public SubscriptionManagement(
    StompRedisRelayProperties properties,
    RedisMessageListenerContainer redisMessageListenerContainer) {

    this.properties = properties;
    this.redisMessageListenerContainer = redisMessageListenerContainer;
}
 
开发者ID:itzg,项目名称:redis-stomp-relay,代码行数:9,代码来源:SubscriptionManagement.java

示例10: redisMessageListenerContainer

import org.springframework.data.redis.listener.RedisMessageListenerContainer; //导入依赖的package包/类
@Bean
public RedisMessageListenerContainer redisMessageListenerContainer(
        // provided by Spring Boot
        @SuppressWarnings("SpringJavaAutowiringInspection") RedisConnectionFactory redisConnectionFactory
) {
    final RedisMessageListenerContainer bean = new RedisMessageListenerContainer();
    bean.setConnectionFactory(redisConnectionFactory);

    return bean;
}
 
开发者ID:itzg,项目名称:redis-stomp-relay,代码行数:11,代码来源:RedisConfig.java

示例11: redisMessageListenerContainer

import org.springframework.data.redis.listener.RedisMessageListenerContainer; //导入依赖的package包/类
@Bean
public RedisMessageListenerContainer redisMessageListenerContainer(
        RedisConnectionFactory redisConnectionFactory) {
    RedisMessageListenerContainer container = new RedisMessageListenerContainer();
    container.setConnectionFactory(redisConnectionFactory);
    return container;
}
 
开发者ID:fastnsilver,项目名称:xlator,代码行数:8,代码来源:Application.java

示例12: createDefaultListenerContainer

import org.springframework.data.redis.listener.RedisMessageListenerContainer; //导入依赖的package包/类
private RedisMessageListenerContainer createDefaultListenerContainer() {
    listenerContainer = new RedisMessageListenerContainer();
    managedListenerContainer = true;
    listenerContainer.setConnectionFactory(getConnectionFactory());
    listenerContainer.afterPropertiesSet();
    listenerContainer.start();
    return listenerContainer;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:9,代码来源:RedisConfiguration.java

示例13: redisContainer

import org.springframework.data.redis.listener.RedisMessageListenerContainer; //导入依赖的package包/类
@Bean
RedisMessageListenerContainer redisContainer() {
	final RedisMessageListenerContainer container = new RedisMessageListenerContainer();
	container.setConnectionFactory( jedisConnFactory() );
	container.addMessageListener( sampleMessageListener(), sampleTopic() );
	return container;
}
 
开发者ID:qwefgh90,项目名称:ChangTalk,代码行数:8,代码来源:Application.java

示例14: getListenerContainer

import org.springframework.data.redis.listener.RedisMessageListenerContainer; //导入依赖的package包/类
/**
 * Message listener container.
 */
public RedisMessageListenerContainer getListenerContainer() {
   return worker.getListenerContainer();
}
 
开发者ID:shopping24,项目名称:redjob,代码行数:7,代码来源:ChannelWorkerFactoryBean.java

示例15: setListenerContainer

import org.springframework.data.redis.listener.RedisMessageListenerContainer; //导入依赖的package包/类
/**
 * Message listener container.
 */
public void setListenerContainer(RedisMessageListenerContainer listenerContainer) {
   worker.setListenerContainer(listenerContainer);
}
 
开发者ID:shopping24,项目名称:redjob,代码行数:7,代码来源:ChannelWorkerFactoryBean.java


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