Red Hat AMQ 6
As of February 2025, Red Hat is no longer supporting Red Hat AMQ 6. If you are using AMQ 6, please upgrade: Migrating to AMQ 7.このコンテンツは選択した言語では利用できません。
Fault Tolerant Messaging
Hardening your Red Hat JBoss A-MQ environment against downtime
Copyright © 2011-2015 Red Hat, Inc. and/or its affiliates.
Abstract
Chapter 1. Introduction リンクのコピーリンクがクリップボードにコピーされました!
Abstract
Overview リンクのコピーリンクがクリップボードにコピーされました!
- deploying multiple brokers into a topology that allows one broker to pick up the duties of a failed broker
- configuring clients to fail over to a new broker in the event that its current broker fails
Client fail over リンクのコピーリンクがクリップボードにコピーされました!
- the failover protocol—allows you to provide a list of brokers that a client can use
- the discovery protocol—allows clients to automatically discover the brokers available for fail over
Master/Slave topologies リンクのコピーリンクがクリップボードにコピーされました!
Chapter 2. Client Failover リンクのコピーリンクがクリップボードにコピーされました!
Abstract
2.1. Failover Protocol リンクのコピーリンクがクリップボードにコピーされました!
Abstract
2.1.1. Static Failover リンクのコピーリンクがクリップボードにコピーされました!
Overview リンクのコピーリンクがクリップボードにコピーされました!
Failover URI リンクのコピーリンクがクリップボードにコピーされました!
failover:uri1,...,uriN
failover:uri1,...,uriN
Copy to Clipboard Copied! Toggle word wrap Toggle overflow failover:(uri1,...,uriN)?TransportOptions
failover:(uri1,...,uriN)?TransportOptions
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
uri1,...,uriN
) is a comma-separated list containing the list of broker endpoint URIs to which the client can connect. The transport options(?TransportOptions
) specified in the form of a query list, allow you to configure some of the failoiver behaviors.
Transport options リンクのコピーリンクがクリップボードにコピーされました!
Option | Default | Description |
---|---|---|
initialReconnectDelay | 10 | Specifies the number of milliseconds to wait before the first reconnect attempt. |
maxReconnectDelay | 30000 | Specifies the maximum amount of time, in milliseconds, to wait between reconnect attempts. |
useExponentialBackOff | true | Specifies whether to use an exponential back-off between reconnect attempts. |
backOffMultiplier | 2 | Specifies the exponent used in the exponential back-off algorithm. |
maxReconnectAttempts | -1 | Specifies the maximum number of reconnect attempts before an error is returned to the client. -1 specifies unlimited attempts. 0 specifies that an initial connection attempt is made at start-up, but no attempts to fail over to a secondary broker will be made. |
startupMaxReconnectAttempts | -1 | Specifies the maximum number of reconnect attempts before an error is returned to the client on the first attempt by the client to start a connection. -1 specifies unlimited attempts and 0 specifies no retry attempts. |
randomize | true | Specifies if a URI is chosen at random from the list. Otherwise, the list is traversed from left to right. |
backup | false | Specifies if the protocol initializes and holds a second transport connection to enable fast failover. |
timeout | -1 | Specifies the amount of time, in milliseconds, to wait before sending an error if a new connection is not established. -1 specifies an infinite timeout value. |
trackMessages | false | Specifies if the protocol keeps a cache of in-flight messages that are flushed to a broker on reconnect. |
maxCacheSize | 131072 | Specifies the size, in bytes, used for the cache used to track messages. |
updateURIsSupported | true | Specifies whether the client accepts updates to its list of known URIs from the connected broker. Setting this to false inhibits the client's ability to use dynamic failover. See Section 2.1.2, “Dynamic Failover”. |
updateURIsURL | Specifies a URL locating a text file that contains a comma-separated list of URIs to use for reconnect in the case of failure. See Section 2.1.2, “Dynamic Failover”. | |
nested.* | Specifies extra options that can be added to the nested URLs. see Example 2.4, “Adding Options for Nested Failover URL” | |
warnAfterReconnectAttempts | 10 | Specifies to log a warning for no connection after every N number of attemps to reconnect. To disable the feature, set the value to <=0 |
Example リンクのコピーリンクがクリップボードにコピーされました!
Example 2.1. Simple Failover URI
failover:(tcp://localhost:61616,tcp://remotehost:61616)?initialReconnectDelay=100
failover:(tcp://localhost:61616,tcp://remotehost:61616)?initialReconnectDelay=100
2.1.2. Dynamic Failover リンクのコピーリンクがクリップボードにコピーされました!
Abstract
Overview リンクのコピーリンクがクリップボードにコピーされました!
Set-up リンクのコピーリンクがクリップボードにコピーされました!
- The client's must be configured to use the failover protocol when connecting with its broker.
- The client must be configured to accept URI lists from a broker.
- The brokers must be configured to form a network of brokers.
- The broker's transport connector must set the failover properties needed to update its consumers.
Client-side configuration リンクのコピーリンクがクリップボードにコピーされました!
- The failover URI can consist of a single broker URI.
- The
updateURIsSupported
option must be set totrue
. - The
updateURIsURL
option should be set so that the transport can failover to a new broker when none of the broker's in the dynamically supplied list are available.
Broker-side configuration リンクのコピーリンクがクリップボードにコピーされました!
- The broker must be configured to participate in a network of brokers that can be available for failovers.See "Using Networks of Brokers" for information about setting up a network of brokers.
- The broker's transport connector must set the failover properties needed to update its consumers.
transportConnector
element.
Example リンクのコピーリンクがクリップボードにコピーされました!
Example 2.2. Broker for Dynamic Failover
- 1
- Creates a network connector that connects to any discoverable broker that uses the multicast transport.
- 2
- Makes the broker discoverable by other brokers over the multicast protocol.
- 3
- Makes the broker update the list of available brokers for clients that connect using the failover protocol.NoteClients will only be updated when new brokers join the cluster, not when a broker leaves the cluster.
- 4
- Creates a filter so that only those brokers whose names start with the letter
A
or the letterB
are considered to belong to the failover cluster.
Example 2.3. Failover URI for Connecting to a Failover Cluster
failover:(tcp://0.0.0.0:61616)?initialReconnectDelay=100
failover:(tcp://0.0.0.0:61616)?initialReconnectDelay=100
Example 2.4. Adding Options for Nested Failover URL
failover:(tcp://host01:61616,tcp://host02:61616,tcp://host03:61616)?nested.wireFormat.maxInactivityDuration=1000
failover:(tcp://host01:61616,tcp://host02:61616,tcp://host03:61616)?nested.wireFormat.maxInactivityDuration=1000
2.1.3. Priority Backup リンクのコピーリンクがクリップボードにコピーされました!
Example 2.5. Priority backup
failover:(tcp://local:61616,tcp://remote:61616)?randomize=false&priorityBackup=true
failover:(tcp://local:61616,tcp://remote:61616)?randomize=false&priorityBackup=true
priorityBackup
parameter is used, the client will constantly try to reconnect to the local broker and the client switches to the local broker without any intervention.
Example 2.6. Priority URI
priorityURIs
parameter
failover:(tcp://local1:61616,tcp://local2:61616,tcp://remote:61616)?randomize=false&priorityBackup=true&priorityURIs=tcp://local1:61616,tcp://local2:61616
failover:(tcp://local1:61616,tcp://local2:61616,tcp://remote:61616)?randomize=false&priorityBackup=true&priorityURIs=tcp://local1:61616,tcp://local2:61616
2.2. Discovery Protocol リンクのコピーリンクがクリップボードにコピーされました!
Abstract
- discovery URI—looks up all of the discoverable brokers and presents them as a list of actual URIs for use by the client or network connector
- discovery agents—components that advertise the list of available brokers
2.2.1. Dynamic Discovery Protocol リンクのコピーリンクがクリップボードにコピーされました!
Abstract
Overview リンクのコピーリンクがクリップボードにコピーされました!
URI syntax リンクのコピーリンクがクリップボードにコピーされました!
Example 2.7. Dynamic Discovery URI
discovery:(DiscoveryAgentUri)?Options
discovery:(DiscoveryAgentUri)?Options
?Options
, are specified in the form of a query list. The discovery options are described in Table 2.3, “Dynamic Discovery Protocol Options”. You can also inject transport options as described in the section called “Setting options on the discovered transports”.
Transport options リンクのコピーリンクがクリップボードにコピーされました!
Sample URI リンクのコピーリンクがクリップボードにコピーされました!
Example 2.8. Discovery Protocol URI
discovery:(multicast://default)?initialReconnectDelay=100
discovery:(multicast://default)?initialReconnectDelay=100
Setting options on the discovered transports リンクのコピーリンクがクリップボードにコピーされました!
connectionTimeout
option to 10 seconds.
Example 2.9. Injecting Transport Options into a Discovered Transport
discovery:(multicast://default)?connectionTimeout=10000
discovery:(multicast://default)?connectionTimeout=10000
2.2.2. Discovery Agents リンクのコピーリンクがクリップボードにコピーされました!
Abstract
2.2.2.1. Introduction to Discovery Agents リンクのコピーリンクがクリップボードにコピーされました!
What is a discovery agent? リンクのコピーリンクがクリップボードにコピーされました!
Discovery mechanisms リンクのコピーリンクがクリップボードにコピーされました!
transportConnector
element as shown in Example 2.10, “Enabling a Discovery Agent on a Broker”.
Example 2.10. Enabling a Discovery Agent on a Broker
<transportConnectors> <transportConnector name="openwire" uri="tcp://localhost:61716" discoveryUri="multicast://default" /> </transportConnectors>
<transportConnectors>
<transportConnector name="openwire"
uri="tcp://localhost:61716"
discoveryUri="multicast://default" />
</transportConnectors>
discoveryUri
attribute on the transportConnector
element is initialized to multicast://default
.
Discovery agent types リンクのコピーリンクがクリップボードにコピーされました!
2.2.2.2. Fuse Fabric Discovery Agent リンクのコピーリンクがクリップボードにコピーされました!
Abstract
Overview リンクのコピーリンクがクリップボードにコピーされました!
URI リンクのコピーリンクがクリップボードにコピーされました!
Example 2.11. Fuse Fabric Discovery Agent URI Format
fabric://GID
fabric://GID
Configuring a broker リンクのコピーリンクがクリップボードにコピーされました!
Configuring a client リンクのコピーリンクがクリップボードにコピーされました!
Example 2.12. Client Connection URL using Fuse Fabric Discovery
discovery:(fabric://nwBrokers)
discovery:(fabric://nwBrokers)
nwBrokers
broker group and generate a list of brokers to which it can connect.
2.2.2.3. Static Discovery Agent リンクのコピーリンクがクリップボードにコピーされました!
Abstract
Overview リンクのコピーリンクがクリップボードにコピーされました!
Using the agent リンクのコピーリンクがクリップボードにコピーされました!
Example 2.13. Static Discovery Agent URI Format
static://(URI1,URI2,URI3,...)
static://(URI1,URI2,URI3,...)
Example リンクのコピーリンクがクリップボードにコピーされました!
Example 2.14. Discovery URI using the Static Discovery Agent
discovery:(static://(tcp://localhost:61716,tcp://localhost:61816))
discovery:(static://(tcp://localhost:61716,tcp://localhost:61816))
2.2.2.4. Multicast Discovery Agent リンクのコピーリンクがクリップボードにコピーされました!
Abstract
Overview リンクのコピーリンクがクリップボードにコピーされました!
URI リンクのコピーリンクがクリップボードにコピーされました!
Example 2.15. Multicast Discovery Agent URI Format
multicast://GroupID
multicast://GroupID
Configuring a broker リンクのコピーリンクがクリップボードにコピーされました!
transportConnector
element's discoveryUri
attribute to a mulitcast discovery agent URI as shown in Example 2.16, “Enabling a Multicast Discovery Agent on a Broker”.
Example 2.16. Enabling a Multicast Discovery Agent on a Broker
<transportConnectors> <transportConnector name="openwire" uri="tcp://localhost:61716" discoveryUri="multicast://default" /> </transportConnectors>
<transportConnectors>
<transportConnector name="openwire"
uri="tcp://localhost:61716"
discoveryUri="multicast://default" />
</transportConnectors>
default
.
Configuring a client リンクのコピーリンクがクリップボードにコピーされました!
Example 2.17. Client Connection URL using Multicast Discovery
discovery:(multicast://default)
discovery:(multicast://default)
default
multicast group and generate a list of brokers to which it can connect.
2.2.2.5. Zeroconf Discovery Agent リンクのコピーリンクがクリップボードにコピーされました!
Abstract
Overview リンクのコピーリンクがクリップボードにコピーされました!
URI リンクのコピーリンクがクリップボードにコピーされました!
Example 2.18. Zeroconf Discovery Agent URI Format
zeroconf://GroupID
zeroconf://GroupID
Configuring a broker リンクのコピーリンクがクリップボードにコピーされました!
transportConnector
element's discoveryUri
attribute to a mulitcast discovery agent URI as shown in Example 2.19, “Enabling a Multicast Discovery Agent on a Broker”.
Example 2.19. Enabling a Multicast Discovery Agent on a Broker
<transportConnectors> <transportConnector name="openwire" uri="tcp://localhost:61716" discoveryUri="multicast://NEGroup" /> </transportConnectors>
<transportConnectors>
<transportConnector name="openwire"
uri="tcp://localhost:61716"
discoveryUri="multicast://NEGroup" />
</transportConnectors>
NEGroup
.
Configuring a client リンクのコピーリンクがクリップボードにコピーされました!
Example 2.20. Client Connection URL using Zeroconf Discovery
discovery:(zeroconf://NEGroup)
discovery:(zeroconf://NEGroup)
NEGroup
multicast group and generate a list of brokers to which it can connect.
Chapter 3. Master/Slave リンクのコピーリンクがクリップボードにコピーされました!
Abstract
- Shared file system—the master and the slaves use a common persistence store that is located on a shared file system
- Shared JDBC database—the masters and the slaves use a common JDBC persistence store
3.2. Shared JDBC Master/Slave リンクのコピーリンクがクリップボードにコピーされました!
Overview リンクのコピーリンクがクリップボードにコピーされました!
- The shared database is a single point of failure. This disadvantage can be mitigated by using a database with built in high availability(HA) functionality. The database will handle replication and fail over of the data store.
- You cannot enable high speed journaling. This has a significant impact on performance.
Initial state リンクのコピーリンクがクリップボードにコピーされました!
Figure 3.4. JDBC Master/Slave Initial State
After failure of the master リンクのコピーリンクがクリップボードにコピーされました!
Figure 3.5. JDBC Master/Slave after Master Failure
Configuring the brokers リンクのコピーリンクがクリップボードにコピーされました!
Example 3.3. JDBC Master/Slave Broker Configuration
schedulerDirectory
as shown below:
<broker xmlns="http://activemq.apache.org/schema/core” schedulerSupport="true" schedulerDirectory="{activemq.data}/broker/scheduler”/>
<broker xmlns="http://activemq.apache.org/schema/core” schedulerSupport="true" schedulerDirectory="{activemq.data}/broker/scheduler”/>
Configuring the clients リンクのコピーリンクがクリップボードにコピーされました!
broker1
, broker2
, and broker3
.
Example 3.4. Client URL for a Shared JDBC Master/Slave Group
failover:(tcp://broker1:61616,tcp://broker2:61616,tcp://broker3:61616)
failover:(tcp://broker1:61616,tcp://broker2:61616,tcp://broker3:61616)
Reintroducing a failed node リンクのコピーリンクがクリップボードにコピーされました!
Figure 3.6. JDBC Master/Slave after Master Restart
Chapter 4. Master/Slave and Broker Networks リンクのコピーリンクがクリップボードにコピーされました!
Abstract
Overview リンクのコピーリンクがクリップボードにコピーされました!
- Network connectors to a master/slave group use a special protocol.
- A broker cannot open a network connection to another member of its master/slave group.
Configuring the connection to a master/slave group リンクのコピーリンクがクリップボードにコピーされました!
- Open a connection to the master broker without connecting to the slave brokers.
- Connect to the new master in the case of a failure.
Example 4.1. Network Connector to a Master/Slave Group
<networkConnectors> <networkConnector name="linkToCluster" uri="masterslave:(tcp://masterHost:61002,tcp://slaveHost:61002)" ... /> </networkConnectors>
<networkConnectors>
<networkConnector name="linkToCluster"
uri="masterslave:(tcp://masterHost:61002,tcp://slaveHost:61002)"
... />
</networkConnectors>
Host pair with master/slave groups リンクのコピーリンクがクリップボードにコピーされました!
Figure 4.1. Master/Slave Groups on Two Host Machines
brokerB1
should be configured to connect to at most brokerA1
and brokerA2
.
Network of multiple host pairs リンクのコピーリンクがクリップボードにコピーされました!
Figure 4.2. Broker Network Consisting of Host Pairs
brokerA1
can connect to at most the following brokers: brokerB*
, brokerC*
, brokerD*
, brokerE*
, brokerF*
, brokerG*
, and brokerH*
.
More information リンクのコピーリンクがクリップボードにコピーされました!
Index リンクのコピーリンクがクリップボードにコピーされました!
B
- broker networks
- master/slave, Configuring the connection to a master/slave group
- broker properties
- rebalanceClusterClients, Broker-side configuration
- updateClusterClients, Broker-side configuration
- updateClusterClientsOnRemove, Broker-side configuration
- updateClusterFilter, Broker-side configuration
D
- discovery agent
- Fuse Fabric, Fuse Fabric Discovery Agent
- multicast, Multicast Discovery Agent
- static, Static Discovery Agent
- zeroconf, Zeroconf Discovery Agent
- discovery protocol
- backOffMultiplier, Transport options
- initialReconnectDelay, Transport options
- maxReconnectAttempts, Transport options
- maxReconnectDelay, Transport options
- URI, URI syntax
- useExponentialBackOff, Transport options
- discovery URI, URI syntax
- discovery:, URI syntax
- discoveryUri, Configuring a broker, Configuring a broker
- dynamic failover, Dynamic Failover
- broker configuration, Broker-side configuration
- client configuration, Client-side configuration
F
- fabric://, URI
- failover, Failover Protocol
- backOffMultiplier, Transport options
- backup, Transport options
- broker properties, Broker-side configuration
- dynamic, Dynamic Failover
- initialReconnectDelay, Transport options
- maxCacheSize, Transport options
- maxReconnectAttempts, Transport options
- maxReconnectDelay, Transport options
- nested.*, Transport options
- randomize, Transport options
- startupMaxReconnectAttempts, Transport options
- static, Static Failover
- timeout, Transport options
- trackMessages, Transport options
- updateURIsSupported, Transport options
- updateURIsURL, Transport options
- useExponentialBackOff, Transport options
- warnAfterReconnectAttempts, Transport options
- failover URI, Failover URI
- transport options, Transport options
- failover://, Failover URI
- Fuse Fabric discovery agent
- URI, URI
J
- jdbcPersistenceAdapter, Configuring the brokers
M
- master broker
- reintroduction
- shared file system, Reintroducing a failed node
- shared JDBC, Reintroducing a failed node
- master/slave
- broker networks, Configuring the connection to a master/slave group
- network of brokers, Configuring the connection to a master/slave group
- masterslave, Configuring the connection to a master/slave group
- multicast discovery agent
- broker configuration, Configuring a broker
- URI, URI
- multicast://, URI
N
- network of brokers
- master/slave, Configuring the connection to a master/slave group
- NFSv3, File locking requirements
- NFSv4, File locking requirements
O
- OCFS2, File locking requirements
P
- persistenceAdapter, Configuring the brokers, Configuring the brokers
S
- shared file system master/slave
- advantages, Overview
- broker configuration, Configuring the brokers, Configuring the brokers
- client configuration, Configuring the clients
- disadvantages, Overview
- incompatible SANs, File locking requirements
- initial state, Initial state
- master failure, State after failure of the master
- NFSv3, File locking requirements
- NFSv4, File locking requirements
- OCFS2, File locking requirements
- recovery strategies, State after failure of the master
- reintroducing a node, Reintroducing a failed node
- shared JDBC master/slave
- advantages, Overview
- client configuration, Configuring the clients
- disadvantages, Overview
- initial state, Initial state
- master failure, After failure of the master
- recovery strategies, After failure of the master
- reintroducing a node, Reintroducing a failed node
- static discovery agent
- URI, Using the agent
- static failover, Static Failover
- static://, Using the agent
T
- transportConnector
- discoveryUri, Configuring a broker, Configuring a broker
Z
- zeroconf discovery agent
- broker configuration, Configuring a broker
- URI, URI
- zeroconf://, URI
Legal Notice リンクのコピーリンクがクリップボードにコピーされました!
Trademark Disclaimer