Wiki Markup |
---|
{scrollbar} |
Excerpt |
---|
To configure the JMS Server, select JMS Server on the Console Navigation menu on the left hand side. You will get a list of JMS brokers available in the server and their status in the JMS Server Manager portlet. You will be also presented with the JMS Network Listeners portlet that displays all JMS network connectors. |
Adding a new JMS broker
To add a new JMS broker, click on the link Add JMS Broker. In the resulting page, you will be provided with a template for the ActiveMQ broker. The following figure illustrates the template:
It contains some customized configurations by Geronimo. It is strongly recommended that you add your own configurations based on the template file, instead of copying it from elsewhere.
- Enter the name of your new broker, in this example, testborker.
- By default, keep the placeholders in the configuration file as they are. Geronimo will replace them with real values in the runtime. Here is an example:
No Format ${activemq.brokerName}
- In most cases, you only have to add a new connector for the new borker. Uncomment the element for the connector. and replace the
*
with an available port number in your machine. Be sure to keep the placeholder style; otherwise, some advanced features such as the cluster might not work due to port conflict.
After you add the connector, the section should be something like:Code Block xml xml <!-- The transport connectors expose ActiveMQ over a given protocol to clients and other brokers. For more information, see: http://activemq.apache.org/configuring-transports.html --> <transportConnectors> <!-- <transportConnector name="openwire" uri="tcp://localhost:${* + ${PortOffset}}" /> <transportConnector name="openwire2" uri="tcp://localhost:${* + ${PortOffset}}" discoveryUri="multicast://default"/> <transportConnector name="ssl" uri="ssl://localhost:${* + ${PortOffset}}"/> <transportConnector name="stomp" uri="stomp://localhost:${* + ${PortOffset}}"/> --> </transportConnectors>
Code Block xml xml <transportConnector name="openwire" uri="tcp://localhost:${60000 + ${PortOffset}}"/>
- Click Save, and you will return to the JMS Server Manager porlet. If no errors occurred, you will be prompted that a new broker is created successfully. The JMS Network Listeners portlet will show the connectors in the new JMS broker.
Some files and folders are created after the creation of a new broker:
- The folder
var/activemq/data/brokerName
will be created to hold the data for the broker. - A file named
brokerName.xml
will be created in the folder var/activemq/conf to hold your broker configuration file.
where brokerName is the name you specified for the new broker.
Add a SSL transport connector for the broker
Openwire is the default transport for ActiveMQ. In Geronimo, you can also use SSL transport to clients to connect to the broker using SSL. Follow the steps below to enable a SSL transport.
- Enable SSL connector section in the broker's deployment plan
Code Block xml xml <transportConnector name="ssl" uri="ssl://localhost:${* + ${PortOffset}}"/>
- Copy the keystore file, such as test.ks which you intend to use for ssl verification, into
<geronimo-home>/var/activemq/data/$brokerName/
directory - Update sslContext in the plan
Code Block xml xml <sslContext> <sslContext keyStore="file:${activemq.data}/test.ks" keyStorePassword="secret" trustStore="file:${activemq.data}/test.ks" trustStorePassword="secret"/> </sslContext>
Details on how to configure connection factories, queues, topics and destinations are covered in the section Configuring JMS resources.