+

Search Tips   |   Advanced Search

Set the message listener service using scripting


Use scripting to configure the message listener service.

Before starting this task, wsadmin must be running. See the Start wsadmin article for more information.

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

 

  1. Identify the appserver and assign it to the server variable:

    • Jacl...

      set server [$AdminConfig getid /Cell:mycell/Node:mynode/Server:server1/]
    • Jython...

      server = AdminConfig.getid('/Cell:mycell/Node:mynode/Server:server1/') print server

    For example...

    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:

    • Jacl...

      set mls [$AdminConfig list MessageListenerService $server]
    • Jython...

      mls = AdminConfig.list('MessageListenerService', server) print mls

    For example...

    (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:

      • Jacl...

        $AdminConfig modify $mls {{threadPool {{inactivityTimeout 4000} {isGrowable true} {maximumSize 100} {minimumSize 25}}}}
      • Jython...

        AdminConfig.modify(mls, [['threadPool', [['inactivityTimeout', 4000], ['isGrowable', 'true'], ['maximumSize', 100], ['minimumSize', 25]]]])

    • This example modifies the property of the first listener port:

      • Jacl...

        set lports [$AdminConfig showAttribute $mls listenerPorts] set lport [lindex $lports 0]
        $AdminConfig modify $lport {{maxRetries 2}}
      • 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:

      • Jacl...

        set new [$AdminConfig create ListenerPort $mls {{name my} {destinationJNDIName di} {connectionFactoryJNDIName jndi/fs}}]
        $AdminConfig create StateManageable $new {{initialState START}}
      • Jython...

        new = AdminConfig.create('ListenerPort', mls, [['name', 'my'], ['destinationJNDIName', 'di'], ['connectionFactoryJNDIName', 'jndi/fsi']]) print new print AdminConfig.create('StateManageable', new, [['initialState', 'START']])

      For example...

      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 wsadmin article for more information.

  5. 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