posted 5 years ago
I'm a little confused about the appropriate way to break up my Spring application. Currently, I have it set up like this:
src/main/java/com.company.registration
--Application.java
--config
----JMSConfig.java
--services
----SubscriptionListener.java
I have other folders (model, dao, etc.) but this is sufficient to illustrate my confusion... Currently, I have an @EnableJms tag in the JMSConfig file, as well as the appropriate configuration and setup. I also have a class annotated with @JmsListener in the SubscriptionListener.java file. If I run the application with this setup, the Listener is not picked up, and therefore, doesn't listen. However, if I move the JMSConfig file under the services folder, it recognizes my listener and configures it correctly. I was under the impression it was important to separate out the config classes, but I can't seem to get it work unless I drop it in the same sub-folder. Is there something I'm doing wrong or missing about how Spring connects the dots? Do they not work across sub-folders? Is there a way I can get it to work, and if not, what is the appropriate way to do this?
Thanks!