FROM:javaeye.com
Brief Introduction
The previous article http://www.javaeye.com/topic/15317 introduced the installation of ActiveMQ5.0, which will be described in the configuration. ACTIVEMQ contains a lot of features (see http://activemq.apache.org/features.html),
Different needs, different environments, need different features, of course, need different configuration. Here I have only written the most basic configuration, is thrown brick, I hope to draw more about ACTIVEMQ Advanced configuration.
Assuming that the ActiveMQ5.0 is installed correctly and its IP address is 192.168.1.148, it can be changed to its own IP when used. The following features configuration implementation is as follows: The client can connect Activemq via tcp://192.168.1.148. Messages are persisted and the server does not lose messages when it is restarted. can monitor ACTIVEMQ server configuration via Http://192.168.1.148:8161/admin
ACTIVEMQ defaults to XML format configuration, starting with the 4.0 version of an Mbean implementation of the XML configuration, the configuration file in the ${activemq.home}/conf directory, the file name is Activemq.xml. See the latest default configuration
Http://svn.apache.org/repos/asf/activemq/trunk/assembly/src/release/conf/activemq.xml. The following is an explanation of the configuration used in this article and an important part.
XML code <beans xmlns= "Http://www.springframework.org/schema/beans" xmlns:amq= "http://activemq.org/config/1.0" xmlns:xsi= "http:// Www.w3.org/2001/XMLSchema-instance " xsi:schemalocation=" Http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http:// activemq.org/config/1.0 http://activemq.apache.org/schema/activemq-core.xsd http:/ /activemq.apache.org/camel/schema/spring> <!-- persistent= ' True ' means to persist the storage message, and the child element Persistenceadapter in combination with --> <!-- DataDirectory The default storage-persisted data directory --> <!-- brokerName set Broker's name, Attention must be unique on the network--> <!-- more references http://activemq.apache.org/ xbean-xml-reference-50.html#xbeanxmlreference5.0-brokerelement --> <broker xmlns= "http://activemq.org/config/1.0" brokername= " 192.168.1.148 " persistent =" true " datadirectory=" ${activemq.base}/data " useshutdownhook=" False "> <!-- Destination specific policies using destination names or wildcards --> <!-- wildcards significance see http://activemq.apache.org/wildcards.html --> <destinationPolicy> <policyMap> <policyEntries> <!-- Wildcards is used here, which means that all the topic --> that start with Eucita <policyentry topic= "EUCITA.>" Producerflowcontrol= "false" memorylimit= "10MB" > < !-- Distribution Strategy --> <dispatchPolicy> <!-- distribute --> in order < strictorderdispatchpolicy/> </dispatchPolicy> <!-- Recovery Strategy--> < subscriptionrecoverypolicy> <!-- Restore only the last message --> <lastimagesubscriptionrecoverypolicy/> </subscriptionRecoveryPolicy> </policyEntry> </policyEntries> </policyMap> </ Destinationpolicy>