Monitoring the WebSphere J2C adapter polling thread in a WebSphere Process Server environment

Learn how to monitor the polling thread of a WebSphere® J2C Architecture adapter deployed in a WebSphere Process Server environment. Often, customers want to know whether or not a WebSphere Adapter is polling an EIS system in their WebSphere Process Server production environment. The use of PMI metrics, common base event, tracing, and J2C message endpoint status techniques are discussed in this tutorial. Monitoring the status of the message endpoint is a powerful technique that can be used in all adapter polling scenarios to monitor the status of the polling thread.

Samir Nasser (snasser@us.ibm.com), Senior Managing Consultant, Certified IT Specialist, IBM

Photo of Samir NasserSamir Nasser is a Senior Managing Consultant and Certified IT Specialist with the IBM Software Services for WebSphere team in Durham, North Carolina. He is currently architecting and developing SOA solutions based on the WebSphere family of products.



27 June 2012

Also available in Chinese

Before you start

This tutorial provides various ways that you can monitor the polling thread of a WebSphere Java™ 2 Connector (J2C) adapter in a WebSphere Process Server environment.

Objectives

The objectives of this tutorial are to show that:

  • You can use Performance Metrics Infrastructure (PMI) metrics to monitor the adapter polling thread only in the following scenarios:
    • The adapter is packaged and deployed with the SCA module which uses only one adapter SCA export component for that adapter type.
    • There is only one SCA module with one adapter SCA export component that uses a specific adapter type.
  • You can use J2C message endpoint monitoring in all scenarios where the adapter is packaged and deployed for inbound data processing.
  • When you monitor via common base event (CBE) and tracing, it has a negative impact on performance and should only be used tactically.

Prerequisites

To follow the steps in this tutorial, you need WebSphere Integration Developer V7 to view the SCA module code where a WebSphere J2C adapter is used. You also need an installation of WebSphere Process Server for polling thread monitoring and testing. For monitoring and testing, use the WebSphere Process Server test environment available with WebSphere Integration Developer.

System requirements

  • WebSphere Integration Developer V7
  • WebSphere Process Server V7 test environment that comes with WebSphere Integration Developer

Duration

2 hours


Introduction

The WebSphere J2C adapters enable SCA applications running in WebSphere Process Server to access and execute logic in various Enterprise Information System (EIS) systems, such as a file system and DB2. For example, the WebSphere Adapter for flat files enable SCA applications to read files from and write files to a file system. There are specialized WebSphere adapters for JDBC, SAP, and others to enable SCA applications to read from and write to other EIS systems. To configure a WebSphere adapter for flat files to read a file from a file system, the adapter is configured to poll the file system for a file that has a name matching the pattern specified in the adapter activation specification.

One of the questions that always come up is: How do I know if the adapter is polling? This may happen to be any adapter type that is configured to consume from an EIS system.

This tutorial shows you various ways to monitor whether or not the adapter is polling an EIS system in a WebSphere Process Server environment. Since this tutorial is focused on monitoring of the adapter polling thread, we will simplify the application code and the adapter environment required to test the monitoring. The simplest adapter environment is the flat file adapter environment. The other adapter types require environments that standard operating systems do not usually have.


Using the sample code

The provided project interchange file in the Download section of the tutorial contains four SCA modules and the flat file adapter connector project:

  1. FFAdapterTest1. There is one SCA flat file adapter export that is configured to poll the folder c:\FF\events for file names that have an extension of ".test1".
  2. FFAdapterTest2. There is one SCA flat file adapter export that is configured to poll the folder c:\FF\events for file names that have an extension of ".test2".
  3. FFAdapterTest3. There is one SCA flat file adapter export that is configured to use a pre-existing J2C activation specification located at jndi/FFATest3AS. The existing activation specification is configured for the adapter to poll for file names that have an extension of ".test3".
  4. FFAdapterTest4. There is one SCA flat file adapter export that is configured to use a pre-existing J2C activation specification located at jndi/FFATest4AS. The existing activation specification polls for file names that have an extension of ".test4".

