This commit is contained in:
Martyn Taylor 2015-02-23 13:06:12 +00:00
commit cb24f3779e
23 changed files with 220 additions and 472 deletions

View File

@ -71,30 +71,12 @@
</remoting-incoming-interceptors>
<connectors>
<connector name="connector1">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestConnectorFactory1</factory-class>
<param key="a1" value="v1"/>
<param key="a2" value="123"/>
<param key="a3" value="345"/>
<param key="a4" value="v4"/>
</connector>
<connector name="connector2">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestConnectorFactory2</factory-class>
<param key="b1" value="w1"/>
<param key="b2" value="234"/>
</connector>
<connector name="connector1">tcp://localhost:5445</connector>
<connector name="connector2">vm://0</connector>
</connectors>
<acceptors>
<acceptor name="acceptor1">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestAcceptorFactory1</factory-class>
<param key="d1" value="y1"/>
<param key="d2" value="456"/>
</acceptor>
<acceptor name="acceptor2">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestAcceptorFactory2</factory-class>
<param key="e1" value="z1"/>
<param key="e2" value="567"/>
</acceptor>
<acceptor name="acceptor1">tcp://localhost:5445</acceptor>
<acceptor name="acceptor2">vm://0</acceptor>
</acceptors>
<broadcast-groups>

View File

@ -71,30 +71,12 @@
</remoting-incoming-interceptors>
<connectors>
<connector name="connector1">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestConnectorFactory1</factory-class>
<param key="a1" value="v1"/>
<param key="a2" value="123"/>
<param key="a3" value="345"/>
<param key="a4" value="v4"/>
</connector>
<connector name="connector2">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestConnectorFactory2</factory-class>
<param key="b1" value="w1"/>
<param key="b2" value="234"/>
</connector>
<connector name="connector1">tcp://localhost:5445</connector>
<connector name="connector2">vm://0</connector>
</connectors>
<acceptors>
<acceptor name="acceptor1">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestAcceptorFactory1</factory-class>
<param key="d1" value="y1"/>
<param key="d2" value="456"/>
</acceptor>
<acceptor name="acceptor2">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestAcceptorFactory2</factory-class>
<param key="e1" value="z1"/>
<param key="e2" value="567"/>
</acceptor>
<acceptor name="acceptor1">tcp://localhost:5445</acceptor>
<acceptor name="acceptor2">vm://0</acceptor>
</acceptors>
<broadcast-groups>

View File

@ -71,30 +71,12 @@
</remoting-incoming-interceptors>
<connectors>
<connector name="connector1">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestConnectorFactory1</factory-class>
<param key="a1" value="v1"/>
<param key="a2" value="123"/>
<param key="a3" value="345"/>
<param key="a4" value="v4"/>
</connector>
<connector name="connector2">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestConnectorFactory2</factory-class>
<param key="b1" value="w1"/>
<param key="b2" value="234"/>
</connector>
<connector name="connector1">tcp://localhost:5445</connector>
<connector name="connector2">vm://0</connector>
</connectors>
<acceptors>
<acceptor name="acceptor1">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestAcceptorFactory1</factory-class>
<param key="d1" value="y1"/>
<param key="d2" value="456"/>
</acceptor>
<acceptor name="acceptor2">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestAcceptorFactory2</factory-class>
<param key="e1" value="z1"/>
<param key="e2" value="567"/>
</acceptor>
<acceptor name="acceptor1">tcp://localhost:5445</acceptor>
<acceptor name="acceptor2">vm://0</acceptor>
</acceptors>
<broadcast-groups>

View File

@ -71,30 +71,12 @@
</remoting-incoming-interceptors>
<connectors>
<connector name="connector1">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestConnectorFactory1</factory-class>
<param key="a1" value="v1"/>
<param key="a2" value="123"/>
<param key="a3" value="345"/>
<param key="a4" value="v4"/>
</connector>
<connector name="connector2">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestConnectorFactory2</factory-class>
<param key="b1" value="w1"/>
<param key="b2" value="234"/>
</connector>
<connector name="connector1">tcp://localhost:5445</connector>
<connector name="connector2">vm://0</connector>
</connectors>
<acceptors>
<acceptor name="acceptor1">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestAcceptorFactory1</factory-class>
<param key="d1" value="y1"/>
<param key="d2" value="456"/>
</acceptor>
<acceptor name="acceptor2">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestAcceptorFactory2</factory-class>
<param key="e1" value="z1"/>
<param key="e2" value="567"/>
</acceptor>
<acceptor name="acceptor1">tcp://localhost:5445</acceptor>
<acceptor>vm://0</acceptor>
</acceptors>
<broadcast-groups>

View File

