Below is how I load my redisnode( using redis server) with the configuration as stated on https://github.com/redisson/redisson/wiki/9.-distributed-services#944-distributed-scheduled-executor-service-scheduling-a-task-with-spring-beans where it says to use the BeanFactory to load the spring beans.
@Bean(destroyMethod = "shutdown")
RedissonNode redissonNode(){
Config config = new Config();
config.useSingleServer().setAddress("redis://" + redisHost + ":" + redisPort + "");
RedissonNodeConfig nodeConfig = new RedissonNodeConfig(config);
nodeConfig.setExecutorServiceWorkers(Collections.singletonMap("myExecutor", 1));
nodeConfig.setBeanFactory(beanFactory);
RedissonNode node = RedissonNode.create(nodeConfig);
node.start();
return node;
}
But I still get the NoSuchBeanDefinitionException: No qualifying bean of type 'xx.xx.xx.xx.xx.BrandService' error when the Runnable Task is called where I am auto-wiring my services. Below is how I am using @Autowire in the runnable task
@RInject
private RedissonClient redissonClient;
@Autowired
@Qualifier("brandService")
private BrandService brandService;
@Autowired
private BranchService branchService;
I have used the following on Application as configuration to load all the possible beans
@ComponentScan(basePackages = {"xx.xx.project"})
Any ideas what am I missing ?