The flat file adapter is deployed with FFAdapterTest1 and FFAdapterTest2. But, it is not deployed with FFAdapterTest3 or FFAdapterTest4. Rather, the flat file adapter is installed and deployed individually, but shared by both FFAdapterTest3 and FFAdapterTest4.

Functionally, all these modules are similar. At runtime, they consume a file from c:\FF\events with the right extension and archive the file in c:\FF\archive. A message will also be printed in the SystemOut.log file by the FFAdapterTest simple Java component implemented in each module. The message displayed is: "SUCCESS --> ModuleName consumed a file".

If you wish to test the code, create two folders: c:\FF\events and c:\FF\archive. These folders are configured as the event and archive directories, respectively, in the J2C activation specifications. Then, import the provided project interchange file into WebSphere Integration Developer V7.


When an adapter is deployed with the SCA module

This section discusses the monitoring option that leverages PMI metrics. The SCA modules are deployed, the adapter PMI metrics are enabled, and the adapter polling threads are monitored.

Deploying the SCA modules

Follow these steps to deploy FFAdapterTest1 and FFAdapterTest2:

  1. If not started, start the WebSphere Process Server test environment from the servers view in Integration Developer. Wait until the server has started.
  2. Right-click on the server name and click Add and Remove Projects.
  3. Select FFAdapterTest1 and FFAdapterTest2 from the Available projects, click Add then Finish.
  4. Wait until the projects are published.

When the SCA modules start, the following messages shown in Listing 1 will be logged in SystemOut.log.

Listing 1. Message endpoint activation messages
J2CA0523I: The Message Endpoint for ActivationSpec
FFAdapterTest1/FFAdapterExport_AS (com.ibm.j2ca.flatfile.FlatFileActivationSpecWithXid)
and MDB Application FFAdapterTest1App#FFAdapterTest1FFAdapterExport#FFAdapterTest1 
is activated.

J2CA0523I: The Message Endpoint for ActivationSpec
FFAdapterTest2/FFAdapterExport_AS (com.ibm.j2ca.flatfile.FlatFileActivationSpecWithXid) 
and terTest2App#FFAdapterTest2FFAdapterExport#FFAdapterTest2 is activated.

Note that if the directory c:\FF\events does not exist, the message endpoint will fail to be activated with an error logged to that effect.

Monitoring the flat file adapter polling thread

This section is applicable only when the flat file adapter is deployed with the SCA module and there is only one flat file adapter export in each SCA module. Or, when there is only one SCA module in the whole environment using one flat file adapter SCA export. You can use this technique in production for ongoing monitoring.

In this case, monitoring of the polling thread of FFAdapterTest1 and the polling thread of FFAdapterTest2 can easily be accomplished using PMI metrics. Perform the following steps to enable monitoring of the polling thread:

  1. Log in to the administrative console.
  2. In the navigation table on the left, expand Monitoring and Tuning > Performance Viewerand click Current activity.
  3. Click server1.
  4. Expand Performance Modules> WBIStats.RootGroup > ResourceAdapter. You will notice that there are two deactivated (grayed out) entries; one for FFAdapterTest1 and one for FFAdapterTest2. Expand the FFAdapterTest1 > InboundEventRetrieval. You will see an entry called "InboundEventRetrieval_Test1FFA". This module is for the polling thread associated with the flat file adapter export in the module FFAdapterTest1. The string "Test1FFA" is the assigned adapter ID deployed with FFAdapterTest1. At this point, this entry is deactivated. You need to activate it to see that the adapter polling thread is functional. The following steps will activate this entry.
  5. In the navigation table on the left, click Performance Monitoring Infratsructure (PMI).
  6. Click server1.
  7. Click the Runtime tab.
  8. Select the Custom radio button and click OK.
  9. Click server1, then the Runtime tab.
  10. Click the Custom link.
  11. Make sure the Runtime tab is in focus. Expand WBIStats.RootGroup > ResourceAdapter > com.ibm.j2c.a.resourceadapter.FFAdapterTest1 > InboundEventRetrieval. Click InboundEventRetrieval_Test1FFA. Select all metrics as shown in Figure 1 and click Enable to enable the selected metrics.
    Figure 1. Polling thread metrics
    Polling thread metrics
  12. Repeat the previous step for FFAdapterTest2.
  13. Now that the polling thread metrics are enabled, perform Steps 2 to 4 for both FFAdapterTest1 and FFAdapterTest2. You will see that WBIStats.RootGroup, ResourceAdapter, and com.ibm.j2ca.resourceadapter entries are still grayed out, but the InboundEventRetrieval entries are enabled. Click both checkboxes for InboundEventRetrieval_Test1FFA and InboundEventRetrieval_Test2FFA as shown in Figure 2 and click View Module(s). The polling thread metrics are plotted in a graph as shown in Figure 3.
    Figure 2. Polling thread entries
    Polling thread entries
    Figure 3. Polling thread metrics
    Polling thread metrics

