I get error when I run the main class.
Error:
Action: Consider defining a bean of type \'seconds47.service.TopicService\' in your c
A class must have the @Component annotation or a derivation of that (like @Service, @Repository etc.) to be recognized as a Spring bean by the component scanning. So if you add @Component to the class, it should solve your problem.
@Component
@Service
@Repository