Appendix E.4 Adding applications that use Cosminexus JMS Provider
(1) Process preconditions
- The J2EE server process is running.
- The CJMSP resource adapter is running.
- The CJMSP Broker process is running.
- The application is not running (not imported).
(2) Information and supplementary explanation required for execution
The coding, such as (A1), corresponds to the coding in the figure.
- (A1)
- Stop the application with the management portal (Management Server) functionality.
- (A2)
- server-name
- Server name set up with Management Server
- CJMSP-resource-adapter-display-name
- Display name of the CJMSP resource adapter
- In Cosminexus JMS Provider, Cosminexus_JMS_Provider_RA is set up by default.
- (A3)
- Copy the template file and then edit the HITACHI Connector Property file.
- Use <CJMSP_HOME>/lib/templates/Cosminexus_JMS_Provider_RA_cfg.xml as the template file.
- To use a destination, define the Administered object provided by the CJMSP resource adapter.
- An example of setup is as follows. Specify the tags to which numbers are allocated (the numbers are not included in the actual definition).
<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>
- The content specified for each number is as follows:
- Specify the host name and port number that starts CJMSP Broker.
- Specify the client identifier. The client identifier is required for using the persistence subscriber.
- Specify the Administered object name in <adminobject-name>.The Administered object name must be unique in the CJMSP resource adapter.
- Specify the interface implemented by the Administered object class in <adminobject-interface>.
When you use Queue, specify javax.jms.Queue.
When you use Topic, specify javax.jms.Topic.
- Specify the Administered object class in <adminobject-class>.
When you use Queue, specify com.cosminexus.jmsprovider.messaging.Queue.
When you use Topic, specify com.cosminexus.jmsprovider.messaging.Topic.
- Set the name of the destination.
Create the <adminobject> tag for each destination to be used.
- Note
- When you use the Message-driven Beans, set up the following two points:
- In the following points, the value of (a) must be equal to or more than the value of (b).
- The value of total number of (a) of all the deployed Message-driven Beans must be equal to or less than the value of (c) shown below:
Maximum number of pooled Message-driven Bean instances in the HITACHI Application Property file
<pooled-instance>
<minimum>1</minimum>
(a) <maximum>2</maximum>
</pooled-instance>
Maximum number of pooled Endpoint instances in the HITACHI Application Property file
<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>
Maximum number of pooled WorkManager threads in the HITACHI Application Property file for the CJMSP resource adapter
<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)
- server-name
- Server name set up with Management Server
- CJMSP-resource-adapter-display-name
- Display name of the CJMSP resource adapter
- In Cosminexus JMS Provider, Cosminexus_JMS_Provider_RA is set up by default.
- HITACHI-Connector-Property-file-path
- Input source path of the property file
- (A5)
- server-name
- Server name set up with Management Server
- CJMSP-resource-adapter-display-name
- Display name of the CJMSP resource adapter
- In Cosminexus JMS Provider, Cosminexus_JMS_Provider_RA is set up by default.
- Check the following two points with the connection test for the CJMSP resource adapters:
- The operation mode is the 1.4 mode.
- A connection can be established with CJMSP Broker.
- (A6)
- server-name
- Server name set up with Management Server
- CJMSP-resource-adapter-display-name
- Display name of the CJMSP resource adapter
- In Cosminexus JMS Provider, Cosminexus_JMS_Provider_RA is set up by default.
- (A7)
- Queue-name, Topic-name
- Queue name or Topic name
- maximum-number-of-messages
- Maximum number of messages that can be stored in a Queue or Topic
- total-number-of-message-bytes
- Maximum total message bytes of a Queue or Topic
- maximum-number-of-producers
- Maximum number of producers for a destination
- maximum-consumer-flow-limit
- Maximum number of messages that one processing unit can deliver to a consumer
- host-name:port-number
- The host name and port number on which CJMSP Broker is running.
- If you omit the port number when CJMSP Broker is started, the default port number 7676 is used. In this case, you can omit the -b option.
- In the Queue-name or Topic-name, enter the destination name set at (6) in (A3).
- (A8)
- Queue-name, Topic-name
- Queue name or Topic name
- host-name:port-number
- The host name and port number on which CJMSP Broker is running.
- If you omit the port number when CJMSP Broker is started, the default port number 7676 is used. In this case, you can omit the -b option.
- Make sure that the destination created in (A7) has been created correctly using the specified property. The mapping between the arguments specified in (A7) and the displayed contents is as follows:
- maxNumMsgs ? Max Number of Messages
- maxNumProducers ? Max Number of Producers
- maxTotalMsgBytes ? Max Total Message Bytes
- consumerFlowLimit ? Consumer Flow Limit
- The specified property is output with the following display. This is an example of execution when Queue is created.
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)
- Specify settings to associate the CJMSP resource adapter connection factory and Administered object in the application property.
- An example of setup is as follows. Specify the tags to which numbers are allocated (the numbers are not included in the actual definition).
<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>
- The content specified for each number is as follows:
- In <res-ref-name>, specify the resource reference name.
- In <res-type>, specify the resource reference type. Specify the connection factory type.
- In <res-auth>, specify whether the authentication for using a resource will be performed on an application or will be entrusted to a container.
The specifiable strings are as follows:
Application
Container
- In <res-sharing-scope>, specify whether the resource connections will be shared.
The specifiable strings are as follows:
Shareable
Unshareable
- In <linked-to>, specify the corresponding CJMSP resource adapter display name.
Specify the following string:
CJMSP-resource-adapter-display-name!Connection-definition-identifier
- In <resource-env-ref-name>, specify the name of the resource environment variable reference.
- In <resource-env-ref-type>, specify the Administered object type. Specify the types of interfaces of the destination.
- In <resourceadapter-name>, specify the display name of the CJMSP resource adapter.
- In <adminobject-name>, specify the Administered object name set at (3) in (A3).
- (A10)
- No specific value.
- (A11)
- No specific value.