The GoodRequests metric represents the number of successful polls. If this number stops increasing, it means the polling thread is not polling. In this case, the GoodRequests metrics for both polling threads are the same.

Note that the polling thread monitoring here can also be achieved using CBE, an adapter trace string, or the status of the J2C message endpoint.


When an adapter is not deployed with the SCA module

This section discusses the monitoring options that leverages CBE and tracing. The flat file adapter is installed, the flat file adapter activation specifications are created, the SCA modules are deployed, specific CBE and tracing are enabled, and the adapter polling threads are monitored. This section will show that monitoring using CBE and tracing cannot provide enough information to tell which polling thread is active. Additionally, these monitoring options have a negative impact on performance.

Installing the flat file adapter

Perform the following procedure to install the flat file adapter:

  1. Log in to the administrative console.
  2. In the navigation table on the left, expand Resources > Resource Adapters. Click Resource adapters.
  3. Click Install RAR.
  4. Click Browse to locate the flat file adapter RAR. Select the flat file adapter RAR and click Next. The flat file adapter RAR is shipped with WebSphere Integration Developer. The various adapter types are located in WID_Install_Folder\ResourceAdapters.
  5. Click OK and Save.
  6. Click the link of the flat file adapter just installed.
  7. Click Custom properties.
  8. Specify S_FFA for the adapterID property and save.

Creating the J2C activation specifications for FFAdapterTest3 and FFAdapterTest4

Perform the following procedure to create the activation specifications:

  1. Click the link of the flat file adapter just installed.
  2. Click J2C activation specifications.
  3. Click New.
  4. Enter FFAdapterTest3_AS for the name.
  5. Enter jndi/FFATest3AS for the JNDI name.
  6. Select com.ibm.j2ca.base.ExtendedInboundListener for the Message listener type.
  7. Click OK and Save.
  8. Click the link of the activation specification just created.
  9. Click J2C activation specification custom properties.
  10. Specify c:\FF\events for the eventDirectory property.
  11. Specify c:\FF\archive for the archiveDirectory property.
  12. Specify (FileName MatchesFilePattern *.test3) for the ruleTable property.
  13. Repeat the previous steps to create the J2C activation specification FFAdapterTest4_AS. Make sure its JNDI name is jndi/FFATest4AS, and the ruleTable property is set to (FileName MatchesFilePattern *.test4).

Deploying the SCA modules

Follow these steps to deploy FFAdapterTest3 and FFAdapterTest4:

  1. If not started, start the WebSphere Process Server test environment from the servers view in WebSphere Integration Developer. Wait until the server has started.
  2. Right-click on the server name and click Add and Remove Projects.
  3. Select FFAdapterTest3 and FFAdapterTest4 from the Available projects, click Add, and then Finish.
  4. Wait until the projects are published.

When the SCA modules start, the following messages shown in Listing 2 will be logged in SystemOut.log.