@ -71,30 +71,12 @@
</remoting-incoming-interceptors>
<connectors>
<connector name="connector1">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestConnectorFactory1</factory-class>
<param key="a1" value="v1"/>
<param key="a2" value="123"/>
<param key="a3" value="345"/>
<param key="a4" value="v4"/>
</connector>
<connector name="connector2">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestConnectorFactory2</factory-class>
<param key="b1" value="w1"/>
<param key="b2" value="234"/>
</connector>
<connector name="connector1">tcp://localhost:5445</connector>
<connector name="connector2">vm://0</connector>
</connectors>
<acceptors>
<acceptor name="acceptor1">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestAcceptorFactory1</factory-class>
<param key="d1" value="y1"/>
<param key="d2" value="456"/>
</acceptor>
<acceptor name="acceptor2">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestAcceptorFactory2</factory-class>
<param key="e1" value="z1"/>
<param key="e2" value="567"/>
</acceptor>
<acceptor name="acceptor1">tcp://localhost:5445</acceptor>
<acceptor name="acceptor2">vm://0</acceptor>
</acceptors>
<broadcast-groups>

View File

@ -71,30 +71,12 @@
</remoting-incoming-interceptors>
<connectors>
<connector name="connector1">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestConnectorFactory1</factory-class>
<param key="a1" value="v1"/>
<param key="a2" value="123"/>
<param key="a3" value="345"/>
<param key="a4" value="v4"/>
</connector>
<connector name="connector2">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestConnectorFactory2</factory-class>
<param key="b1" value="w1"/>
<param key="b2" value="234"/>
</connector>
<connector name="connector1">tcp://localhost:5445</connector>
<connector name="connector2">vm://0</connector>
</connectors>
<acceptors>
<acceptor name="acceptor1">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestAcceptorFactory1</factory-class>
<param key="d1" value="y1"/>
<param key="d2" value="456"/>
</acceptor>
<acceptor name="acceptor2">
<factory-class>org.apache.activemq.tests.unit.core.config.impl.TestAcceptorFactory2</factory-class>
<param key="e1" value="z1"/>
<param key="e2" value="567"/>
</acceptor>
<acceptor name="acceptor1">tcp://localhost:5445</acceptor>
<acceptor name="acceptor2">vm://0</acceptor>
</acceptors>
<broadcast-groups>

View File

@ -18,93 +18,86 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd">
<!-- We need to make it clustered otherwise the bridge won't deploy -->
<core xmlns="urn:activemq:core">
<bindings-directory>${build.directory}/server0/data/messaging/bindings</bindings-directory>
<!-- We need to make it clustered otherwise the bridge won't deploy -->
<journal-directory>${build.directory}/server0/data/messaging/journal</journal-directory>
<large-messages-directory>${build.directory}/server0/data/messaging/largemessages</large-messages-directory>
<bindings-directory>${build.directory}/server0/data/messaging/bindings</bindings-directory>
<paging-directory>${build.directory}/server0/data/messaging/paging</paging-directory>
<journal-directory>${build.directory}/server0/data/messaging/journal</journal-directory>
<!-- Connectors -->
<large-messages-directory>${build.directory}/server0/data/messaging/largemessages</large-messages-directory>
<connectors>
<connector name="netty-connector">
<factory-class>org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
<param key="port" value="5445"/>
</connector>
<!-- This connector corresponds to the New York server -->
<connector name="newyork-connector">
<factory-class>org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
<param key="port" value="5446"/>
</connector>
</connectors>
<paging-directory>${build.directory}/server0/data/messaging/paging</paging-directory>
<!-- Acceptors -->
<!-- Connectors -->
<acceptors>
<acceptor name="netty-acceptor">
<factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
<param key="port" value="5445"/>
</acceptor>
</acceptors>
<!-- Divert configuration -->
<!-- We need to create a core queue for the JMS queue explicitly because the bridge will be deployed
before the JMS queue is deployed, so the first time, it otherwise won't find the queue -->
<queues>
<queue name="jms.queue.priceForwarding">
<address>jms.queue.priceForwarding</address>
</queue>
</queues>
<connectors>
<connector name="netty-connector">tcp://localhost:5445</connector>
<diverts>
<divert name="order-divert">
<address>jms.queue.orders</address>
<forwarding-address>jms.topic.spyTopic</forwarding-address>
<exclusive>false</exclusive>
</divert>
<divert name="prices-divert">
<address>jms.topic.priceUpdates</address>
<forwarding-address>jms.queue.priceForwarding</forwarding-address>
<filter string="office='New York'"/>
<transformer-class-name>org.apache.activemq.jms.example.AddForwardingTimeTransformer</transformer-class-name>
<exclusive>true</exclusive>
</divert>
</diverts>
<!-- Bridge configuration -->
<bridges>
<bridge name="price-forward-bridge">
<queue-name>jms.queue.priceForwarding</queue-name>
<forwarding-address>jms.topic.newYorkPriceUpdates</forwarding-address>
<reconnect-attempts>-1</reconnect-attempts>
<static-connectors>
<connector-ref>newyork-connector</connector-ref>
</static-connectors>
</bridge>
</bridges>
<!-- This connector corresponds to the New York server -->
<!-- Other config -->
<connector name="newyork-connector">tcp://localhost:5446</connector>
</connectors>
<security-settings>
<!--security for example -->
<security-setting match="jms.#">
<permission type="createDurableQueue" roles="guest"/>
<permission type="deleteDurableQueue" roles="guest"/>
<permission type="createNonDurableQueue" roles="guest"/>
<permission type="deleteNonDurableQueue" roles="guest"/>
<permission type="consume" roles="guest"/>
<permission type="send" roles="guest"/>
</security-setting>
</security-settings>
<!-- Acceptors -->
<acceptors>
<acceptor name="netty-acceptor">tcp://localhost:5445</acceptor>
</acceptors>
<!-- Divert configuration -->
<!-- We need to create a core queue for the JMS queue explicitly because the bridge will be deployed
before the JMS queue is deployed, so the first time, it otherwise won't find the queue -->
<queues>
<queue name="jms.queue.priceForwarding">
<address>jms.queue.priceForwarding</address>
</queue>
</queues>
<diverts>
<divert name="order-divert">
<address>jms.queue.orders</address>
<forwarding-address>jms.topic.spyTopic</forwarding-address>
<exclusive>false</exclusive>
</divert>
<divert name="prices-divert">
<address>jms.topic.priceUpdates</address>
<forwarding-address>jms.queue.priceForwarding</forwarding-address>
<filter string="office='New York'"/>
<transformer-class-name>org.apache.activemq.jms.example.AddForwardingTimeTransformer</transformer-class-name>
<exclusive>true</exclusive>
</divert>
</diverts>
<!-- Bridge configuration -->
<bridges>
<bridge name="price-forward-bridge">
<queue-name>jms.queue.priceForwarding</queue-name>
<forwarding-address>jms.topic.newYorkPriceUpdates</forwarding-address>
<reconnect-attempts>-1</reconnect-attempts>
<static-connectors>
<connector-ref>newyork-connector</connector-ref>
</static-connectors>
</bridge>
</bridges>
<!-- Other config -->
<security-settings>
<!--security for example -->
<security-setting match="jms.#">
<permission type="createDurableQueue" roles="guest"/>
<permission type="deleteDurableQueue" roles="guest"/>
<permission type="createNonDurableQueue" roles="guest"/>
<permission type="deleteNonDurableQueue" roles="guest"/>
<permission type="consume" roles="guest"/>
<permission type="send" roles="guest"/>
</security-setting>
</security-settings>
</core>
</configuration>

