{"id":6762,"date":"2017-06-03T18:30:09","date_gmt":"2017-06-03T10:30:09","guid":{"rendered":"http:\/\/rmohan.com\/?p=6762"},"modified":"2017-06-03T18:30:09","modified_gmt":"2017-06-03T10:30:09","slug":"activemq-standalone-installation-and-use-tutorial","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=6762","title":{"rendered":"ActiveMQ standalone installation and use tutorial"},"content":{"rendered":"<p><strong>ActiveMQ standalone installation and use tutorial<\/strong><\/p>\n<p>First of all, simply introduce the MQ, MQ English name MessageQueue, Chinese name is that we use the message queue, why use it, that white is a message to accept and forward the container can be used for message push.<\/p>\n<p>ActiveMQ is produced by Apache, one of the most popular, powerful open source message bus. ActiveMQ is a JMS provider implementation that fully supports JMS 1.1 and J2EE 1.4 specifications. It is very fast and supports multiple languages ??of clients and protocols, and can be easily embedded into enterprise application environments with many advanced features, Here we have to install ActiveMQ standalone version.<\/p>\n<p>1. In the official website to download ActiveMQ, and upload to the server<\/p>\n<p>2. Unpack the installation<\/p>\n<p># tar -zxvf apache-activemq-5.11.1-bin.tar.gz<br \/>\n3. If the startup script activemq does not have executable permissions, then you need authorization<\/p>\n<p># chmod 755 \/opt\/activeMQ\/apache-activemq-5.11.1\/bin\/activemq<br \/>\n4. Configure the port<\/p>\n<p>ActiveMQ(???61616)<br \/>\n( 8161) conf\/jetty.xml<br \/>\n<bean id=\"jettyPort\" class=\"org.apache.activemq.web.WebConsolePort\" init-method=\"start\"><br \/>\n    <!-- the default port number for the web console -->\n    <property name=\"host\" value=\"0.0.0.0\"\/>\n    <property name=\"port\" value=\"8161\"\/>\n<\/bean><\/p>\n<p>5. Start ActiveMQ<\/p>\n<p># \/opt\/activeMQ\/apache-activemq-5.11.1\/bin\/activemq start<\/p>\n<p>6. Access ActiveMQ<\/p>\n<p>Click manage ActiveMQ account password verification interface, the default account password: admin \/ admin<\/p>\n<p>7. Security<br \/>\nconfiguration ActiveMQ If you do not join the security mechanism, anyone who knows the specific address of the message service (including IP, port, message address [queue or subject address]), can be unscrupulous to send and receive messages. So we have to configure ActiveMQ security, ActiveMQ message security configuration strategy has a variety of, we take a simple authorization configuration as an example.<\/p>\n<p>7.1 In the conf\/activemq.xml file, add the following at the end of the broker tag:<\/p>\n<p> # vim \/opt\/activeMQ\/apache-activemq-5.11.1\/conf\/activemq.xml<\/p>\n<plugins>\n    <simpleAuthenticationPlugin><br \/>\n       <users><br \/>\n          <authenticationUser username=\"roberto\" password=\"roberto\" groups=\"users,admins\"\/><br \/>\n       <\/users><br \/>\n    <\/simpleAuthenticationPlugin>\n <\/plugins>\n roberto roberto,users,admins<br \/>\n7.2 Make sure that authentication is enabled<\/p>\n<p>authenticate true<br \/>\n<bean id=\"securityConstraint\" class=\"org.eclipse.jetty.util.security.Constraint\">\n    <property name=\"name\" value=\"BASIC\" \/>\n    <property name=\"roles\" value=\"user,admin\" \/>\n    <!-- set authenticate=false to disable login -->\n    <property name=\"authenticate\" value=\"true\" \/>\n<\/bean><\/p>\n<p>7.3 Console Login User Name The password is stored in the conf\/jetty-realm.properties file, as follows:<\/p>\n<p># vim \/opt\/activeMQ\/apache-activemq-5.11.1\/conf\/jetty-realm.properties <\/p>\n<p># Defines users that can access the web (console, demo, etc.)<br \/>\n# username: password [,rolename &#8230;]<br \/>\nadmin: roberto, admin<br \/>\nuser: user, user<br \/>\nModify the admin user&#8217;s password to roberto<\/p>\n<p>7.4 Restart ActiveMQ<br \/>\n# \/opt\/activeMQ\/apache-activemq-5.11.1\/bin\/activemq restart<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ActiveMQ standalone installation and use tutorial<\/p>\n<p>First of all, simply introduce the MQ, MQ English name MessageQueue, Chinese name is that we use the message queue, why use it, that white is a message to accept and forward the container can be used for message push.<\/p>\n<p>ActiveMQ is produced by Apache, one of the most [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[57],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6762"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6762"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6762\/revisions"}],"predecessor-version":[{"id":6763,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6762\/revisions\/6763"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}