Listing 2. Message endpoint activation messages
J2CA0523I: The Message Endpoint for ActivationSpec
jndi/FFATest3AS (com.ibm.j2ca.flatfile.FlatFileActivationSpecWithXid) and
MDB Application FFAdapterTest3App#FFAdapterTest3FFAdapterExport#FFAdapterTe
st3 is activated.

J2CA0523I: The Message Endpoint for ActivationSpec
jndi/FFATest4AS (com.ibm.j2ca.flatfile.FlatFileActivationSpecWithXid) and
MDB Application FFAdapterTest4App#FFAdapterTest4FFAdapterExport#FFAdapterTe
st4 is activated.

Note that if the directory c:\FF\events does not exist, the message endpoint will fail to be activated.

Monitoring the flat file adapter polling thread

Note that the technique described here should be used tactically and with caution, particularly in a production environment.

In this case, monitoring of the polling thread of FFAdapterTest3 and the polling thread of FFAdapterTest4 cannot be accomplished using PMI metrics. Perform the following steps to understand why:

  1. Log in to the administrative console.
  2. In the navigation table on the left, expand Monitoring and Tuning > Performance Viewer and click Performance Monitoring Infrastructure (PMI).
  3. Click server1.
  4. Click the Runtime tab.
  5. Click the Custom link.
  6. Make sure the Runtime tab is in focus. Expand WBIStats.RootGroup > ResourceAdapter > com.ibm.j2c.a.resourceadapter.wps_wbiserver > InboundEventRetrieval. Note that you will see three entries under InboundEventRetrieval: InboundEventRetrieval_Test1FFA, InboundEventRetrieval_Test2FFA, and InboundEventRetrieval_S_FFA, where S_FFA that is appended to the last entry is the default adapter ID you installed earlier.

    Using the PMI metrics associated with this adapter ID will not give you monitoring granularity as to which module FFAdapterTest3 or FFAdapterTest4 is actually polling. If there is only one SCA module with one adapter export used in this environment, then using PMI metrics to monitor the adapter polling thread will work because there is only one polling thread that is associated with the only adapter export. So, how do you monitor the polling thread when the adapter is not deployed with the SCA module, and you have more than one SCA module sharing the same adapter deployment? Similarly, how do you monitor the polling thread for an adapter deployed with the SCA module that has more than one adapter export? Perform the following steps for a limited monitoring technique.

  7. In the navigation table of the administrative console, expand Troubleshooting and click Logs and trace.
  8. Click server1.
  9. Click Change Log Detail Levels.
  10. Click the Runtime tab.
  11. Expand * > WBIEventMonitor.LOG.ResourceAdapter.*.
  12. Click WBIEventMonitor.LOG.ResourceAdapter.Polling.*. Click Message and Trace Levels and click level fine. This setting turns on the start and stop CBE events of the polling thread.
  13. Restart FFAdapterTest3 and FFAdapterTest4. This step is needed because the start event of the polling thread had already occurred. When the modules restart, the stop event of the polling thread occurs first followed by the start event.
  14. Note the messages shown in Listing 3 are logged in the SystemOut.log file. Listing 3 shows the stop event followed by the start event for the FFAdapterTest4 polling thread. The same thing occurs for FFAdapterTest3. Note that when the polling thread stops, the message endpoint is deactivated. When the polling thread starts, the message endpoint is activated.
    Listing 3. Polling thread monitoring

    Click to see code listing

    Listing 3. Polling thread monitoring

    [5/24/12 19:57:05:984 EDT] 00000047 STOPPED       I   
    <CommonBaseEvent creationTime="2012-05-24T23:57:05.984Z"
    extensionName="WBI.JCAAdapter.Polling.STOPPED"
    severity="10" version="1.0.1"><contextDataElements
    name="ECSCurrentID"
    type="string"><contextValue>com.ibm.websphere.CorrelationSp
    here.implicit</contextValue></contextDataElements><contextD
    ataElements name="ECSParentID"
    type="string"></contextDataElements><contextDataElements
    name="WBISESSION_ID"
    type="string"><contextValue>UNKNOWN</contextValue></context
    DataElements><extendedDataElements name="EventNature"
    type="string"><values>STOPPED</values></extendedDataElement
    s><extendedDataElements name="PayloadType"
    type="string"><values>empty</values></extendedDataElements>
    <sourceComponentId component="WPS#[SCA 1.0.1.9
    cf091048.02]Platform 7.0.0.13 [ND 7.0.0.13 cf131039.07][WBI
    7.0.0.3 of1034.05][WXS 7.1.0.0 a1025.57350][XML 1.0.0.7
    cf071033.05]" componentIdType="Component Kind QName"
    executionEnvironment="Windows XP[x86]#5.1 build 2600
    Service Pack 3" instanceId="IBM-02BE93E63E4Node01Cell\IBM-
    02BE93E63E4Node01\server1" location="IBM-02BE93E63E4"
    locationType="Hostname" processId="2832"
    subComponent="{http://www.ibm.com/j2ca/ResourceAdapter}wps.wbiserver.Polling_S_FFA" threadId="WebContainer : 2"
    componentType="{http://www.ibm.com/xmlns/prod/websphere/scd
    l/eis/6.0.0}JCAAdapter"/><situation
    categoryName="ReportSituation"><situationType
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:type="ReportSituation" reasoningScope="EXTERNAL"
    reportCategory="STATUS"/></situation></CommonBaseEvent>
    [5/24/12 19:57:05:984 EDT] 00000047 ActivationSpe I   
    J2CA0524I: The Message Endpoint for ActivationSpec
    jndi/FFATest4AS
    (com.ibm.j2ca.flatfile.FlatFileActivationSpecWithXid) and
    MDB Application
    FFAdapterTest4App#FFAdapterTest4FFAdapterExport#FFAdapterTe
    st4 is deactivated.
    
    [5/24/12 19:57:27:171 EDT] 00000047 STARTED       I   
    <CommonBaseEvent creationTime="2012-05-24T23:57:27.171Z"
    extensionName="WBI.JCAAdapter.Polling.STARTED"
    severity="10" version="1.0.1"><contextDataElements
    name="ECSCurrentID"
    type="string"><contextValue>com.ibm.websphere.CorrelationSp
    here.implicit</contextValue></contextDataElements><contextD
    ataElements name="ECSParentID"
    type="string"></contextDataElements><contextDataElements
    name="WBISESSION_ID"
    type="string"><contextValue>UNKNOWN</contextValue></context
    DataElements><extendedDataElements name="EventNature"
    type="string"><values>STARTED</values></extendedDataElement
    s><extendedDataElements name="PayloadType"
    type="string"><values>empty</values></extendedDataElements>
    <extendedDataElements name="PollQuantity"
    type="int"><values>10</values></extendedDataElements>
    <extendedDataElements name="PollFrequency"
    type="int"><values>2000</values></extendedDataElements>
    <sourceComponentId component="WPS#[SCA 1.0.1.9
    cf091048.02]Platform 7.0.0.13 [ND 7.0.0.13 cf131039.07][WBI
    7.0.0.3 of1034.05][WXS 7.1.0.0 a1025.57350][XML 1.0.0.7
    cf071033.05]" componentIdType="Component Kind QName"
    executionEnvironment="Windows XP[x86]#5.1 build 2600
    Service Pack 3" instanceId="IBM-02BE93E63E4Node01Cell\IBM-
    02BE93E63E4Node01\server1" location="IBM-02BE93E63E4"
    locationType="Hostname" processId="2832"
    subComponent="{http://www.ibm.com/j2ca/ResourceAdapter}wps.wbiserver.Polling_S_FFA" threadId="WebContainer : 2"
    componentType="{http://www.ibm.com/xmlns/prod/websphere/scd
    l/eis/6.0.0}JCAAdapter"/><situation
    categoryName="ReportSituation"><situationType
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:type="ReportSituation" reasoningScope="EXTERNAL"
    reportCategory="STATUS"/></situation></CommonBaseEvent>
    [5/24/12 19:57:27:171 EDT] 00000047 ActivationSpe I 
    J2CA0523I: The Message Endpoint for ActivationSpec
    jndi/FFATest4AS
    (com.ibm.j2ca.flatfile.FlatFileActivationSpecWithXid) and
    MDB Application
    FFAdapterTest4App#FFAdapterTest4FFAdapterExport#FFAdapterTe
    st4 is activated.

