Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
5.5. Configuring the Post Office
The post office routes messages to their destination or destinations. It maintains the mappings between the addresses to which a message can be sent, and the final queue. For example, when sending a message with an address that represents a JMS queue, the post office routes the message to that JMS queue. When sending a message with an address that represents a JMS topic, the post office routes the message to a set of queues — one for each JMS subscription.
The post office also handles the persistence for address mapping.
JBoss Messaging post offices are cluster-aware. In a cluster, they automatically route (push) and pull messages between nodes in order to provide fully-distributed JMS queues and topics.
Configure the post office in the
<database type>-persistence-service.xml file. For example:
5.5.1. MessagingPostOffice Attributes Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
MessagingPostOffice Service Attributes are described in the following list.
- DataSource
- The datasource the postoffice should use for persisting its mapping data.
- SQLProperties
- This is where the DDL and DML for the particular database is specified. If a particular DDL or DML statement is not overridden, the default Hypersonic configuration will be used for that statement.
- CreateTablesOnStartup
- Set this to
trueif you wish the post office to attempt to create the tables (and indexes) when it starts. If the tables (or indexes) already exist aSQLExceptionwill be thrown by the JDBC driver and ignored by the Persistence Manager, allowing it to continue.By default the value ofCreateTablesOnStartupattribute is set totrue - DetectDuplicates
- Set this to
trueif you wish the post office detect duplicate messages that may sent when a send is retried on a different node after server failure.By default the value ofDetectDuplicatesattribute is set totrue - IDCacheSize
- If duplicate detection is enabled. (See
DetectDuplicates), then the server will remember the lastnmessage ids sent, to prevent duplicate messages sent after failover has occurred. The value ofnis determined by this attribute.By default the value ofIDCacheSizeattribute is set to500 - PostOfficeName
- The name of the post office.
- NodeIDView
- This returns set containing the node ids of all the nodes in the cluster.
- GroupName
- All post offices in the cluster with the same group name will form a cluster together. Make sure the group name matches with all the nodes in the cluster you want to form a cluster with.
- Clustered
- If true the post office will take part in a cluster to form distributed queues and topics. If false then it will not participate in the cluster. If false, then all the cluster related attributes will be ignored.
- StateTimeout
- The maximum time to wait when waiting for the group state to arrive when a node joins a pre-existing cluster.The default value is
5000milliseconds. - CastTimeout
- The maximum time to wait for a reply casting message synchronously.The default value is
5000milliseconds. - FailoverOnNodeLeave
- Specifies how messages stored on a node are redistributed when a node is cleanly shutdown. The default value is
false. Iftrue, when a server node is shut down cleanly (using Ctrl+C in the terminal) all messages stored on the node are moved to another node in the cluster.Important
Clients originally connected to the cleanly shutdown node are not automatically reconnected to the failover node in the cluster. Clients return an exception upon message failover. - MaxConcurrentReplications
- The maximum number of concurrent replication requests to make before blocking for replies to come back. This prevents us overwhelming JGroups. This is rarely a good reason to change this.The default value is
50 - ControlChannelConfig
- JBoss Messaging uses JGroups for all group management. This contains the JGroups stack configuration for the control channel.The control channel is used for sending request/receiving responses from other nodes in the clusterThe details of the JGroups configuration will not be discussed here since it is standard JGroups configuration. Detailed information on JGroups can be found in JGroups release documentation or on-line at http://www.jgroups.org or http://wiki.jboss.org/wiki/Wiki.jsp?page=JGroups.
- DataChannelConfig
- JBoss Messaging uses JGroups for all group management. This contains the JGroups stack configuration for the data channel.The data channel is used for sending sending/receiving messages from other nodes in the cluster and for replicating session data.The details of the JGroups configuration will not be discussed here since it is standard JGroups configuration. Detailed information on JGroups can be found in JGroups release documentation or on-line at http://www.jgroups.org or http://wiki.jboss.org/wiki/Wiki.jsp?page=JGroups.
Database Connection Retry Parameters control whether a connection should be re-established when a connection failure is detected, how many attempts to reconnect should be made, and at what interval each attempt should be made.
- RetryOnConnectionFailure
- Specifies whether the MBean should attempt to reconnect to the database. The default is
false. - MaxRetry
- Specifies the maximum limit for DataSource connection failures. The default is
25. Set the parameter to-1to activate "retry forever" mode. This parameter is valid whenRetryOnConnectionFailureis set totrue.Important
Clients that consume messages from a clustered destination can become unresponsive when closed. This happens if the node has the valueMaxRetryset to-1, and loses the connection to the database. To avoid the problem, set the node parameterMaxRetryto a value greater than-1. You can set the attribute value in the MBeansPersistenceManager,PostOffice, andJMSUserManagerin the file[database]-persistence-service.xml - RetryInterval
- Specifies the retry interval between two consecutive retries. The default is 1000 (milliseconds). This parameter is valid when
RetryOnConnectionFailureis set totrue.
If a node becomes unresponsive for a few seconds while still being stable (for example during a minor network malfunction), past failover behavior reported the node had left the cluster. This scenario can be avoided by specifying the following parameters in the MessagePostOffice bean. The following parameters provide the MessagePostOffice access to the cluster timestamp table, which is used to more accurately determine the state of a node.
Important
The timestamp table parameters should be used in conjunction with the MessagingClusterHealthMBean MBean. You deploy this MBean in the ServerPeer MBean. Refer to Section 5.1, “Configuring the ServerPeer” for a full overview of the supported parameters and operations.
- KeepOldFailoverMode
- Specifies whether the timestamp table failover mode should be used. The default is
true(disable new failover behavior). - NodeStateRefreshInterval
- Specifies the maximum duration (in milliseconds) a cluster will wait for a node to refresh its timestamp before the cluster marks the node as disabled. The default is 30000 (30 seconds).