-{%highlight xml linenos %}
- <broker xmlns="http://activemq.org/config/1.0" brokerName="noc1-broker" useJmx="true"
- dataDirectory="${activemq.base}/data">
-
- <transportConnectors>
- <transportConnector name="openwire" uri="tcp://0.0.0.0:6166"/>
- <transportConnector name="stomp" uri="stomp://0.0.0.0:6163"/>
- </transportConnectors>
-{% endhighlight %}
-
- * *The _brokerName_ attribute is important and should be unique.* (Leaving it set to localhost will cause message loops to occur)
- * The _openwire_ transport is the important one here, you can make it listen on specific hosts and ports as shown.
-
-## Connecting to other ActiveMQs
-
-Next up you should configure the _networkConnectors_:
-
-{%highlight xml linenos %}
- <networkConnectors>
- <networkConnector name="noc1-dc1amq1" uri="static:(tcp://192.168.1.10:6166)" userName="amq" password="Afuphohxoh" duplex="true"/>
- </networkConnectors>
-{% endhighlight %}
-
-Here we're connecting the NOC to Data Center 1.
-
- * The _name_ on each connector should be unique, I just list the pair of hostnames involved which should be unique.
- * This is a bi-directional connection it can send and receive traffic, you can make uni directional connections too if you wanted
- * We're authenticating with a username and password
-
-There are many more options you can set on these connectors and it varies on your topology, you can make a ring of brokers or redundant meshes etc.
-
-### Setting up Authentication
-
-We have an [entire page dedicated][SecurityWithActiveMQ] to the subject of users and authentication, you should check that page out for full details but here's a simple bit of config for the authentication above.
-
-{%highlight xml linenos %}
- <plugins>
- <simpleAuthenticationPlugin>
- <users>
- <authenticationUser username="amq" password="Afuphohxoh" groups="admins,everyone"/>
- </users>
- </simpleAuthenticationPlugin>
- <authorizationPlugin>
- <map>
- <authorizationMap>
- <authorizationEntries>
- <authorizationEntry queue=">" write="admins" read="admins" admin="admins" />
- <authorizationEntry topic=">" write="admins" read="admins" admin="admins" />
- </authorizationEntries>
- </authorizationMap>
- </map>
- </authorizationPlugin>
- </plugins>
- </broker>
-{% endhighlight %}
-
-You can now duplicate this on your other nodes, the NOC will have users and NetworkConnectors for the Data Center 2 as well, you can also flip it around so the DCs connect to the NOC which might be more secure.