If you follow Steps 7 to 10 above, you can use another trace setting to lead to the same results. The trace setting is:

WBILocationMonitor.LOG.ResourceAdapter.com.ibm.j2ca.
 resourceadapter.wps_wbiserver.Polling.*

However, you can expand this trace setting further to give more granular control over which adapter polling start or stop event is to capture.

The trace settings specified so far will only capture the start and stop event of the polling thread. Then, how do you capture the polling event that occurs periodically when the polling thread polls the file system for certain files? To capture this event, specify the following trace setting:

com.ibm.j2ca.FFRAS_FFA=fine

You get this trace setting by expanding com.ibm.j2ca.* and setting the com.ibm.j2ca.FFRAS_FFA trace level to fine. Listing 4 shows the polling events for the S_FFA adapter.

Listing 4. Polling event
[5/25/12 11:44:18:921 EDT] 00000050 FFRAS_FFA     1
com.ibm.j2ca.extension.eventmanagement.internal.WorkControl
ler submitWork(Work) Submitting work to WorkManager:
PollThread [state: started, polling:
com.ibm.j2ca.extension.eventmanagement.internal.EventManage
r@23be23be]
[5/25/12 11:44:18:921 EDT] 00000050 FFRAS_FFA     1
com.ibm.j2ca.extension.eventmanagement.internal.WorkControl
ler submitWork(Work) Successfully submitted work to
WorkManager: PollThread [state: started, polling:
com.ibm.j2ca.extension.eventmanagement.internal.EventManage
r@23be23be]
[5/25/12 11:44:19:796 EDT] 00000051 FFRAS_FFA     1
com.ibm.j2ca.extension.eventmanagement.internal.WorkControl
ler submitWork(Work) Submitting work to WorkManager:
PollThread [state: started, polling:
com.ibm.j2ca.extension.eventmanagement.internal.EventManage
r@2ed32ed3]
[5/25/12 11:44:19:796 EDT] 00000051 FFRAS_FFA     1
com.ibm.j2ca.extension.eventmanagement.internal.WorkControl
ler submitWork(Work) Successfully submitted work to
WorkManager: PollThread [state: started, polling:
com.ibm.j2ca.extension.eventmanagement.internal.EventManage
r@2ed32ed3]

