ActiveMQ
From Null-pointer
Contents |
Java VM
The Virtual machine has been assigned 1024MB.
ACTIVEMQ_OPTS="-Xms1024M -Xmx1024M"
System settings
<systemUsage> <systemUsage sendFailIfNoSpaceAfterTimeout="2000"> <memoryUsage> <memoryUsage limit="512 mb"/> </memoryUsage> <storeUsage> <storeUsage limit="1 gb" name="foo"/> </storeUsage> <tempUsage> <tempUsage limit="100 mb"/> </tempUsage> </systemUsage> </systemUsage>
sendFailIfNoSpaceAfterTimeout
<memoryUsage limit="512 mb"/>
This is the maximum value for the broker. This value affects the flow control.
<storeUsage limit="1 gb" name="foo"/>
This is the maximum value for the broker. This value affects the flow control.
Policy settings
<policyEntry queue=">" producerFlowControl="true" optimizedDispatch="true" memoryLimit="124mb" queuePrefetch="10">memoryLimit="124mb"
This value affects the flow control. This must be less than the memoryUsage value.
queuePrefetch="1"
The prefetch value is low as there are multiple consumers.
optimizedDispatch="true"
Transport Connector
<transportConnector name="openwire" uri="nio://0.0.0.0:61761" discoveryUri="multicast://239.255.2.3:61788?group=gib"/>nio for transport connectors
Producer settings
jms.broker.url=tcp://localhost:61860?jms.useAsyncSend=true&jms.optimizedAcknowledge=true
jms.useAsyncSend=true
jms.optimizeAcknowledge=true
Network Connector
<networkConnector name="bridge" uri="static:(ssl://93.93.83.137:61443?keepAlive=true)" duplex="true" networkTTL="6" decreaseNetworkConsumerPriority="true" suppressDuplicateQueueSubscriptions="true"/>
networkTTL
The following settings have been shown, through testing, to prevent messages getting stuck on the brokers.
decreaseNetworkConsumerPriority="true"
- Local consumers (attached directly to the broker) have a priority of 0.
- Network subscriptions have an initial priority of -5.
- The priority of a network subscription is reduced by 1 for every network hop that it traverses
suppressDuplicateQueueSubscriptions="true"
Setting up the Key and Trust Stores
Setting up the Key and Trust Stores[7] ActiveMQ uses dummy credentials by default ActiveMQ includes key and trust stores that reference a dummy self signed cert. When you create a broker certificate and stores for your installation, either overwrite the values in the conf directory or delete the existing dummy key and trust stores so they cannot interfere)
1. Using keytool, create a certificate for the broker:
[root@localhost ~]# keytool -genkey -alias broker -keyalg RSA -keystore broker.ks
2. Export the broker's certificate so it can be shared with clients:
[root@localhost ~]# keytool -export -alias broker -keystore broker.ks -file broker_cert
3. Create a certificate/keystore for the client:
[root@localhost ~]# keytool -genkey -alias client -keyalg RSA -keystore client.ks
4. Create a truststore for the client, and import the broker's certificate. This establishes that the client "trusts" the broker:
[root@localhost ~]# keytool -import -alias broker -keystore client.ts -file broker_cert
Broker settings
N.B. The tags are in alphabetical order.
Place the keystore and truststore in the conf folder of the activeMQ:
<broker> <sslContext> <sslContext keyStore="broker.ks" keyStorePassword="password01" trustStore="client.ts" trustStorePassword="password01"/> </sslContext> </broker>
References
- ↑ 1.0 1.1 "Vertical Scaling"
- ↑ "Producer Flow Control" Retrieved 4 Nov 2011.
- ↑ 3.0 3.1 "Prefetch limit"
- ↑ "Threading Optimizations"
- ↑ "Async send"
- ↑ 6.0 6.1 6.2 "Optimizing Routes" Retrieved 21 Apr 2011.
- ↑ "Setting up the Key and Trust Stores" Retrieved 16 Mar 2011.

