JMS configuration scripts
The scripting library provides many script procedures to manage the Java™ Messaging
Service (JMS) configurations. This page provides usage information for scripts that query the JMS configuration. We can run each script individually or combine many procedures to create custom automation scripts for the environment.
Each AdminJMS management script procedure is located in...
WAS_HOME/scriptLibraries/resources/JMS/V70
The Jython script library provides script functions for J2C resources, JDBC providers, and JMS resources at the server scope. You can write the own custom scripts to configure resources at the cell, node, or cluster level.
Do not edit the script procedures in the script library. To write custom script library procedures, use the scripts in the WAS_HOME/scriptLibraries directory as Jython syntax samples. Save the custom scripts to a new subdirectory to avoid overwriting the library.
Use the following script procedures to configure JMS in the environment:
- createGenericJMSConnectionFactory
- createGenericJMSConnectionFactoryUsingTemplate
- createGenericJMSDestination
- createGenericJMSDestinationUsingTemplate
- createJMSProvider
- createJMSProviderUsingTemplate
- createWASQueue
- createWASQueueUsingTemplate
- createWASQueueConnectionFactory
- createWASQueueConnectionFactoryUsingTemplate
- createWASTopic
- createWASTopicUsingTemplate
- createWASTopicConnectionFactory
- createWASTopicConnectionFactoryUsingTemplate
- startListenerPort
createGenericJMSConnectionFactory
This script creates a new generic JMS connection factory in the configuration.
The script returns the configuration ID of the new generic JMS connection factory. To run the script, specify the node, server, JMS provider name, name of the new connection factory, JNDI name, and external JNDI name arguments, as defined in the following table:
Table 1. Arguments for the createGenericJMSConnectionFactory script
Argument Description nodeName Name of the node of interest. serverName Name of the server of interest. jmsProvider Name of the JMS provider. connFactoryName Name to assign to the new connection factory jndiName JNDI name that the system uses to bind the connection factory into the name space. extJndiName JNDI name used to bind the queue into the appserver name space. As a convention, use the fully qualified JNDI name; for example, in the form jms/Name, where Name is the logical name of the resource. This name is used to link the platform binding information. The binding associates the resources defined by the deployment descriptor of the module to the actual (physical) resources bound into JNDI by the platform.
attributes Optionally specifies additional attributes in the following format: [["attr1", "value1"], ["attr2", "value2"]].
Syntax
AdminJMS.createGenericJMSConnectionFactory(nodeName, serverName, jmsProvider, connFactoryName, jndiName, extJndiName, attributes)Example usage
AdminJMS.createGenericJMSConnectionFactory("myNode", "myServer", "JMSTest", "JMSCFTest", "jmsjndi", "extjmsjndi")AdminJMS.createGenericJMSConnectionFactory("myNode", "myServer", "JMSTest", "JMSCFTest", "jmsjndi", "extjmsjndi", [["XAEnabled", "true"], ["authDataAlias", "myalias"], ["description", "testing"]])
createGenericJMSConnectionFactoryUsingTemplate
This script uses a template to create a generic JMS connection factory in the configuration. The script returns the configuration ID of the new generic
JMS connection factory. To run the script, specify the node, server, JMS provider name, template ID, connection factory name, JNDI name, and external
JNDI name arguments, as defined in the following table:
Table 2. Arguments for the createGenericJMSConnectionFactoryUsingTemplate script
Argument Description nodeName Name of the node of interest. serverName Name of the server of interest. jmsProvider Name of the JMS provider. templateID Configuration ID of the template to use. connFactoryName Name to assign to the new connection factory jndiName JNDI name that the system uses to bind the connection factory into the name space. extJndiName JNDI name used to bind the queue into the appserver name space. As a convention, use the fully qualified JNDI name; for example, in the form jms/Name, where Name is the logical name of the resource. This name is used to link the platform binding information. The binding associates the resources defined by the deployment descriptor of the module to the actual (physical) resources bound into JNDI by the platform.
attributes Optionally specifies additional attributes in the following format: [["attr1", "value1"], ["attr2", "value2"]].
Syntax
AdminJMS.createGenericJMSConnectionFactoryUsingTemplate(nodeName, serverName, jmsProvider, templateID, connFactoryName, jndiName, extJndiName, attributes)Example usage
AdminJMS.createGenericJMSConnectionFactoryUsingTemplate("myNode", "myServer", "JMSTest", "Generic QueueConnectionFactory forWindows(templates/system|JMS-resource-provider-templates.xml#GenericJMSConnectionFactory_1)", "JMSCFTest", "jmsjndi", "extjmsjndi")
AdminJMS.createGenericJMSConnectionFactoryUsingTemplate("myNode", "myServer", "JMSTest", "Generic QueueConnectionFactory forWindows(templates/system|JMS-resource-provider-templates.xml#GenericJMSConnectionFactory_1)", "JMSCFTest", "jmsjndi", "extjmsjndi", [["XAEnabled", "true"], ["authDataAlias", "myalias"], ["description", "testing"]])
createGenericJMSDestination
This script creates a generic JMS destination in the configuration. The script returns the configuration ID of the new generic JMS destination. To run the script, specify the node, server, JMS provider name, JMS destination name, JNDI name, and external JNDI name arguments, as defined in the following table,
Table 3. Arguments for the createGenericJMSDestination script
Argument Description nodeName Name of the node of interest. serverName Name of the server of interest. jmsProvider Name of the JMS provider. genericJMSDestination Name to assign to the new generic JMS destination. jndiName JNDI name that the system uses to bind the connection factory into the name space. extJndiName JNDI name used to bind the queue into the appserver name space. As a convention, use the fully qualified JNDI name; for example, in the form jms/Name, where Name is the logical name of the resource. This name is used to link the platform binding information. The binding associates the resources defined by the deployment descriptor of the module to the actual (physical) resources bound into JNDI by the platform.
attributes Optionally specifies additional attributes in the following format: [["attr1", "value1"], ["attr2", "value2"]].
Syntax
AdminJMS.createGenericJMSDestination(nodeName, serverName, jmsProvider, genericJMSDestination, jndiName, extJndiName, attributes)Example usage
AdminJMS.createGenericJMSDestination("myNode", "myServer", "JMSTest", "JMSDest", "destjndi", "extDestJndi")AdminJMS.createGenericJMSDestination("myNode", "myServer", "JMSTest", "JMSDest", "destjndi", "extDestJndi", [["description", "testing"], ["category", "jmsDestCatagory"], ["type", "TOPIC"]])
createGenericJMSDestinationUsingTemplate
This script uses a template to create a generic JMS destination in the configuration.
The script returns the configuration ID of the new generic JMS destination.
To run the script, specify the node, server, JMS provider name, template ID, generic JMS destination name, JNDI name, and external JNDI name arguments, as defined in the following table:
Table 4. Arguments for the createGenericJMSDestinationUsingTemplate script
Argument Description nodeName Name of the node of interest. serverName Name of the server of interest. jmsProvider Name of the JMS provider. templateID Configuration ID of the template to use. genericJMSDestination Name to assign to the new generic JMS destination. jndiName JNDI name that the system uses to bind the connection factory into the name space. extJndiName JNDI name used to bind the queue into the appserver name space. As a convention, use the fully qualified JNDI name; for example, in the form jms/Name, where Name is the logical name of the resource. This name is used to link the platform binding information. The binding associates the resources defined by the deployment descriptor of the module to the actual (physical) resources bound into JNDI by the platform.
attributes Optionally specifies additional attributes in the following format: [["attr1", "value1"], ["attr2", "value2"]].
Syntax
AdminJMS.createGenericJMSDestinationUsingTemplate(nodeName, serverName, jmsProvider, templateID, genericJMSDestination, jndiName, extJndiName, attributes)Example usage
AdminJMS.createGenericJMSDestinationUsingTemplate("myNode", "myServer", "JMSTest", "Example.JMS.Generic.Win.Topic(templates/system|JMS-resource-provider-templates.xml#GenericJMSDestination_2)", "JMSDest", "destjndi", "extDestJndi")AdminJMS.createGenericJMSDestinationUsingTemplate("myNode", "myServer", "JMSTest", "Example.JMS.Generic.Win.Topic(templates/system|JMS-resource-provider-templates.xml#GenericJMSDestination_2)", "JMSDest", "destjndi", "extDestJndi", [["description", "testing"], ["category", "jmsDestCatagory"], ["type", "TOPIC"]])
createJMSProvider
This script creates a JMS provider in the configuration. The script returns the configuration ID of the new JMS provider.
To run the script, specify the node, server, JMS provider name, external initial contextual factory name, and external provider URL arguments, as defined in the following table:
Table 5. Arguments for the createJMSProvider script
Argument Description nodeName Name of the node of interest. serverName Name of the server of interest. jmsProvider Name to assign to the new JMS provider. extContextFactory Java class name of the initial context factory for the JMS provider. extProviderURL JMS provider URL for external JNDI lookups. attributes Optionally specifies additional attributes in the following format: [["attr1", "value1"], ["attr2", "value2"]].
Syntax
AdminJMS.createJMSProvider(nodeName, serverName, jmsProvider, extContextFactory, extProviderURL, attributes)Example usage
AdminJMS.createJMSProvider("myNode", "myServer", "JMSTest1", "extInitCF", "extPURL")AdminJMS.createJMSProvider("myNode", "myServer", "JMSTest1", "extInitCF", "extPURL", [["description", "testing"], ["supportsASF", "true"], ["providerType", "jmsProvType"]])
createJMSProviderUsingTemplate
This script uses a template to create a JMS provider in the configuration. The script returns the configuration ID of the new JMS provider.
To run the script, specify the node, server, configuration ID of the JMS provider template, name to assign to the new JMS provider, external initial context factory, and external provider URL arguments, as defined in the following table:
Table 6. Arguments for the createJMSProviderUsingTemplate script
Argument Description nodeName Name of the node of interest. serverName Name of the server of interest. templateID Configuration ID of the JMS provider template to use. jmsProvider Name to assign to the new JMS provider. extContextFactory Java class name of the initial context factory for the JMS provider. extProviderURL JMS provider URL for external JNDI lookups. attributes Optionally specifies additional attributes in the following format: [["attr1", "value1"], ["attr2", "value2"]].
Syntax
AdminJMS.createJMSProviderUsingTemplate(nodeName, serverName, templateID, jmsProvider, extContextFactory, extProviderURL, attributes)Example usage
AdminJMS.createJMSProviderUsingTemplate("myNode", "myServer", "WebSphere JMSProvider(templates/servertypes/APPLICATION_SERVER/servers/DeveloperServer|resources.xml#builtin_jmsprovider)", "JMSTest", "extInitCF", "extPURL")
AdminJMS.createJMSProviderUsingTemplate("myNode", "myServer", "WebSphere JMSProvider(templates/servertypes/APPLICATION_SERVER/servers/DeveloperServer|resources.xml#builtin_jmsprovider)", "JMSTest", "extInitCF", "extPURL", [["description","testing"], ["supportsASF", "true"], ["providerType", "jmsProvType"]])
createWASQueue
This script creates a <tm tmclass="ibm" tmowner="IBM Corporation" tmtype="reg" trademark="WebSphere">WebSphere</tm> Application queue in the configuration. You should only use WAS JMS resources for applications that perform messaging with a WebSphere Application Server version 5.1 embedded JMSServer in a V7.0 cell. The script returns the configuration ID of the new WAS queue.
To run the script, specify the node, server, JMS provider name, name to assign to the queue, and JNDI name arguments, as defined in the following table:
Table 7. Arguments for the createWASQueue script
Argument Description nodeName Name of the node of interest. serverName Name of the server of interest. jmsProvider Name of the JMS provider of interest. queueName Name to assign to the new queue. jndiName JNDI name that the system uses to bind the connection factory into the name space. attributes Optionally specifies additional attributes in the following format: [["attr1", "value1"], ["attr2", "value2"]].
Syntax
AdminJMS.createWASQueue(nodeName, serverName, jmsProvider, queueName, jndiName, attributes)Example usage
AdminJMS.createWASQueue("myNode", "myServer", "JMSTest", "WASQueueTest", "queuejndi")AdminJMS.createWASQueue("myNode", "myServer", "JMSTest", "WASQueueTest", "queuejndi", [["description", "testing"], ["persistence", "APPLICATION_DEFINED"], ["priority", "APPLICATION_DEFINED"], ["specifiedPriority", "2"]])
createWASQueueUsingTemplate
This script uses a template to WAS queue in the configuration. You should only use WAS JMS resources for applications that perform messaging with a WebSphere Application Server version 5.1 embedded JMSServer in a V7.0 cell. The script returns the configuration ID of the new WAS queue. To run the script, specify the node, server, JMS provider name, configuration ID of the template, name to assign to the queue, and JNDI name arguments, as defined in the following table:
Table 8. Arguments for the createWASQueueUsingTemplate script
Argument Description nodeName Name of the node of interest. serverName Name of the server of interest. jmsProvider Name of the JMS provider of interest. templateID Configuration ID of the WAS queue template to use. queueName Name to assign to the new queue. jndiName JNDI name that the system uses to bind the connection factory into the name space. attributes Optionally specifies additional attributes in the following format: [["attr1", "value1"], ["attr2", "value2"]].
Syntax
AdminJMS.createWASQueueUsingTemplate(nodeName, serverName, jmsProvider, templateID, queueName, jndiName, attributes)Example usage
AdminJMS.createWASQueueUsingTemplate("myNode", "myServer", "JMSTest", "WASQueueTest", "queuejndi")AdminJMS.createWASQueueUsingTemplate("myNode", "myServer", "JMSTest", "WASQueueTest", "queuejndi", [["description", "testing"], ["persistence", "APPLICATION_DEFINED"], ["priority", "APPLICATION_DEFINED"], ["specifiedPriority", "2"]])
createWASQueueConnectionFactory
This script creates a WAS queue connection factory in the configuration. You should only use WAS JMS resources for applications that perform messaging with a WebSphere Application Server version 5.1 embedded JMSServer in a V7.0 cell. The script returns the configuration ID of the new WAS queue connection factory.
To run the script, specify the node, server, JMS provider name, name to assign to the queue connection factory, and JNDI name arguments, as defined in the following table:
Table 9. Arguments for the createWASQueueConnectionFactory script
Argument Description nodeName Name of the node of interest. serverName Name of the server of interest. jmsProvider Name of the JMS provider of interest. queueConnFactoryName Name to assign to the new WAS queue connection factory. jndiName JNDI name that the system uses to bind the connection factory into the name space. attributes Optionally specifies additional attributes in the following format: [["attr1", "value1"], ["attr2", "value2"]].
Syntax
AdminJMS.createWASQueueConnectionFactory(nodeName, serverName, jmsProvider, queueConnFactoryName, jndiName, attributes)Example usage
AdminJMS.createWASQueueConnectionFactory("myNode", "myServer", "JMSTest", "queueCFTest", "queuejndi")AdminJMS.createWASQueueConnectionFactory("myNode", "myServer", "JMSTest", "queueCFTest", "queuejndi", [["description", "testing"], ["persistence", "APPLICATION_DEFINED"], ["priority", "APPLICATION_DEFINED"], ["specifiedPriority", "2"]])
createWASQueueConnectionFactoryUsingTemplate
This script uses a template to create a WAS queue connection factory in the configuration.
You should only use WAS JMS resources for applications that perform messaging with a WebSphere Application Server version 5.1 embedded JMSServer in a V7.0 cell. The script returns the configuration ID of the new WAS queue connection factory. To run the script, specify the node, server, JMS provider name, configuration ID of the template, name to assign to the queue connection factory, and JNDI name arguments, as defined in the following table:
Table 10. Arguments for the createWASQueueConnectionFactoryUsingTemplate script
Argument Description nodeName Name of the node of interest. serverName Name of the server of interest. jmsProvider Name of the JMS provider of interest. templateID Configuration ID of the WAS queue connection factory template to use. queueConnFactoryName Name to assign to the new WAS queue connection factory. jndiName JNDI name that the system uses to bind the connection factory into the name space. attributes Optionally specifies additional attributes in the following format: [["attr1", "value1"], ["attr2", "value2"]].
Syntax
AdminJMS.createWASQueueConnectionFactoryUsingTemplate(nodeName, serverName, jmsProvider, templateID, queueConnFactoryName, jndiName, attributes)Example usage
AdminJMS.createWASQueueConnectionFactoryUsingTemplate("myNode", "myServer", "JMSTest", "Example WASQueueConnectionFactory(templates/system|JMS-resource-provider-templates.xml#WASQueueConnectionFactory_1)", "queueCFTest", "queuecfjndi")
AdminJMS.createWASQueueConnectionFactoryUsingTemplate("myNode", "myServer", "JMSTest", "Example WASQueueConnectionFactory(templates/system|JMS-resource-provider-templates.xml#WASQueueConnectionFactory_1)", "queueCFTest", "queuecfjndi", [['XAEnabled', 'true'], ['authDataAlias', 'myalias'], ['description', 'testing'], ['xaRecoveryAuthAlias', 'recoveryalias']])
createWASTopic
This script creates a WAS topic in the JMS configuration. You should only use
WAS JMS resources for applications that perform messaging with a WebSphere Application Server version 5.1 embedded JMSServer in a V7.0 cell. The script returns the configuration ID of the new WAS topic. To run the script, specify the node, server, JMS provider name, name to assign to the topic, JNDI name, and the topic arguments, as defined in the following table:
Table 11. Arguments for the createWASTopic script
Argument Description nodeName Name of the node of interest. serverName Name of the server of interest. jmsProvider Name of the JMS provider of interest. topicName Name to assign to the new topic. jndiName JNDI name that the system uses to bind the connection factory into the name space. topic Name of the topic (as a qualifier in the topic space) that this topic is to use. attributes Optionally specifies additional attributes in the following format: [["attr1", "value1"], ["attr2", "value2"]].
Syntax
AdminJMS.createWASTopic(nodeName, serverName, jmsProvider, topicName, jndiName, topic, attributes)Example usage
AdminJMS.createWASTopic("myNode", "myServer", "JMSTest", "TopicTest", "topicjndi", "mytopic")AdminJMS.createWASTopic("myNode", "myServer", "JMSTest", "TopicTest", "topicjndi", "mytopic", [["persistence", "PERSISTENT"], ["priority", "SPECIFIED"], ["description", "testing"], ["specifiedPriority", "1"]])
createWASTopicUsingTemplate
This script uses a template to create a WAS topic in the JMS configuration. You should only use WAS JMS resources for applications that perform messaging with a WebSphere Application Server version 5.1 embedded JMSServer in a V7.0 cell. The script returns the configuration ID of the new WAS topic. To run the script, specify the node, server, JMS provider name, configuration ID of the template, name to assign to the topic, JNDI name, and the topic arguments, as defined in the following table:
Table 12. Arguments for the createWASTopicUsingTemplate script
Argument Description nodeName Name of the node of interest. serverName Name of the server of interest. jmsProvider Name of the JMS provider of interest. templateID Configuration ID of the WAS topic template to use. topicName Name to assign to the new topic. jndiName JNDI name that the system uses to bind the connection factory into the name space. topic Name of the topic (as a qualifier in the topic space) that this topic is to use. attributes Optionally specifies additional attributes in the following format: [["attr1", "value1"], ["attr2", "value2"]].
Syntax
AdminJMS.createWASTopicUsingTemplate(nodeName, serverName, jmsProvider, templateID, topicName, jndiName, topic, attributes)Example usage
AdminJMS.createWASTopicUsingTemplate("myNode", "myServer", "JMSTest", "Example.JMS.WAS.T1(templates/system|JMS-resource-provider-templates.xml#WASTopic_1)", "TopicTest", "topicjndi", "mytopic")AdminJMS.createWASTopicUsingTemplate("myNode", "myServer", "JMSTest", "Example.JMS.WAS.T1(templates/system|JMS-resource-provider-templates.xml#WASTopic_1)", "TopicTest", "topicjndi", "mytopic", [["persistence", "PERSISTENT"], ["priority", "SPECIFIED"], ["description", "testing"], ["specifiedPriority", "1"]])
createWASTopicConnectionFactory
This script creates a WAS topic connection factory in the configuration. You should only use WAS JMS resources for applications that perform messaging with a WebSphere Application Server version 5.1 embedded JMSServer in a V7.0 cell. The script returns the configuration ID of the new WAS topic connection factory. To run the script, specify the node, server, JMS provider name, name to assign to the connection factory, JNDI name, and the port arguments, as defined in the following table:
Table 13. Arguments for the createWASTopicConnectionFactory script
Argument Description nodeName Name of the node of interest. serverName Name of the server of interest. jmsProviderName Name of the JMS provider of interest. topicConnFactoryName Name to assign to the new connection factory. jndiName JNDI name that the system uses to bind the connection factory into the name space. port Specify the port of interest. attributes Optionally specifies additional attributes in the following format: [["attr1", "value1"], ["attr2", "value2"]].
Syntax
AdminJMS.createWASTopicConnectionFactory(nodeName, serverName, jmsProviderName, topicConnFactoryName, jndiName, port, attributes)Example usage
AdminJMS.createWASTopicConnectionFactory("myNode", "myServer", "JMSTest", "TopicCFTest", "topiccfjndi", "DIRECT")AdminJMS.createWASTopicConnectionFactory("myNode", "myServer", "JMSTest", "TopicCFTest", "topiccfjndi", "DIRECT", [['XAEnabled', 'true'], ['authDataAlias', 'myalias'], ['authMechanismPreference', 'BASIC_PASSWORD'], ['clientID', 'myID'], ['description', 'testing'], ['cloneSupport', 'true']])
createWASTopicConnectionFactoryUsingTemplate
This script uses a template to create a WAS topic connection factory in the configuration.
You should only use WAS JMS resources for applications that perform messaging with a WAS version 5.1 embedded JMS Server in a V7.0 cell. The script returns the configuration ID of the new WAS topic connection factory. To run the script, specify the node, server, JMS provider name, configuration ID of the template, name to assign to the connection factory, JNDI name, and the port arguments, as defined in the following table:
Table 14. Arguments for the createWASTopicConnectionFactoryUsingTemplate script
Argument Description nodeName Name of the node of interest. serverName Name of the server of interest. jmsProviderName Name of the JMS provider of interest. templateID Configuration ID of the WAS topic connection factory to use. topicConnFactoryName Name to assign to the new connection factory. jndiName JNDI name that the system uses to bind the connection factory into the name space. port Port of interest. attributes Optionally specifies additional attributes in the following format: [["attr1", "value1"], ["attr2", "value2"]].
Syntax
AdminJMS.createWASTopicConnectionFactoryUsingTemplate(nodeName, serverName, jmsProviderName, templateID, topicConnFactoryName, jndiName, port, attributes)Example usage
AdminJMS.createWASTopicConnectionFactoryUsingTemplate("myNode", "myServer", "JMSTest", "First Example WASTopicConnectionFactory(templates/system|JMS-resource-provider-templates.xml#WASTopicConnectionFactory_1)", "TopicCFTest", "topiccfjndi", "DIRECT")
AdminJMS.createWASTopicConnectionFactoryUsingTemplate("myNode", "myServer", "JMSTest", "First Example WASTopicConnectionFactory(templates/system|JMS-resource-provider-templates.xml#WASTopicConnectionFactory_1)", "TopicCFTest", "topiccfjndi", "DIRECT", [['XAEnabled', 'true'], ['authDataAlias', 'myalias'], ['authMechanismPreference', 'BASIC_PASSWORD'], ['clientID', 'myID'], ['description', 'testing'], ['cloneSupport', 'true']])
startListenerPort
This script starts a listener port in the environment. The script returns a value of 1 if the system successfully starts the listener port or a value of -1 if the system does not start the listener port. To run the script, specify the node and server name arguments, as defined in the following table:
Table 15. Arguments for the startListenerPort script
Argument Description nodeName Name of the node of interest. serverName Name of the server of interest.
Syntax
AdminJMS.startListenerPort(nodeName, serverName)Example usage
AdminJMS.startListenerPort("myNode", "myServer")
Related tasks
Use the script library to automate the application serving environment
Related
JMS query scripts