5.6. MessagingClusterHealthMBean の設定

MessagingPostOfficeKeepOldFailoverModeNodeStateRefreshInterval パラメーターを使い、ノードがクラスターの一部としてとどまるためにタイムスタンプを更新する時間を制御します。これらのパラメーターは、ノードがデータベースとの接続切断にどのように対応するのかを制御するわけではありません。
ノードとデータベースとの接続が切断された場合、MessagePostOffice 向けのタイムスタンプの情報を更新できません。ノードの状態が問題なくても、クラスターは実際のノードの状態を把握できません。結果、クラスターはノードはダウンし、重複メッセージの送信が発生する可能性があります。
MessagingClusterHealthMBean MBean はノードの状態を監視し、データベースへの接続が切れた場合ノードを開始/停止します。ノードがクラスターからシュンされた結果、データベースの接続がなくなった場合、MBean はノードを即座にシャットダウンします。MBean は、ノードがダウンしている間、JGroups のステータスとデータベースのステータスを監視し、JGroups を検出し、データベース接続が通常機能するようにリストアされた時点でノードを再起動します。
この機能を有効にするには、<depends> ディレクティブの optional-attribute-name 属性として、ServerPeer MBean の MessagingClusterHealthMBean MBean を宣言します。
<!-- ServerPeer MBean configuration ============================== -->
<mbean code="org.jboss.jms.server.ServerPeer"       name="jboss.messaging:service=ServerPeer"
      xmbean-dd="xmdesc/ServerPeer-xmbean.xml">

<!-- The unique id of the server peer - in a cluster each node MUST have a unique value - must be an integer -->

   <attribute name="ServerPeerID">0</attribute>
      
<!-- The default JNDI context to use for queues when they are deployed without specifying one --> 
      
   <attribute name="DefaultQueueJNDIContext">/queue</attribute>
      
<!-- The default JNDI context to use for topics when they are deployed without specifying one --> 
      
   <attribute name="DefaultTopicJNDIContext">/topic</attribute>

<!-- XML CONFIG REMOVED FOR READABILITY -->   


   <depends optional-attribute-name="PersistenceManager">
      jboss.messaging:service=PersistenceManager
   </depends>
      
<!-- XML CONFIG REMOVED FOR READABILITY -->

   <depends optional-attributename="MessagingClusterHealthMBean">
      jboss.messaging:service=MessagingClusterHealthMBean
   </depends>
          
</mbean>