Cosminexus V9 アプリケーションサーバ 機能解説 基本・開発編(コンテナ共通機能)

[目次][用語][索引][前へ][次へ]

付録E.4 CJMSプロバイダを使用するアプリケーションの追加

稼働中のシステムに対して新規にアプリケーションを追加する場合の手順を次の図に示します。

図E-3 稼働中のシステムに対して新規にアプリケーションを追加する手順

[図データ]

[図データ]

<この項の構成>
(1) プロセス前提条件
(2) 実行に必要な情報および補足説明

(1) プロセス前提条件

(2) 実行に必要な情報および補足説明

(A1)などの記述は,図中の記述と対応しています。

(A1)
運用管理ポータル(Management Server)機能でアプリケーションを停止します。

(A2)
<サーバ名>
Management Serverで構築したサーバ名
<CJMSPリソースアダプタ表示名>
CJMSPリソースアダプタの表示名
CJMSプロバイダの場合は,デフォルトで「Cosminexus_JMS_Provider_RA」が設定されています。

(A3)
Connector属性ファイルは,テンプレートファイルをコピーし,編集します。
テンプレートファイルは,<CJMSP_HOME>/lib/templates/Cosminexus_JMS_Provider_RA_cfg.xmlを使用します。
送信先を使用するため,CJMSPリソースアダプタが提供する管理対象オブジェクトについての定義を行います。
設定例を次に示します。番号を振っているタグを指定してください(番号は実際の定義には含まれません)。
 
    <config-property>
      <description xml:lang="en"></description>
      <config-property-name>ConnectionURL</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
(1)   <config-property-value>mq://localhost:7676/</config-property-value>
    </config-property>
     <config-property>
          <description xml:lang="en"></description>
          <config-property-name>clientId</config-property-name>
          <config-property-type>java.lang.String</config-property-type>
(2)   <config-property-value>Test</config-property-value>
    </config-property>
 
   <adminobject>
(3)    <adminobject-name>myQueue</adminobject-name>
(4)    <adminobject-interface>javax.jms.Queue</adminobject-interface>
(5)    <adminobject-class>com.cosminexus.jmsprovider.messaging.Queue</adminobject-class>
    <config-property>
      <description xml:lang="en"></description>
      <config-property-name>Name</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
(6)    <config-property-value>TestQueue</config-property-value>
    </config-property>
    <config-property>
     <description xml:lang="en"></description>
     <config-property-name>Description</config-property-name>
     <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
   </adminobject>
 
各番号の指定内容を示します。
  1. CJMSPブローカーを起動するホスト名およびポート番号を指定します。
  2. クライアント識別子を指定します。永続化サブスクライバーを使用する場合に必要になります。
  3. <adminobject-name>に管理対象オブジェクト名を指定します。CJMSPリソースアダプタ内でユニークである必要があります。
  4. <adminobject-interface>に管理対象オブジェクトのクラスが実装するインタフェースを指定します。
    Queueを使用する場合は,javax.jms.Queueを設定します。
    Topicを使用する場合は,javax.jms.Topicを設定します。
  5. <adminobject-class>に管理対象オブジェクトのクラスを設定します。
    Queueを使用する場合は,com.cosminexus.jmsprovider.messaging.Queueを設定します。
    Topicを使用する場合は,com.cosminexus.jmsprovider.messaging.Topicを設定します。
  6. 送信先の名前を設定します。
    使用する送信先数分,<adminobject>タグを作成します。
    注意
    Message-driven Beanを使用する場合は下記の2点を設定してください。
    • 次に示す(a)の値が(b)の値以上になるように設定してください。
    • デプロイしているすべてのMessage-driven Beanの(a)の合計数の値が,次に示す(c)の値以下になるように設定してください
       
      アプリケーションプロパティファイルのMessage-driven Beanのインスタンスプール最大数
      <pooled-instance>
      <minimum>1</minimum>
      (a) <maximum>2</maximum>
      </pooled-instance>
       
      アプリケーションプロパティファイルのEndpointのインスタンスプール最大数
      <activation-config-property>
      <activation-config-property-name>endpointPoolMaxSize</activation-config-property-name>
      (b) <activation-config-property-value>1</activation-config-property-value>
      </activation-config-property>
       
      CJMSPリソースアダプタのConnector属性ファイルのWorkManagerのスレッドプール最大数
      <property>
      <property-name>MaxTPoolSize</property-name>
      <property-type>int</property-type>
      (c) <property-value>10</property-value>
      <property-default-value>10</property-default-value>
      </property>

(A4)
<サーバ名>
Management Serverで構築したサーバ名
<CJMSPリソースアダプタ表示名>
CJMSPリソースアダプタの表示名
CJMSプロバイダの場合は,デフォルトで「Cosminexus_JMS_Provider_RA」が設定されています。
<Connector属性ファイルパス>
属性ファイルの入力元パス