View File

@ -14,12 +14,7 @@ One of the most important concepts in ActiveMQ transports is the
defined in xml in the configuration file `activemq-configuration.xml`.
<acceptors>
<acceptor name="netty">
<factory-class>
org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory
</factory-class>
<param key="port" value="5446"/>
</acceptor>
<acceptor name="netty">tcp://localhost:5446</acceptor>
</acceptors>
Acceptors are always defined inside an `acceptors` element. There can be
@ -33,26 +28,20 @@ In the above example we're defining an acceptor that uses
[Netty](http://netty.io/) to listen for connections at port
`5446`.
The `acceptor` element contains a sub-element `factory-class`, this
element defines the factory used to create acceptor instances. In this
case we're using Netty to listen for connections so we use the Netty
implementation of an `AcceptorFactory` to do this. Basically, the
`factory-class` element determines which pluggable transport we're going
to use to do the actual listening.
The `acceptor` element contains a `URI` that defines the kind of Acceptor
to create along with its configuration. The `schema` part of the `URI`
defines the Acceptor type which can either be `tcp` or `vm` which is
`Netty` or an In VM Acceptor respectively. For `Netty` teh host and the
port of the `URI` define what host and port the Acceptor will bind to. For
In VM the `Authority` part of the `URI` defines a unique server id.
The `acceptor` element can also be configured with zero or more `param`
sub-elements. Each `param` element defines a key-value pair. These
key-value pairs are used to configure the specific transport, the set of
The `acceptor` can also be configured with a set of key, value pairs
used to configure the specific transport, the set of
valid key-value pairs depends on the specific transport be used and are
passed straight through to the underlying transport.
passed straight through to the underlying transport. These are set on the
`URI` as part of the query, like so:
Examples of key-value pairs for a particular transport would be, say, to
configure the IP address to bind to, or the port to listen at.
Note that unlike versions before 2.4 an Acceptor can now support
multiple protocols. By default this will be all available protocols but
can be limited by either the now deprecated `protocol` param or by
setting a comma seperated list to the newly added `protocols` parameter.
<acceptor name="netty">tcp://localhost:5446?sslEnabled=true;key-store-path=/path</acceptor>
## Understanding Connectors
@ -64,12 +53,7 @@ Let's look at a connector defined in our `activemq-configuration.xml`
file:
<connectors>
<connector name="netty">
<factory-class>
org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory
</factory-class>
<param key="port" value="5446"/>
</connector>
<connector name="netty">tcp://localhost:5446</connector>
</connectors>
Connectors can be defined inside a `connectors` element. There can be
@ -98,7 +82,7 @@ couple of reasons for this:
simple example:
java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
java.naming.provider.url=tcp://myhost:5445
connectionFactory.MyConnectionFactory=tcp://myhost:5445
## Configuring the transport directly from the client side.
@ -171,7 +155,7 @@ We believe this caters for the vast majority of transport requirements.
## Single Port Support
As of version 2.4 ActiveMQ now supports using a single port for all
ActiveMQ supports using a single port for all
protocols, ActiveMQ will automatically detect which protocol is being
used CORE, AMQP, STOMP or OPENWIRE and use the appropriate ActiveMQ
handler. It will also detect whether protocols such as HTTP or Web
@ -180,8 +164,8 @@ Sockets are being used and also use the appropriate decoders
It is possible to limit which protocols are supported by using the
`protocols` parameter on the Acceptor like so:
<param key="protocols" value="CORE,AMQP"/>
<connector name="netty">tcp://localhost:5446?protocols=CORE,AMQP</connector>
> **Note**
>
@ -211,6 +195,11 @@ parameters can be used either with acceptors or connectors, some only
work with acceptors. The following parameters can be used to configure
Netty for simple TCP:
> **Note**
>
> The `host` and `port` parameters are only used in the core API, in
> XML configuration these are set in the URI host and port.
- `use-nio`. If this is `true` then Java non blocking NIO will be
used. If set to `false` then old blocking Java IO will be used.
@ -245,13 +234,13 @@ Netty for simple TCP:
connector) or to listen on (when configuring an acceptor). The
default value for this property is `5445`.
- `tcp-no-delay`. If this is `true` then [Nagle's
- `tcpNoDelay`. If this is `true` then [Nagle's
algorithm](http://en.wikipedia.org/wiki/Nagle%27s_algorithm) will be
disabled. This is a [Java (client) socket
option](http://docs.oracle.com/javase/7/docs/technotes/guides/net/socketOpt.html).
The default value for this property is `true`.
- `tcp-send-buffer-size`. This parameter determines the size of the
- `tcpSendBufferSize`. This parameter determines the size of the
TCP send buffer in bytes. The default value for this property is
`32768` bytes (32KiB).
@ -270,18 +259,18 @@ Netty for simple TCP:
For fast networks you may want to increase the buffer sizes from the
defaults.
- `tcp-receive-buffer-size`. This parameter determines the size of the
- `tcpReceiveBufferSize`. This parameter determines the size of the
TCP receive buffer in bytes. The default value for this property is
`32768` bytes (32KiB).
- `batch-delay`. Before writing packets to the transport, ActiveMQ can
- `batchDelay`. Before writing packets to the transport, ActiveMQ can
be configured to batch up writes for a maximum of `batch-delay`
milliseconds. This can increase overall throughput for very small
messages. It does so at the expense of an increase in average
latency for message transfer. The default value for this property is
`0` ms.
- `direct-deliver`. When a message arrives on the server and is
- `directDeliver`. When a message arrives on the server and is
delivered to waiting consumers, by default, the delivery is done on
the same thread as that on which the message arrived. This gives
good latency in environments with relatively small messages and a
@ -293,7 +282,7 @@ Netty for simple TCP:
throughput set `direct-deliver` to `false
`.
- `nio-remoting-threads`. When configured to use NIO, ActiveMQ will,
- `nioRemotingThreads`. When configured to use NIO, ActiveMQ will,
by default, use a number of threads equal to three times the number
of cores (or hyper-threads) as reported by
`Runtime.getRuntime().availableProcessors()` for processing incoming
@ -302,14 +291,14 @@ Netty for simple TCP:
parameter is `-1` which means use the value from
`Runtime.getRuntime().availableProcessors()` \* 3.
- `local-address`. When configured a Netty Connector it is possible to
- `localAddress`. When configured a Netty Connector it is possible to
specify which local address the client will use when connecting to
the remote address. This is typically used in the Application Server
or when running Embedded to control which address is used for
outbound connections. If the local-address is not set then the
connector will use any local address available
- `local-port`. When configured a Netty Connector it is possible to
- `localPort`. When configured a Netty Connector it is possible to
specify which local port the client will use when connecting to the
remote address. This is typically used in the Application Server or
when running Embedded to control which port is used for outbound
@ -328,11 +317,11 @@ Please see the examples for a full working example of using Netty SSL.
Netty SSL uses all the same properties as Netty TCP but adds the
following additional properties:
- `ssl-enabled`
- `sslEnabled`
Must be `true` to enable SSL. Default is `false`.
- `key-store-path`
- `keyStorePath`
When used on an `acceptor` this is the path to the SSL key store on
the server which holds the server's certificates (whether
@ -350,7 +339,7 @@ following additional properties:
ActiveMQ-specific system property is useful if another component on
client is already making use of the standard, Java system property.
- `key-store-password`
- `keyStorePassword`
When used on an `acceptor` this is the password for the server-side
keystore.
@ -367,7 +356,7 @@ following additional properties:
another component on client is already making use of the standard,
Java system property.
- `trust-store-path`
- `trustStorePath`
When used on an `acceptor` this is the path to the server-side SSL
key store that holds the keys of all the clients that the server
@ -385,7 +374,7 @@ following additional properties:
ActiveMQ-specific system property is useful if another component on
client is already making use of the standard, Java system property.
- `trust-store-password`
- `trustStorePassword`
When used on an `acceptor` this is the password for the server-side
trust store. This is only relevant for an `acceptor` if you are
@ -402,19 +391,19 @@ following additional properties:
another component on client is already making use of the standard,
Java system property.
- `enabled-cipher-suites`
- `enabledCipherSuites`
Whether used on an `acceptor` or `connector` this is a comma
separated list of cipher suites used for SSL communication. The
default value is `null` which means the JVM's default will be used.
- `enabled-protocols`
- `enabledProtocols`
Whether used on an `acceptor` or `connector` this is a comma
separated list of protocols used for SSL communication. The default
value is `null` which means the JVM's default will be used.
- `need-client-auth`
- `needClientAuth`
This property is only for an `acceptor`. It tells a client
connecting to this acceptor that 2-way SSL is required. Valid values
@ -430,22 +419,22 @@ Please see the examples for a full working example of using Netty HTTP.
Netty HTTP uses the same properties as Netty TCP but adds the following
additional properties:
- `http-enabled`. This is now no longer needed as of version 2.4. With
- `httpEnabled`. This is now no longer needed as of version 2.4. With
single port support ActiveMQ will now automatically detect if http
is being used and configure itself.
- `http-client-idle-time`. How long a client can be idle before
- `httpClientIdleTime`. How long a client can be idle before
sending an empty http request to keep the connection alive
- `http-client-idle-scan-period`. How often, in milliseconds, to scan
- `httpClientIdleScanPeriod`. How often, in milliseconds, to scan
for idle clients
- `http-response-time`. How long the server can wait before sending an
- `httpResponseTime`. How long the server can wait before sending an
empty http response to keep the connection alive
- `http-server-scan-period`. How often, in milliseconds, to scan for
- `httpServerScanPeriod`. How often, in milliseconds, to scan for
clients needing responses
- `http-requires-session-id`. If true the client will wait after the
- `httpRequiresSessionId`. If true the client will wait after the
first call to receive a session id. Used the http connector is
connecting to servlet acceptor (not recommended)

View File

@ -15,11 +15,7 @@ ActiveMQ provides native support for Stomp. To be able to send and
receive Stomp messages, you must configure a `NettyAcceptor` with a
`protocols` parameter set to have `stomp`:
<acceptor name="stomp-acceptor">
<factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
<param key="protocols" value="STOMP"/>
<param key="port" value="61613"/>
</acceptor>
<acceptor name="stomp-acceptor">tcp://localhost:61613?protocols=STOMP</acceptor>
With this configuration, ActiveMQ will accept Stomp connections on the
port `61613` (which is the default port of the Stomp brokers).
@ -74,18 +70,13 @@ a connection-ttl value of 1 minute (see chapter on
[connection-ttl](#connection-ttl) for more information. This value can
be overridden using connection-ttl-override.
If you need a specific connection-ttl for your stomp connections without
affecting the connection-ttl-override setting, you can configure your
stomp acceptor with the "connection-ttl" property, which is used to set
If you need a specific connectionTtl for your stomp connections without
affecting the connectionTtlOverride setting, you can configure your
stomp acceptor with the "connectionTtl" property, which is used to set
the ttl for connections that are created from that acceptor. For
example:
<acceptor name="stomp-acceptor">
<factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
<param key="protocols" value="STOMP"/>
<param key="port" value="61613"/>
<param key="connection-ttl" value="20000"/>
</acceptor>
<acceptor name="stomp-acceptor">tcp://localhost:61613?protocols=STOMP;connectionTtl=20000</acceptor>
The above configuration will make sure that any stomp connection that is
created from that acceptor will have its connection-ttl set to 20
@ -158,14 +149,9 @@ messages have no properties like JMSMessageID by default. However this
may bring some inconvenience to clients who wants an ID for their
purpose. ActiveMQ Stomp provides a parameter to enable message ID on
each incoming Stomp message. If you want each Stomp message to have a
unique ID, just set the `stomp-enable-message-id` to true. For example:
unique ID, just set the `stompEnableMessageId` to true. For example:
<acceptor name="stomp-acceptor">
<factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
<param key="protocols" value="STOMP"/>
<param key="port" value="61613"/>
<param key="stomp-enable-message-id" value="true"/>
</acceptor>
<acceptor name="stomp-acceptor">tcp://localhost:61613?protocols=STOMP;stompEnableMessageId=true</acceptor>
When the server starts with the above setting, each stomp message sent
through this acceptor will have an extra property added. The property
@ -183,28 +169,23 @@ default is `false`.
Stomp clients may send very large bodys of frames which can exceed the
size of ActiveMQ server's internal buffer, causing unexpected errors. To
prevent this situation from happening, ActiveMQ provides a stomp
configuration attribute `stomp-min-large-message-size`. This attribute
configuration attribute `stompMinLargeMessageSize`. This attribute
can be configured inside a stomp acceptor, as a parameter. For example:
<acceptor name="stomp-acceptor">
<factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
<param key="protocols" value="STOMP"/>
<param key="port" value="61613"/>
<param key="stomp-min-large-message-size" value="10240"/>
</acceptor>
<acceptor name="stomp-acceptor">tcp://localhost:61613?protocols=STOMP;stompMinLargeMessageSize=10240</acceptor>
The type of this attribute is integer. When this attributed is
configured, ActiveMQ server will check the size of the body of each
Stomp frame arrived from connections established with this acceptor. If
the size of the body is equal or greater than the value of
`stomp-min-large-message`, the message will be persisted as a large
`stompMinLargeMessageSize`, the message will be persisted as a large
message. When a large message is delievered to a stomp consumer, the
HorentQ server will automatically handle the conversion from a large
message to a normal message, before sending it to the client.
If a large message is compressed, the server will uncompressed it before
sending it to stomp clients. The default value of
`stomp-min-large-message-size` is the same as the default value of
`stompMinLargeMessageSize` is the same as the default value of
[min-large-message-size](#large-messages.core.config).
### Stomp Over Web Sockets
@ -216,11 +197,7 @@ support Web Sockets can send and receive Stomp messages from ActiveMQ.
To enable Stomp over Web Sockets, you must configure a `NettyAcceptor`
with a `protocol` parameter set to `stomp_ws`:
<acceptor name="stomp-ws-acceptor">
<factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
<param key="protocols" value="STOMP_WS"/>
<param key="port" value="61614"/>
</acceptor>
<acceptor name="stomp-ws-acceptor">tcp://localhost:61614?protocols=STOMP_WS</acceptor>
With this configuration, ActiveMQ will accept Stomp connections over Web
Sockets on the port `61614` with the URL path `/stomp`. Web browser can
@ -269,11 +246,7 @@ ActiveMQ supports the [AMQP
specification. To enable AMQP you must configure a Netty Acceptor to
receive AMQP clients, like so:
<acceptor name="stomp-acceptor">
<factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
<param key="protocols" value="AMQP"/>
<param key="port" value="5672"/>
</acceptor>
<acceptor name="stomp-acceptor">tcp://localhost:5672?protocols=AMQP</acceptor>
ActiveMQ will then accept AMQP 1.0 clients on port 5672 which is the
@ -331,11 +304,7 @@ ActiveMQ now supports the
ActiveMQ JMS client can talk directly to a ActiveMQ server. To enable
OpenWire support you must configure a Netty Acceptor, like so:
<acceptor name="openwire-acceptor">
<factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
<param key="protocols" value="OPENWIRE"/>
<param key="port" value="61616"/>
</acceptor>
<acceptor name="openwire-acceptor">tcp://localhost:61616?protocols=OPENWIRE</acceptor>
The ActiveMQ server will then listens on port 61616 for incoming

View File

@ -93,44 +93,11 @@ files.
configuration file. All the parameters in this file are described in
?. Please see ? for more information on this file.
- `activemq-queues.xml`. This file contains predefined queues, queue
settings and security settings. The file is optional - all this
configuration can also live in `activemq-configuration.xml`. In
fact, the default configuration sets do not have a
`activemq-queues.xml` file. The purpose of allowing queues to be
configured in these files is to allow you to manage your queue
configuration over many files instead of being forced to maintain it
in a single file. There can be many `activemq-queues.xml` files on
the classpath. All will be loaded if found.
- `activemq-users.xml` ActiveMQ ships with a basic security manager
implementation which obtains user credentials from the
`activemq-users.xml` file. This file contains user, password and
role information. For more information on security, please see ?.
- `activemq-jms.xml` The distro configuration by default includes a
server side JMS service which mainly deploys JMS Queues, Topics and
ConnectionFactorys from this file into JNDI. If you're not using
JMS, or you don't need to deploy JMS objects on the server side,
then you don't need this file. For more information on using JMS,
please see the section on [Logging](logging.md).
> **Note**
>
> The property `file-deployment-enabled` in the
> `activemq-configuration.xml` configuration when set to false means
> that the other configuration files are not loaded. This is true by
> default.
It is also possible to use system property substitution in all the
configuration files. by replacing a value with the name of a system
property. Here is an example of this with a connector configuration:
<connector name="netty">
<factory-class>org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
<param key="host" value="${activemq.remoting.netty.host:localhost}"/>
<param key="port" value="${activemq.remoting.netty.port:5445}"/>
</connector>
<connector name="netty">tcp://${activemq.remoting.netty.host:localhost}:${activemq.remoting.netty.port:5445}</connector>
Here you can see we have replaced 2 values with system properties
`activemq.remoting.netty.host` and `activemq.remoting.netty.port`. These

View File

@ -31,13 +31,7 @@ under the License.
<paging-directory>${build.directory}/server0/data/messaging/paging</paging-directory>
<!-- Acceptors -->
<acceptors>
<acceptor name="netty-acceptor">
<factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
<param key="tcp-no-delay" value="false"/>
<param key="tcp-send-buffer-size" value="1048576"/>
<param key="tcp-receive-buffer-size" value="1048576"/>
<param key="host" value="172.16.8.10"/>
</acceptor>
<acceptor name="netty-acceptor">tcp://172.16.8.10:5445?tcpNoDelay=false;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576</acceptor>
</acceptors>
<security-enabled>false</security-enabled>

View File

@ -77,4 +77,4 @@
</security-settings>
</core>
</configuration>
</configuration>

View File

@ -37,18 +37,11 @@ under the License.
<pre class="prettyprint">
<code>
&lt;connector name=&quot;netty-connector&quot;&gt;
&lt;factory-class&gt;org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory&lt;/factory-class&gt;
&lt;param key=&quot;activemq.remoting.netty.http-enabled&quot; value=&quot;true&quot; type=&quot;Boolean&quot;/&gt;
&lt;param key=&quot;activemq.remoting.netty.port&quot; value=&quot;8080&quot; type=&quot;Integer&quot;/&gt;
&lt;/connector&gt;
&lt;connector name=&quot;netty-connector&quot;&gt;tcp://localhost:8080?httpEnabled=true&lt;/connector&gt;
&lt;!-- Acceptors --&gt;
&lt;acceptor name=&quot;netty-acceptor&quot;&gt;
&lt;factory-class&gt;org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory&lt;/factory-class&gt;
&lt;param key=&quot;activemq.remoting.netty.port&quot; value=&quot;8080&quot; type=&quot;Integer&quot;/&gt;
&lt;/acceptor&gt;
&lt;acceptor name=&quot;netty-acceptor&quot;&gt;tcp://localhost:8080 &lt;/acceptor&gt;
</code>
</pre>

View File

@ -51,10 +51,7 @@ under the License.
<p>This is totally optional and you don't need to follow this convention. You can use any port you chose including ActiveMQ's 5445 default port</p>
<pre class="prettyprint">
<code>
&lt;acceptor name="proton-acceptor"&gt;
&lt;factory-class&gt;org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory&lt;/factory-class&gt;
&lt;param key="port" value="5672"/&gt;
&lt;/acceptor&gt;
&lt;acceptor name="proton-acceptor"&gt;tcp://localhost:5672&lt;/acceptor&gt;
</code>
</pre>
<h2>Example step-by-step</h2>

View File

@ -36,10 +36,7 @@ under the License.
<p>This is totally optional and you don't need to follow this convention. You can use any port you chose including ActiveMQ's 5445 default port</p>
<pre class="prettyprint">
<code>
&lt;acceptor name="proton-acceptor"&gt;
&lt;factory-class&gt;org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory&lt;/factory-class&gt;
&lt;param key="port" value="5672"/&gt;
&lt;/acceptor&gt;
&lt;acceptor name="proton-acceptor"&gt;tcp://localhost:5672&lt;/acceptor&gt;
</code>
</pre>
<h2>Example step-by-step</h2>

View File

@ -38,11 +38,7 @@ under the License.
<p>To configure ActiveMQ to accept AMQP client connections you need to add an Acceptor like so:</p>
<pre class="prettyprint">
<code>
&lt;acceptor name="proton-acceptor"&gt;
&lt;factory-class&gt;org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory&lt;/factory-class&gt;
&lt;param key="protocol" value="AMQP"/&gt;
&lt;param key="port" value="5672"/&gt;
&lt;/acceptor&gt;
&lt;acceptor name="proton-acceptor"&gt;tcp://localhost:5672?protocols=AMQP&lt;/acceptor&gt;
</code>
</pre>
<h2>Example step-by-step</h2>

View File

@ -29,9 +29,7 @@ under the License.
<!-- Connectors -->
<connectors>
<connector name="netty-connector">
<factory-class>org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
</connector>
<connector name="netty-connector">tcp://localhost:5445</connector>
</connectors>
</core>

View File

@ -29,9 +29,7 @@ under the License.
<!-- Connectors -->
<connectors>
<connector name="netty-connector">
<factory-class>org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
</connector>
<connector name="netty-connector">tcp://localhost:5445</connector>
</connectors>
</core>

View File

@ -29,9 +29,7 @@ under the License.
<!-- Connectors -->
<connectors>
<connector name="netty-connector">
<factory-class>org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
</connector>
<connector name="netty-connector">tcp://localhost:5445</connector>
</connectors>
</core>

View File

@ -37,25 +37,11 @@ under the License.
<code>
&lt;!-- Connector --&gt;
&lt;connector name=&quot;netty-ssl-connector&quot;&gt;
&lt;factory-class&gt;org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory&lt;/factory-class&gt;
&lt;param key=&quot;activemq.remoting.netty.host&quot; value=&quot;localhost&quot; type=&quot;String&quot;/&gt;
&lt;param key=&quot;activemq.remoting.netty.port&quot; value=&quot;5500&quot; type=&quot;Integer&quot;/&gt;
&lt;param key=&quot;activemq.remoting.netty.ssl-enabled&quot; value=&quot;true&quot; type=&quot;Boolean&quot;/&gt;
&lt;param key=&quot;activemq.remoting.netty.trust-store-path&quot; value=&quot;server0/activemq.example.truststore&quot; type=&quot;String&quot;/&gt;
&lt;param key=&quot;activemq.remoting.netty.trust-store-password&quot; value=&quot;activemqexample&quot; type=&quot;String&quot;/&gt;
&lt;/connector&gt;
&lt;connector name=&quot;netty-ssl-connector&quot;&gt;tcp://localhost:5500?sslEnabled=true;keyStorePath=activemq/server0/activemq.example.keystore;keyStorePassword=activemqexample&lt;/connector&gt;
&lt;!-- Acceptor --&gt;
&lt;acceptor name=&quot;netty-ssl-acceptor&quot;&gt;
&lt;factory-class&gt;org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory&lt;/factory-class&gt;
&lt;param key=&quot;activemq.remoting.netty.host&quot; value=&quot;localhost&quot; type=&quot;String&quot;/&gt;
&lt;param key=&quot;activemq.remoting.netty.port&quot; value=&quot;5500&quot; type=&quot;Integer&quot;/&gt;
&lt;param key=&quot;activemq.remoting.netty.ssl-enabled&quot; value=&quot;true&quot; type=&quot;Boolean&quot;/&gt;
&lt;param key=&quot;activemq.remoting.netty.key-store-path&quot; value=&quot;activemq.example.keystore&quot; type=&quot;String&quot;/&gt;
&lt;param key=&quot;activemq.remoting.netty.key-store-password&quot; value=&quot;activemqexample&quot; type=&quot;String&quot;/&gt;
&lt;/acceptor&gt;
&lt;acceptor name=&quot;netty-ssl-acceptor&quot;&gt;tcp://localhost:5500?sslEnabled=true;keyStorePath=activemq/server0/activemq.example.keystore;keyStorePassword=activemqexample&lt;/acceptor&gt;
</code>
</pre>

View File

@ -32,10 +32,7 @@ under the License.
<p>The example will start a ActiveMQ server configured with Stomp over Web Sockets and JMS. Web browsers clients and
Java application will exchange message using a JMS Topic.</p></para>
<pre class="prettyprint">
&lt;acceptor name="stomp-websocket">
&lt;factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory&lt;/factory-class>
&lt;param key="port" value="61614"/>
&lt;/acceptor></pre>
&lt;acceptor name="stomp-websocket">tcp://localhost:61614&lt;/acceptor></pre>
<h2>Example step-by-step</h2>

View File

@ -16,42 +16,35 @@
-->
<configuration xmlns="urn:activemq"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd">
xsi:schemaLocation="urn:activemq /schema/activemq-server.xsd">
<backup>true</backup>
<journal-directory>/tmp/activemq-unit-test/start-stop-data-backup</journal-directory>
<!-- Connectors -->
<core xmlns="urn:activemq:core">
<connectors>
<connector name="netty-connector">
<factory-class>org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
<param key="port" value="5446"/>
</connector>
</connectors>
<journal-directory>/tmp/activemq-unit-test/start-stop-data-backup</journal-directory>
<!-- Acceptors -->
<acceptors>
<acceptor name="netty-acceptor">
<factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
<param key="port" value="5446"/>
</acceptor>
</acceptors>
<!-- Connectors -->
<security-enabled>false</security-enabled>
<queues>
<queue name="myQueue">
<address>myAddress</address>
</queue>
<queue name="jms.queue.myJMSQueue">
<address>jms.queue.myJMSAddress</address>
</queue>
</queues>
<connectors>
<connector name="netty-connector">tcp://localhost:5446</connector>
</connectors>
<!-- Acceptors -->
<acceptors>
<acceptor name="netty-acceptor">tcp://localhost:5446</acceptor>
</acceptors>
<security-enabled>false</security-enabled>
<queues>
<queue name="myQueue">
<address>myAddress</address>
</queue>
<queue name="jms.queue.myJMSQueue">
<address>jms.queue.myJMSAddress</address>
</queue>
</queues>
</core>
</configuration>

View File

@ -16,46 +16,37 @@
-->
<configuration xmlns="urn:activemq"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:activemq ../../../src/schema/activemq-configuration.xsd">
<backup-connector-ref connector-name="backup-connector"/>
<journal-directory>/tmp/activemq-unit-test/start-stop-data-live</journal-directory>
<!-- Connectors -->
xsi:schemaLocation="urn:activemq /schema/activemq-server.xsd">
<connectors>
<connector name="netty-connector">
<factory-class>org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
<param key="port" value="5445"/>
</connector>
<core xmlns="urn:activemq:core">
<journal-directory>/tmp/activemq-unit-test/start-stop-data-live</journal-directory>
<connector name="backup-connector">
<factory-class>org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
<param key="port" value="5446"/>
</connector>
</connectors>
<!-- Acceptors -->
<acceptors>
<acceptor name="netty-acceptor">
<factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
<param key="port" value="5445"/>
</acceptor>
</acceptors>
<security-enabled>false</security-enabled>
<queues>
<queue name="myQueue">
<address>myAddress</address>
</queue>
<queue name="jms.queue.myJMSQueue">
<address>jms.queue.myJMSAddress</address>
</queue>
</queues>
<!-- Connectors -->
<connectors>
<connector name="netty-connector">tcp://localhost:5445</connector>
<connector name="backup-connector">tcp://localhost:5446</connector>
</connectors>
<!-- Acceptors -->
<acceptors>
<acceptor name="netty-acceptor">172.16.8.10</acceptor>
</acceptors>
<security-enabled>false</security-enabled>
<queues>
<queue name="myQueue">
<address>myAddress</address>
</queue>
<queue name="jms.queue.myJMSQueue">
<address>jms.queue.myJMSAddress</address>
</queue>
</queues>
</core>
</configuration>