is there any way to start activemq server automatically on system startup in Mac OS? I would like it to start whenever I start the system.
I tried to find in official document, but couldn't find it.
It depends how you installed it.
If you did the sensible thing and installed it via homebrew, then you can start it immediately and on all future restarts with:
brew services start activemq
This information would have been displayed to you when you installed activemq
, but in case you forgot it, you can get it again with the following command (see last 3 lines specifically):
brew info activemq
Sample Output
activemq: stable 5.15.6
Apache ActiveMQ: powerful open source messaging server
https://activemq.apache.org/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/activemq.rb
==> Requirements
Required: java >= 1.7 ✔
==> Caveats
To have launchd start activemq now and restart at login:
brew services start activemq
Or, if you don't want/need a background service you can just run:
activemq start
If you decided to do things the hard way, and installed it from source, you will need to use launchctl
to interact with Apple's launchd
. An example is here.