(A5)
<サーバ名>
Management Serverで構築したサーバ名
<CJMSPリソースアダプタ表示名>
CJMSPリソースアダプタの表示名
CJMSプロバイダの場合は,デフォルトで「Cosminexus_JMS_Provider_RA」が設定されています。
CJMSPリソースアダプタの接続テストでは,次の2点を確認しています。
  • 動作モードが1.4モードであること。
  • CJMSPブローカーとの接続を確立できること。

(A6)
<サーバ名>
Management Serverで構築したサーバ名
<CJMSPリソースアダプタ表示名>
CJMSPリソースアダプタの表示名
CJMSプロバイダの場合は,デフォルトで「Cosminexus_JMS_Provider_RA」が設定されています。

(A7)
<Queue名>,<Topic名>
Queue名またはTopic名
<最大メッセージ数>
QueueまたはTopicに格納できる最大メッセージ数
<メッセージトータルバイト数>
QueueまたはTopicの最大トータルメッセージバイト数
<最大プロデューサー数>
送信先の最大プロデューサー数
<最大コンシューマーフローリミット数>
一つの処理単位でコンシューマーに配送できる最大メッセージ数
<ホスト名>:<ポート番号>
CJMSPブローカーを起動しているホスト名およびポート番号
CJMSPブローカーの起動時にポート番号を省略した場合にはデフォルトの7676が使用されています。その場合,-bオプションの指定は省略できます。
<Queue名> または<Topic名>には,(A3)の(6)で設定した,送信先の名前を入力する。

(A8)
<Queue名>,<Topic名>
Queue名またはTopic名
<ホスト名>:<ポート番号>
CJMSPブローカーを起動しているホスト名およびポート番号
CJMSPブローカーの起動時にポート番号を省略した場合にはデフォルトの7676が使用されています。その場合,-bオプションの指定は省略できます。
(A7)で作成した送信先が指定したプロパティで正しく作られていることを確認してください。(A7)で指定した各引数と,表示内容の対応は次のとおりです。
  • maxNumMsgs → Max Number of Messages
  • maxNumProducers → Max Number of Producers
  • maxTotalMsgBytes → Max Total Message Bytes
  • consumerFlowLimit → Consumer Flow Limit
指定したプロパティは次の表示で出力されます。この例は,Queueを作成した場合の実行例です。
 
Destination Name                      TestQueue
Destination Type                      Queue
Destination State                     RUNNING
Created Administratively              true
 
Current Number of Messages
    Actual                            0
    Held in Transaction               0
Current Message Bytes
    Actual                            0
    Held in Transaction               0
Current Number of Producers           0
Current Number of Active Consumers    0
 
Max Number of Messages                unlimited (-1)
Max Total Message Bytes               unlimited (-1)
Max Number of Producers               unlimited (-1)
 
Consumer Flow Limit                   100
 
KDAN34151-I Successfully queried the destination.
 

(A9)
アプリケーションのプロパティに,CJMSPリソースアダプタのコネクションファクトリ,管理対象オブジェクトを関連づける設定をします。
設定例を次に示します。番号を振っているタグを指定してください(番号は実際の定義には含まれません)。
 
   <resource-ref>
(1)     <res-ref-name>jms/qcf</res-ref-name>
(2)     <res-type>javax.jms.QueueConnectionFactory</res-type>
(3)     <res-auth>Container</res-auth>
(4)     <res-sharing-scope>Unshareable</res-sharing-scope>
(5)     <linked-to>Cosminexus_JMS_Provider_RA!javax.jms.QueueConnectionFactory</linked-to>
   </resource-ref>
   <resource-env-ref>
(6)     <resource-env-ref-name>jms/TestQueue</resource-env-ref-name>
(7)     <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
        <linked-adminobject>
(8)       <resourceadapter-name>Cosminexus_JMS_Provider_RA</resourceadapter-name>
(9)       <adminobject-name>myQueue</adminobject-name>
        </linked-adminobject>
   </resource-env-ref>
 
各番号の指定内容を示します。
  1. <res-ref-name>にリソース参照の名称を指定します。
  2. <res-type>にリソース参照のタイプを指定します。コネクションファクトリの種類を指定します。
  3. <res-auth>にリソースを使用するための認証元を,アプリケーション上で行うか,コンテナに任せるかを指定します。
    指定できる文字列を次に示します。
    Application
    Container
  4. <res-sharing-scope>にリソース接続を共有するかどうかを指定します。
    指定できる文字列を次に示します。
    Shareable
    Unshareable
  5. <linked-to>に対応するCJMSPリソースアダプタ表示名を指定します。
    次の文字列を指定します。
    <CJMSPリソースアダプタ表示名>!<コネクション定義識別子>
  6. <resource-env-ref-name>にリソース環境変数参照の名称を指定します。
  7. <resource-env-ref-type>に管理対象オブジェクトの型をします。送信先のインタフェースの種類を指定します。
  8. <resourceadapter-name>にCJMSPリソースアダプタの表示名を指定します。
  9. <adminobject-name>に(A3)の(3)で設定した,管理対象オブジェクト名を指定します。

(A10)
特にありません。

(A11)
特にありません。