8.6.2. Configuring the Sample Routing Plug-In
Procedure 8.18. To Enable and Configure the Sample Routing Plug-in:
- Add a new user, topic, and queue to ActiveMQ. On each ActiveMQ broker, edit the
/etc/activemq/activemq.xmlfile and add the following line within the<users>section, replacingroutinginfopasswdwith your own password:<authenticationUser username="routinginfo" password="routinginfopasswd" groups="routinginfo,everyone"/>
Example 8.14. Example <users> Section
<users> <authenticationUser username="mcollective" password="marionette" groups="mcollective,everyone"/> <authenticationUser username="admin" password="secret" groups="mcollective,admin,everyone"/> <authenticationUser username="routinginfo" password="routinginfopasswd" groups="routinginfo,everyone"/> </users>
- Add the following lines within the
<authorizationEntries>section:<authorizationEntry topic="routinginfo.>" write="routinginfo" read="routinginfo" admin="routinginfo" /> <authorizationEntry queue="routinginfo.>" write="routinginfo" read="routinginfo" admin="routinginfo" />
Example 8.15. Example <authorizationEntries> Section
<authorizationEntries> <authorizationEntry queue=">" write="admins" read="admins" admin="admins" /> <authorizationEntry topic=">" write="admins" read="admins" admin="admins" /> <authorizationEntry topic="mcollective.>" write="mcollective" read="mcollective" admin="mcollective" /> <authorizationEntry queue="mcollective.>" write="mcollective" read="mcollective" admin="mcollective" /> <authorizationEntry topic="ActiveMQ.Advisory.>" read="everyone" write="everyone" admin="everyone"/> <authorizationEntry topic="routinginfo.>" write="routinginfo" read="routinginfo" admin="routinginfo" /> <authorizationEntry queue="routinginfo.>" write="routinginfo" read="routinginfo" admin="routinginfo" /> </authorizationEntries>
- Add the following lines within the
<plugins>section:<redeliveryPlugin fallbackToDeadLetter="true" sendToDlqIfMaxRetriesExceeded="true"> <redeliveryPolicyMap> <redeliveryPolicyMap> <redeliveryPolicyEntries> <redeliveryPolicy queue="routinginfo" maximumRedeliveries="4" useExponentialBackOff="true" backOffMultiplier="4" initialRedeliveryDelay="2000" /> </redeliveryPolicyEntries> </redeliveryPolicyMap> </redeliveryPolicyMap> </redeliveryPlugin> - Add the
schedulerSupport="true"directive within the<broker>section:<broker xmlns="http://activemq.apache.org/schema/core" brokerName="activemq.example.com" dataDirectory="${activemq.data}" schedulePeriodForDestinationPurge="60000" schedulerSupport="true" > - Restart the
activemqservice:#
service activemq restart - On the broker host, verify that the rubygem-openshift-origin-routing-activemq package is installed:
#
yum install rubygem-openshift-origin-routing-activemq - Copy the
/etc/openshift/plugins.d/openshift-origin-routing-activemq.conf.examplefile to/etc/openshift/plugins.d/openshift-origin-routing-activemq.conf:#
cp /etc/openshift/plugins.d/openshift-origin-routing-activemq.conf.example /etc/openshift/plugins.d/openshift-origin-routing-activemq.conf - Edit the
/etc/openshift/plugins.d/openshift-origin-routing-activemq.conffile and ensure theACTIVEMQ_HOSTandACTIVEMQ_PORTparameters are set appropriately for your ActiveMQ broker. Set theACTIVEMQ_PASSWORDparameter to the password chosen for theroutinginfouser:Example 8.16. Example Routing Plug-in Configuration File
ACTIVEMQ_TOPIC='/topic/routinginfo' ACTIVEMQ_USERNAME='routinginfo' ACTIVEMQ_PASSWORD='routinginfopasswd' ACTIVEMQ_HOST='127.0.0.1' ACTIVEMQ_PORT='61613'
In OpenShift Enterprise 2.1.2 and later, you can set theACTIVEMQ_HOSTparameter as a comma-separated list of host:port pairs if you are using multiple ActiveMQ brokers:Example 8.17. Example
ACTIVEMQ_HOSTSetting Using Multiple ActiveMQ BrokersACTIVEMQ_HOST='192.168.59.163:61613,192.168.59.147:61613'
- You can optionally enable SSL connections per ActiveMQ host. To do so, set the
MCOLLECTIVE_CONFIGparameter in the/etc/openshift/plugins.d/openshift-origin-routing-activemq.conffile to the MCollective client configuration file used by the broker:MCOLLECTIVE_CONFIG='/opt/rh/ruby193/root/etc/mcollective/client.cfg'
Note that while setting theMCOLLECTIVE_CONFIGparameter overrides theACTIVEMQ_HOSTandACTIVEMQ_PORTparameters in this file, theACTIVEMQ_USERNAMEandACTIVEMQ_PASSWORDparameters in this file are still used by the routing plug-in and must be set. - Restart the broker service:
#
service openshift-broker restart

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.