Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

8.6.2. Configuring the Sample Routing Plug-In


OpenShift Enterprise includes a sample routing plug-in for publishing routing information on an ActiveMQ queue, which allows an external routing layer to route traffic for high-availability applications. In addition to enabling the sample plug-in on the broker host, the ActiveMQ configuration must be modified.

Procedure 8.18. To Enable and Configure the Sample Routing Plug-in:

  1. Add a new user, topic, and queue to ActiveMQ. On each ActiveMQ broker, edit the /etc/activemq/activemq.xml file and add the following line within the <users> section, replacing routinginfopasswd with your own password:
    <authenticationUser username="routinginfo" password="routinginfopasswd" groups="routinginfo,everyone"/>
    Copy to Clipboard Toggle word wrap

    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>
    Copy to Clipboard Toggle word wrap
  2. 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" />
    Copy to Clipboard Toggle word wrap

    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>
    Copy to Clipboard Toggle word wrap
  3. 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>
    Copy to Clipboard Toggle word wrap
  4. 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"
    	>
    Copy to Clipboard Toggle word wrap
  5. Restart the activemq service:
    # service activemq restart
    Copy to Clipboard Toggle word wrap
  6. On the broker host, verify that the rubygem-openshift-origin-routing-activemq package is installed:
    # yum install rubygem-openshift-origin-routing-activemq
    Copy to Clipboard Toggle word wrap
  7. Copy the /etc/openshift/plugins.d/openshift-origin-routing-activemq.conf.example file 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
    Copy to Clipboard Toggle word wrap
  8. Edit the /etc/openshift/plugins.d/openshift-origin-routing-activemq.conf file and ensure the ACTIVEMQ_HOST and ACTIVEMQ_PORT parameters are set appropriately for your ActiveMQ broker. Set the ACTIVEMQ_PASSWORD parameter to the password chosen for the routinginfo user:

    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'
    Copy to Clipboard Toggle word wrap
    In OpenShift Enterprise 2.1.2 and later, you can set the ACTIVEMQ_HOST parameter as a comma-separated list of host:port pairs if you are using multiple ActiveMQ brokers:

    Example 8.17. Example ACTIVEMQ_HOST Setting Using Multiple ActiveMQ Brokers

    ACTIVEMQ_HOST='192.168.59.163:61613,192.168.59.147:61613'
    Copy to Clipboard Toggle word wrap
  9. You can optionally enable SSL connections per ActiveMQ host. To do so, set the MCOLLECTIVE_CONFIG parameter in the /etc/openshift/plugins.d/openshift-origin-routing-activemq.conf file to the MCollective client configuration file used by the broker:
    MCOLLECTIVE_CONFIG='/opt/rh/ruby193/root/etc/mcollective/client.cfg'
    Copy to Clipboard Toggle word wrap
    Note that while setting the MCOLLECTIVE_CONFIG parameter overrides the ACTIVEMQ_HOST and ACTIVEMQ_PORT parameters in this file, the ACTIVEMQ_USERNAME and ACTIVEMQ_PASSWORD parameters in this file are still used by the routing plug-in and must be set.
  10. Restart the broker service:
    # service openshift-broker restart
    Copy to Clipboard Toggle word wrap
Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat