Set new JMS connections using scripting
Use scripting and wsadmin to configure a new JMS connection.
Before starting this task, wsadmin must be running. See the Start wsadmin article for more information.
Perform the following steps to configure a new JMS connection:
- Set a connection pool for the generic connection factories.
Because J2C manages the generic connection factories, configure a connection pool to indicate the policy for connection management by J2C.
The following example commands configure a connection pool in the environment:
- Jacl...
set connectionPool [$AdminConfig create ConnectionPool $yourGenericCF {} connectionPool] set sessionPool [$AdminConfig create ConnectionPool $yourGenericCF {} sessionPool]- Jython...
connectionPool = AdminConfig.create('ConnectionPool', '[yourGenericCF {}, connectionPool]') sessionPool = AdminConfig.create('ConnectionPool', '[yourGenericCF {}, sessionPool]')
- Identify the parent ID:
- Jacl...
set newjmsp [$AdminConfig getid /Cell:mycell/Node:myNode/JMSProvider:JMSP1]- Jython...
newjmsp = AdminConfig.getid('/Cell:mycell/Node:myNode/JMSProvider:JMSP1') print newjmsp
For example...
JMSP1(cells/mycell/nodes/mynode|resources.xml#JMSProvider_1)- Get required attributes:
- Jacl...
$AdminConfig required GenericJMSConnectionFactory- Jython...
print AdminConfig.required('GenericJMSConnectionFactory')
For example...
Attribute Type name String jndiName String externalJNDIName String- Set up required attributes:
- Jacl...
set name [list name JMSCF1] set jndi [list jndiName jms/JMSConnFact1] set extJndi [list externalJNDIName jms/extJMSCF1] set jmscfAttrs [list $name $jndi $extJndi]For example...
{name JMSCF1} {jndiName jms/JMSConnFact1} {externalJNDIName jms/extJMSCF1}- Jython...
name = ['name', 'JMSCF1'] jndi = ['jndiName', 'jms/JMSConnFact1'] extJndi = ['externalJNDIName', 'jms/extJMSCF1'] jmscfAttrs = [name, jndi, extJndi] print jmscfAttrsFor example...
[[name, JMSCF1], [jndiName, jms/JMSConnFact1], [externalJNDIName, jms/extJMSCF1]]
- Create generic JMS connection factory:
- Jacl...
$AdminConfig create GenericJMSConnectionFactory $newjmsp $jmscfAttrs- Jython...
print AdminConfig.create('GenericJMSConnectionFactory', newjmsp, jmscfAttrs)
For example...
JMSCF1(cells/mycell/nodes/mynode|resources.xml#GenericJMSConnectionFactory_1)- Save the configuration changes. See the Saving configuration changes with wsadmin article for more information.
- In a network deployment environment only, synchronize the node. See the Synchronizing nodes with wsadmin article for more information.
Related tasks
Use the AdminConfig object for scripted administration
Related
Commands for the AdminConfig object