Activemq -- xml configuration file

Source: Internet
Author: User
Document directory
  • Configure embedded proxy
  • User submit Configuration
  • Background
Xml configuration file

N description of a port connector consisting of a port channel and a wire format: add a link page to show how the port connector is configured and used.

N Network connector description composed of network channels and discovery: add a link page to show how the network connector is configured and used.

N discovery proxy Description: add a link page to show how to configure and use the discovery proxy.

N persistence provider and positioning Description: add a link page to show how the persistence provider is configured and used.

N custom message container (for example, the last cached image ).

We use xbean to execute xml configuration.

For more information about xml configuration, see the XML reference.

Note the proxy name and Uri: Make sure you do not use any strange characters to define the proxy name. When they are converted to Uris, underlines and other characters are not allowed.

Example:

Default activemq configuration: Current Default Configuration

<Beans

Xmlns = "http://www.springframework.org/schema/beans"

Xmlns: AMQ = "http://activemq.apache.org/schema/core"

Xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"

Xsi: schemalocation = "http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-2.0.xsd

Http://activemq.apache.org/schema/corehttp://activemq.apache.org/schema/core/activemq-core.xsd>

 

<! -- Allows us to use system properties as variables in thisconfiguration file -->

<Beanclass = "org. springframework. Beans. Factory. config. propertyplaceholderconfigurer">

<Property name = "locations">

<Value> file :$ {activemq. Base}/CONF/Credentials. properties </value>

</Property>

</Bean>

 

<! --

The <broker> element is used to configure the activemq broker.

-->

<Broker xmlns = "http://activemq.apache.org/schema/core" brokername = "localhost" datadirectory = "$ {activemq. Base}/Data">

 

<! --

Forbetter performances use VM cursor and small memory limit.

Formore information, see:

Http://activemq.apache.org/message-cursors.html

Also, if your producer is "hanging", it's probably due toproducer flow control.

For more information, see:

Http://activemq.apache.org/producer-flow-control.html

-->

<Destinationpolicy>

<Policymap>

<Policyentries>

<Policyentrytopic = ">" producerflowcontrol = "true" memorylimit = "1 MB">

<Pendingsubscriberpolicy>

<Vmcursor/>

</Pendingsubscriberpolicy>

</Policyentry>

<Policyentryqueue = ">" producerflowcontrol = "true" memorylimit = "1 MB">

<! -- Use VM cursor forbetter latency

For more information, see:

Http://activemq.apache.org/message-cursors.html

<Pendingqueuepolicy>

<Vmqueuecursor/>

</Pendingqueuepolicy>

-->

</Policyentry>

</Policyentries>

</Policymap>

</Destinationpolicy>

 

<! --

The managementcontext is used to configure how activemq is exposed in

JMX. By default, activemq uses the mbean server that is started

The JVM. For more information, see:

Http://activemq.apache.org/jmx.html

-->

<Managementcontext>

<Managementcontext createconnector = "false"/>

</Managementcontext>

 

<! --

Configure message persistence for the broker. The default persistence

Mechanic is the kahadb store (identified by the kahadb tag ).

For more information, see:

Http://activemq.apache.org/persistence.html

-->

<Persistenceadapter>

<Kahadb directory = "$ {activemq. Base}/data/kahadb"/>

</Persistenceadapter>

<! --

The systemusage controls the maximum amount of space the broker will

Use before slowing down producers. For more information, see:

Http://activemq.apache.org/producer-flow-control.html

<Systemusage>

<Systemusage>

<Memoryusage>

<Memoryusagelimit = "20 mb"/>

</Memoryusage>

<Storeusage>

<Storeusagelimit = "1 GB"/>

</Storeusage>

<Tempusage>

<Tempusagelimit = "100 MB"/>

</Tempusage>

</Systemusage>

</Systemusage>

-->

<! --

The transport connectors expose activemq over a given protocol

Clients and other brokers. For more information, see:

Http://activemq.apache.org/configuring-transports.html

-->

<Transportors ors>

<Transportctor name = "openwire" uri = "TCP: /// 0.0.0.0: 61616"/>

</Transportors ors>

 

</Broker>

 

<! --

Enable Web tracking les, rest and Ajax APIs and demos

Take a look at $ {activemq_home}/CONF/Jetty. XML for more details

-->

<Import resource = "Jetty. xml"/>

</Beans>

The release of the executable file has an activemq script that allows you to run the message Proxy from the command line. This proxy acts as an independent process, before that, you only need to configure the $ activemq_home/bin directory of path.

Configure embedded proxy

You can use an XML file to configure an embedded proxy. For example, use the JNDI configuration principle to view the brokerxmlconfigfromjnditest example.

You can also use Java code to explicitly configure the embedded proxy. For more information, see the brokerxmlconfigtest example.

User submit Configuration

We have a page that allows users to submit configuration information.

N user submit Configuration

Background

Activemq has so many policy template plug-ins available for port, wire format, persistence, and many other things. We hope to keep the configuration format open so that you can configure and scale in any direction.

So we use the springxml configuration file format, which allows beans/pojos to work and configure together. However, spring XML is usually very long, so we can implement activemq extension to spring XML, you can only know the most commonly used, standard activemq configurations (such as connectors, wire formats, server ports, and persistent flags) without the need to resort to spring methods (such as bean and property flags ).

For more information about how to use and access XML files of XSD/DTD, see XML reference.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.