As shown in Listing 4, you can see there are two threads, in blue, used to poll the file system. However, you cannot tell which thread belongs to which activation specification.

Specifying the following trace settings will only give one thread, no matter how many SCA modules are sharing the same adapter to consume the files.

WBIEventMonitor.LOG.ResourceAdapter.InboundEventRetrieval.
 *=fine
WBILocationMonitor.LOG.ResourceAdapter.com.ibm.j2ca.
 resourceadapter.wps_wbiserver.InboundEventRetrieval.*=fine

So, how do you know if a polling thread is actually polling in this case? This is discussed in the next section.


Monitoring the J2C message endpoint

This section is applicable to all adapter polling scenarios and all adapter types, such as flat file, FTP, JDBC, and SAP. This is an effective technique that you can use in production for ongoing monitoring.

This section describes a technique to monitor the polling thread of any adapter. The technique involves checking the status of the message endpoint associated with an activation specification. Perform the following procedure to monitor the polling thread:

  1. Open a command window.
  2. Change the directory to where the wsadmin command of the test environment is located.
  3. Enter wsadmin –lang jython.
  4. Once at the wsadmin prompt, enter AdminControl.queryNames("*:type=J2CMessageEndpoint,*"). This dumps the names of all the J2C message endpoints.
  5. Find the name of the message endpoint associated with the adapter export that you want to monitor its polling thread. In this case, get the name of the message endpoint associated with the adapter export used in FFAdapterTest3.
  6. Enter:
    objectName=AdminControl.queryNames("*:name=FFAdapterTest3App
      #FFAdapterTest3FFAdapterExport#FFAdapterTest3_J2CMessageEndpoint,*")

    This command stores the name of the message endpoint in the objectName variable.

  7. Enter AdminControl.invoke(objectName, 'getStatus'). This returns "1", which means the message endpoint is active.
  8. Enter AdminControl.invoke(objectName, 'pause'). This deactivates the message endpoint and therefore, the polling thread. Once this command is executed, the log messages shown in Listing 5 can be seen in the SystemOut.log file. The CBE start or stop event will only be logged if it had been turned on as described previously.
    Listing 5. Deactivating a message endpoint
    [5/25/12 23:39:28:718 EDT] 00000061 STOPPED       I   
    <CommonBaseEvent creationTime="2012-05-26T03:39:28.703Z"
    extensionName="WBI.JCAAdapter.Polling.STOPPED"
    severity="10" version="1.0.1"><contextDataElements
    name="ECSCurrentID"
    type="string"><contextValue>com.ibm.websphere.CorrelationSp
    here.implicit</contextValue></contextDataElements><contextD
    ataElements name="ECSParentID"
    type="string"></contextDataElements><contextDataElements
    name="WBISESSION_ID"
    type="string"><contextValue>UNKNOWN</contextValue></context
    DataElements><extendedDataElements name="EventNature"
    type="string"><values>STOPPED</values></extendedDataElement
    s><extendedDataElements name="PayloadType"
    type="string"><values>empty</values></extendedDataElements>
    <sourceComponentId component="WPS#[SCA 1.0.1.9
    cf091048.02]Platform 7.0.0.13 [ND 7.0.0.13 cf131039.07][WBI
    7.0.0.3 of1034.05][WXS 7.1.0.0 a1025.57350][XML 1.0.0.7
    cf071033.05]" componentIdType="Component Kind QName"
    executionEnvironment="Windows XP[x86]#5.1 build 2600
    Service Pack 3" instanceId="IBM-02BE93E63E4Node01Cell\IBM-
    02BE93E63E4Node01\server1" location="192.168.1.145"
    locationType="Hostname" processId="9976"
    subComponent="{http://www.ibm.com/j2ca/ResourceAdapter}wps.
    wbiserver.Polling_S_FFA" threadId="SoapConnectorThreadPool
    : 4"
    componentType="{http://www.ibm.com/xmlns/prod/websphere/scd
    l/eis/6.0.0}JCAAdapter"/><situation
    categoryName="ReportSituation"><situationType
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:type="ReportSituation" reasoningScope="EXTERNAL"
    reportCategory="STATUS"/></situation></CommonBaseEvent>
    [5/25/12 23:39:28:734 EDT] 00000061 ActivationSpe I  
    J2CA0524I: The Message Endpoint for ActivationSpec
    jndi/FFATest3AS
    (com.ibm.j2ca.flatfile.FlatFileActivationSpecWithXid) and
    MDB Application
    FFAdapterTest3App#FFAdapterTest3FFAdapterExport#FFAdapterTe
    st3 is deactivated.

    Now, if you drop a file that has a name with an extension ".test3" in the c:\FF\events folder, it will not be picked up.

  9. Enter AdminControl.invoke(objectName, 'getStatus'). This returns "2", which means the message endpoint is inactive.
  10. Enter AdminControl.invoke(objectName, 'resume'). This actually starts the polling thread and activates the message endpoint. Once this command is executed, the log messages shown in Listing 6 can be seen in the SystemOut.log file.
    Listing 6. Activating a message endpoint
    [5/25/12 23:44:10:062 EDT] 0000005d STARTED       I   
    <CommonBaseEvent creationTime="2012-05-26T03:44:10.062Z"
    extensionName="WBI.JCAAdapter.Polling.STARTED"
    severity="10" version="1.0.1"><contextDataElements
    name="ECSCurrentID"
    type="string"><contextValue>com.ibm.websphere.CorrelationSp
    here.implicit</contextValue></contextDataElements><contextD
    ataElements name="ECSParentID"
    type="string"></contextDataElements><contextDataElements
    name="WBISESSION_ID"
    type="string"><contextValue>UNKNOWN</contextValue></context
    DataElements><extendedDataElements name="EventNature"
    type="string"><values>STARTED</values></extendedDataElement
    s><extendedDataElements name="PayloadType"
    type="string"><values>empty</values></extendedDataElements>
    <extendedDataElements name="PollQuantity"
    type="int"><values>10</values></extendedDataElements><exten
    dedDataElements name="PollFrequency"
    type="int"><values>2000</values></extendedDataElements><sou
    rceComponentId component="WPS#[SCA 1.0.1.9
    cf091048.02]Platform 7.0.0.13 [ND 7.0.0.13 cf131039.07][WBI
    7.0.0.3 of1034.05][WXS 7.1.0.0 a1025.57350][XML 1.0.0.7
    cf071033.05]" componentIdType="Component Kind QName"
    executionEnvironment="Windows XP[x86]#5.1 build 2600
    Service Pack 3" instanceId="IBM-02BE93E63E4Node01Cell\IBM-
    02BE93E63E4Node01\server1" location="192.168.1.145"
    locationType="Hostname" processId="9976"
    subComponent="{http://www.ibm.com/j2ca/ResourceAdapter}wps.
    wbiserver.Polling_S_FFA" threadId="SoapConnectorThreadPool
    : 1"
    componentType="{http://www.ibm.com/xmlns/prod/websphere/scd
    l/eis/6.0.0}JCAAdapter"/><situation
    categoryName="ReportSituation"><situationType
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:type="ReportSituation" reasoningScope="EXTERNAL"
    reportCategory="STATUS"/></situation></CommonBaseEvent>
    [5/25/12 23:44:10:062 EDT] 0000005d ActivationSpe I   
    J2CA0523I: The Message Endpoint for ActivationSpec
    jndi/FFATest3AS
    (com.ibm.j2ca.flatfile.FlatFileActivationSpecWithXid) and
    MDB Application
    FFAdapterTest3App#FFAdapterTest3FFAdapterExport#FFAdapterTe
    st3 is activated.

    If you had dropped a file that has a name with an extension ".test3", the file will now be processed.

  11. Enter AdminControl.invoke(objectName, 'getStatus'). This returns "1", which means the message endpoint is now active again.

You can now incorporate the command "AdminControl.invoke(objectName, 'getStatus')" in a script to perform a periodic check on the status of the J2C message endpoint, and therefore, on the corresponding polling thread. If the status is not "1" (active), an error message in the SystemOut.log file indicates the reason why the message endpoint was not activated.


Conclusion

This tutorial provided various ways to monitor the polling thread of a WebSphere adapter in a WebSphere Process Server environment. You learned that:

  • When you use PMI metrics, you can monitor the adapter polling thread. Additionally, other information such as polling response time is available.
  • When you cannot use PMI metrics, monitoring via CBE and tracing does not provide enough information to tell which polling thread is active. This has a negative impact on performance and should only be used tactically in a production environment.
  • J2C message endpoint monitoring is a powerful technique to monitor the adapter polling thread and listener thread (SAP adapter case) in all adapter scenarios, where the adapter is used to consume data from EIS systems.

Download

DescriptionNameSize
PI samplePI_Final.zip1,666KB

Resources

Learn

Discuss

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into WebSphere on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere
ArticleID=822883
ArticleTitle=Monitoring the WebSphere J2C adapter polling thread in a WebSphere Process Server environment
publish-date=06272012