Managing the message endpoint lifecycle using wsadmin scripting

Use the Jython scripting language to manage your message endpoints with the wsadmin tool. Use this topic to query your configuration for message endpoint properties and to deactivate or reactivate a message endpoint.

About this task

The Java™ EE Connector Architecture (JCA) allows the application server to link inbound requests from messaging resource adapters to message endpoints. The message endpoint managed bean (MBean) is a Java Management Extensions (JMX) framework MBean that the application server associates with a message endpoint instance.

Use this topic to manage situations where messaging providers fail to deliver messages to their intended destinations. For example, a provider might fail to deliver messages to a message endpoint when its underlying Message Driven Bean attempts to commit transactions against a database server that is not responding. To troubleshoot the problem, use the wsadmin tool to temporarily disable the message endpoint from handling messages. After troubleshooting the issue, use the wsadmin tool to reactivate the message endpoint.

Also use this topic if you are connecting to WebSphere® MQ and you have used the WAS_EndpointInitialState custom property in the activation specification to make a message endpoint start out in a deactivated state. Use the wsadmin tool when you are ready to activate the message endpoint.

The steps in this topic display how to use the AdminControl object and the wsadmin tool to invoke a Message Endpoint MBean to:
  • Display properties of the a message endpoint
  • Temporarily deactivate a message endpoint
  • Reactivate a message endpoint
  • Query the status of the message endpoint
For transitioning users: Starting in Version 7.0, you can use the AdminControl object and the wsadmin tool to deactivate message endpoints to pause the endpoints from receiving messages, and to reactivate message endpoints to resume message handling. If you are connecting to WebSphere MQ, you can also use the WAS_EndpointInitialState custom property in the WebSphere MQ messaging provider activation specification to make a message endpoint start out in a deactivated state. Previously, the application server only activated and deactivated message endpoints when the application or resource adapter was started and stopped.

Procedure

  • Display properties of a message endpoint.
    Use the queryNames command to display a list of all message endpoints in your configuration:
    AdminControl.queryNames('*:type=J2CMessageEndpoint,*')
    For the previous example, the command returns the following information for the JMSMDB_MessageEndpoint:
    WebSphere:name=JMSMDB_J2CMessageEndpoint,
    process=myServer,
    platform=dynamicproxy,
    cell=myNode01Cell,
    node=myNode01,
    version=6.1.0.0,
    type=J2CMessageEndpoint,
    mbeanIdentifier=cells/myNode01Cell/nodes/myNode01/servers/myServer/resources.xml#example#example.jar#JMSMDB_J2CMessageEndpoint,
    spec=1.0,
    Server=server1,
    diagnosticProvider=false,
    j2eeType=JCAMessageEndpoint,
    J2EEApplication=example
    J2EEServer=myServer,
    J2CResourceAdapter=SIB JMS Resource Adapter,
    MessageDrivenBean=example#example.jar#JMSMDBActivationSpec=3727AS1
  • Temporarily deactivate the message endpoint.
    Use the following commands to cache the instance and deactivate the message endpoint:
    objectName=AdminControl.queryNames('*:name=JMSMDB_MessageEndpoint,*') 
    AdminControl.invoke(objectName, 'pause')
    The command returns the following output:
    Message Endpoint JMSMDB_J2CMessageEndpoint is deactivated
  • Reactivate the message endpoint or activate a message endpoint that started out in a deactivated state.
    Use the following commands to cache the instance and reactivate the message endpoint:
    objectName=AdminControl.queryNames('*:name=JMSMDB_MessageEndpoint,*') 
    AdminControl.invoke(objectName, 'resume')
    The command returns the following output:
    Message Endpoint JMSMDB_J2CMessageEndpoint is activated
  • Query the status of the message endpoint.

    Use the following commands to cache the instance and query the status of the message endpoint:

    objectName=AdminControl.queryNames('*:name=JMSMDB_MessageEndpoint,*') 
    AdminControl.invoke(objectName, 'getStatus')

    The command returns the status of 1 if the message endpoint is running and 2 if the message endpoint is paused.