Communication between two java classes using Spring
I have two java classes that implements Runnable within the same application, let's say A and B classes.
These two classes share a BlockingQueue to pass some data. Class A sends data to class B through BlockingQueue. Then class B takes the data and process it. What I am trying to do is that when some conditions happen in class B as a result of process this data, it sends a messages to class A, and class A prints these messages.
So I was having a look at Spring messaging using Apache ActiveMQ, but it seems a broker must be started in order communication works using "activemq start" command. Is there any possibility to do this without having this broker started?
What is the best option to do this? I would like to do this using Spring framework so can be done using some kind of approach in Spring? Or the only possiblity using spring is through apache activemq?