0

I have two java projects. Both of these projects use embedded ActiveMQ using Spring framework.

How do I create a common broker for both of these projects?

Zeeshan
  • 177
  • 1
  • 15

1 Answers1

1

If Spring Boot is an option I would create an independant application and use ActiveMQ messages to communicate with both "projects".

Go Microservices.

Another alternative might be to just have a third project consuming and publishing to the same ActiveMQ instance. I don't see any issue there. Actually a Message Bus is an excellent way of decoupling and communicating different projects or applications.

Fernando
  • 396
  • 1
  • 5
  • I have created a spring boot microservice which just starts the broker. Then I removed the broker statements from the other two spring mvc projects. I got the following error. **ERROR BrokerService:608 - Failed to start Apache ActiveMQ ([localhost, null], javax.management.InstanceAlreadyExistsException: org.apache.activemq:type=Broker,brokerName=localhost) WARN ManagementContext:158 - Failed to start JMX connector Cannot bind to URL [rmi://localhost:1099/jmxrmi]: javax.naming.NameAlreadyBoundException: jmxrmi [Root exception is java.rmi.AlreadyBoundException: jmxrmi]** – Zeeshan May 03 '17 at 07:09
  • Looks like the old one is still running. Check the services that are running on your box and kill it. – Fernando May 03 '17 at 08:19
  • the above error comes only when I run my spring mvc applications. Not when I run Spring microservice. – Zeeshan May 03 '17 at 09:02