WebSphere Application Server Network Deployment, Version 6.0.x     Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Configuring the message listener service using scripting

Before you begin

Before starting this task, the wsadmin tool must be running. See the Starting the wsadmin scripting client article for more information.

Why and when to perform this task

Perform the following steps to configure the message listener service for an application server:

Steps for this task

  1. Identify the application server and assign it to the server variable:
    • Using Jacl:

      set server [$AdminConfig getid /Cell:mycell/Node:mynode/Server:server1/]
    • Using Jython:
      server = AdminConfig.getid('/Cell:mycell/Node:mynode/Server:server1/')
      print server
    Example output:
    server1(cells/mycell/nodes/mynode/servers/server1|server.xml#Server_1)
  2. Identify the message listener service belonging to the server and assign it to the mls variable:
    • Using Jacl:

      set mls [$AdminConfig list MessageListenerService $server]
    • Using Jython:
      mls = AdminConfig.list('MessageListenerService', server)
      print mls
    Example output:
    (cells/mycell/nodes/mynode/servers/server1|server.xml#MessageListenerService_1)
  3. Modify various attributes with one of the following examples:
    • This example command changes the thread pool attributes:

      • Using Jacl:
        $AdminConfig modify $mls {{threadPool {{inactivityTimeout 4000} 
        {isGrowable true} {maximumSize 100} {minimumSize 25}}}}
      • Using Jython:
        AdminConfig.modify(mls, [['threadPool', [['inactivityTimeout', 4000], 
        ['isGrowable',  'true'], ['maximumSize', 100], ['minimumSize', 25]]]])
    • This example modifies the property of the first listener port:

      • Using Jacl:

        set lports [$AdminConfig showAttribute $mls listenerPorts]
        set lport [lindex $lports 0]
        $AdminConfig modify $lport {{maxRetries 2}}
      • Using Jython:
        lports = AdminConfig.showAttribute(mls, 'listenerPorts')
        cleanLports = lports[1:len(lports)-1]
        lport = cleanLports.split(" ")[0]
        AdminConfig.modify(lport, [['maxRetries', 2]])
    • This example adds a listener port:

      • Using Jacl:

        set new [$AdminConfig create ListenerPort $mls {{name my} 
        {destinationJNDIName di} {connectionFactoryJNDIName jndi/fs}}]
        $AdminConfig create StateManageable $new {{initialState START}}
        
      • Using Jython:
        new = AdminConfig.create('ListenerPort', mls, [['name', 'my'], 
        ['destinationJNDIName', 'di'], ['connectionFactoryJNDIName', 'jndi/fsi']])
        print new
        print AdminConfig.create('StateManageable', new, [['initialState', 'START']])
      Example output:
      my(cells/mycell/nodes/mynode/servers/server1:server.xml#ListenerPort_1079471940692)
      (cells/mycell/nodes/mynode/servers/server1:server.xml#StateManageable_107947182623)
  4. Save the configuration changes. See the Saving configuration changes with the wsadmin tool article for more information.
  5. In a network deployment environment only, synchronize the node. See the Synchronizing nodes with the wsadmin tool article for more information.



Related concepts
AdminConfig object for scripted administration

Related reference
Commands for the AdminConfig object

Task topic    

Terms of Use | Feedback

Last updated: Mar 17, 2005 4:28:29 AM CST
http://publib.boulder.ibm.com/infocenter/ws60help/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/txml_message.html

© Copyright IBM Corporation 2004, 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)