ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Monitoring Event - Capturing Payload

Post new topic  Reply to topic Goto page 1, 2  Next
 Monitoring Event - Capturing Payload « View previous topic :: View next topic » 
Author Message
mqxplorer
PostPosted: Wed Dec 01, 2010 7:57 am    Post subject: Monitoring Event - Capturing Payload Reply with quote

Master

Joined: 22 Jun 2009
Posts: 206

Hi All,

We are using the monitoring event feature in WMB V7 for auditing purposes. We have developed an auidt flow which picks up the auidt events from the subscribed queue, captures the 'eventPointData' and 'applicationData (some of the unique fileds in a message)' and write them into database. We have never captured the pay load. We have a new requirement where we need to capture the payload. To capture the payload, instead of selecting the check box against "include bitstream data in payload", Would it be possible to specify the XPath expression as $Root/XMLNSC at Data location in the Event Payload section? Is this allowed?

Thanks
mqxplorer
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed Dec 01, 2010 9:57 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

The requirment to capture payloads might not be totally achievable.
AFAIK, Not all InputNodes (& replyNodes) events emit the payloads.

Thr WMQ Nodes to but the HTTP based ones (well, at least the SOAP ones) don't.
I looked into doing this very thing (capturing the payload and putting into a DB) but gave up then I found that most of the Input nodes we use don't emit the payload data.

I'd like to be proven wrong here though.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
mqxplorer
PostPosted: Wed Dec 01, 2010 12:55 pm    Post subject: Reply with quote

Master

Joined: 22 Jun 2009
Posts: 206

Quote:
Not all InputNodes (& replyNodes) events emit the payloads.


As not all the Input nodes emit the payloads, we cannot use the provided option selecting the check box against "include bitstream data in payload" for the payloads. Would it be possible to specify the XPath expression as $Root/XMLNSC at Data location in the Event Payload section so that we can capture the payload once this is emiited as a complex element in auidt event? Is this allowed?

Thanks
mqxplorer
Back to top
View user's profile Send private message
seeknee
PostPosted: Wed Dec 01, 2010 1:10 pm    Post subject: Reply with quote

Apprentice

Joined: 08 Aug 2002
Posts: 41
Location: Melbourne, Australia

Hi

As far as I am aware you can do this, try $Body on the MQInput.transaction.Start

When I did the events I used a monitoring profile which is much easier and can be changed externally to the Message flow without having to redeploy.

Not sure if you have read this article but it helped me when I was doing this.

http://www.ibm.com/developerworks/websphere/library/techarticles/0911_fan/0911_fan.html

Hopefully this helps
_________________
IBM Certified Specialist MQSeries
IBM Certified Specialist WebSphere MQ Integrator
IBM Certified Solution Designer WebSphere Business Integration Message Broker V5

"Good judgement comes from experience, and experience comes from poor judgement"
Back to top
View user's profile Send private message
mqxplorer
PostPosted: Thu Dec 09, 2010 1:00 pm    Post subject: Reply with quote

Master

Joined: 22 Jun 2009
Posts: 206

I am trying to use the "Include bitstream data in payload" option to capture the message on MQInput input and MQOutput nodes. After selecting the "Include bitstream data in payload" on the AddEvent popup - we can see two options - 1) Content with drop down list items "Headers", "Body", and "All" and 2) Encoding with drop down list items "CDATA", "hexaBinary", "base64Binary" - These we can see on the MQInput node. I thought I woulkd have the same options on the MQOuput node as they are a node pair. However, I could see the two optionns as below:

1) Content with drop down list item "All" and 2) Encoding with drop down list items "CDATA", "hexaBinary", "base64Binary"

When we have the option to select the Body/Headers/All on the Content selection on the MQInput node, don't we have to have the same options on the MQOutput node?

Is it going to come as a fix in the next fixpack or this is how how it will be in the future also?

Please throw some light on this as we are trying to capture the payload emitted and insert into a database.

As smdavies99 mentioned not all nodes are emitting payloads..Is this a bug in the product?

Any suggestions would be really appreciated.

Thanks
mqxplorer
Back to top
View user's profile Send private message
bsiggers
PostPosted: Thu Dec 09, 2010 3:49 pm    Post subject: Monitoring Event - Capturing Payload Reply with quote

Acolyte

Joined: 09 Dec 2010
Posts: 53
Location: Vancouver, BC

Interesting - we're thinking of setting up the same kind of auditing. In the link that seeknee sent out (which is very good, by the way), I did notice in their example they are only capturing the full message payload from the MQInput, *not* the MQOutput... but they don't explain why. So, mqxplorer, you may be right.

Does anybody have a list of input nodes where capturing the full payload *is* supported, besides MQ? If HTTP doesn't work, I am thinking that probably FileInput doesn't either, which will be a pain.

Our thoughtful developers have decided not to put any kind of logging or auditing into the code, so was hoping that this would provide a workaround so that we'd have some visibility into what's going on in these flows.
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Dec 10, 2010 3:10 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Comments noted.

The restrictions on bit stream capture were imposed for good reasons, but the restrictions could probably be removed if there was enough demand. I suggest that people raise formal requirements with IBM if the $Body workaround ( mentioned above ) is not sufficient.
Back to top
View user's profile Send private message
mqxplorer
PostPosted: Fri Dec 17, 2010 2:17 pm    Post subject: Reply with quote

Master

Joined: 22 Jun 2009
Posts: 206

Hi Kimbert and All,

I have developed the code to capture some of the key data elements of the incoming message. I am trying to implement the logic to capture the payload using the $Body. The below is the audit event generated from one of my flows.

Code:
<wmb:event xmlns:wmb="http://www.ibm.com/xmlns/prod/websphere/messagebroker/6.1.0/monitoring/event">
   <wmb:eventPointData>
      <wmb:eventData wmb:productVersion="7001" wmb:eventSchemaVersion="6.1.0.3" wmb:eventSourceAddress="MQ_AUDIT_POC_IN.transaction.Start">
         <wmb:eventIdentity wmb:eventName="FlowStart"/>
         <wmb:eventSequence wmb:creationTime="2010-12-10T17:19:05.807Z" wmb:counter="1"/>
         <wmb:eventCorrelation wmb:localTransactionId="f767bcb1-3de3-4a14-a45a-14c5b6c1b9d0-2" wmb:parentTransactionId="" wmb:globalTransactionId=""/>
      </wmb:eventData>
      <wmb:messageFlowData>
         <wmb:broker wmb:name="MB7BROKER" wmb:UUID="63ded7aa-e5d7-4e18-acf0-e24eff47f9e7"/>
         <wmb:executionGroup wmb:name="default" wmb:UUID="e1d19709-2c01-0000-0080-fc981634d409"/>
         <wmb:messageFlow wmb:uniqueFlowName="MB7BROKER.default.Interface.MF_MQ_Audit_POC" wmb:name="Interface.MF_MQ_Audit_POC" wmb:UUID="4ba5f0cc-2c01-0000-0080-d12e4f62fbdd" wmb:threadId="4132"/>
         <wmb:node wmb:nodeLabel="MQ_AUDIT_POC_IN" wmb:nodeType="ComIbmMQInputNode" wmb:detail="MQ_AUDIT_POC_IN"/>
      </wmb:messageFlowData>
   </wmb:eventPointData>
   <wmb:applicationData>
      <wmb:simpleContent wmb:name="POSITION_NBR" wmb:value="12345" wmb:dataType="string"/>
      <wmb:complexContent wmb:elementName="XMLNSC">
         <XMLNSC>
            <TEST_MSG TransId="XYZ.TO.00000000" TransType="1">
               <MsgData>
                  <Transaction>
                     <TEST_WRK class="R">
                        <POSITION_NBR>12345</POSITION_NBR>
                        <JOB_REQ_NBR>12</JOB_REQ_NBR>
                        <STATUS_DT>1999-05-31T13:20:00.000-05:00</STATUS_DT>
                        <STATUS_CODE>U</STATUS_CODE>
                        <DTTM_STAMP>1999-05-31T13:20:00.000-05:00</DTTM_STAMP>
                        <OPRID>1</OPRID>
                        <OPRDEFNDESC>1</OPRDEFNDESC>
                        <LOCATION_NAME>C</LOCATION_NAME>
                     </TEST_WRK>
                  </Transaction>
               </MsgData>
            </TEST_MSG>
         </XMLNSC>
      </wmb:complexContent>
   </wmb:applicationData>
</wmb:event>


I have the below function to Find the Names and Values of the elements and put it in the Environment and payload in OutputLocalEnvironment.

Code:
-- Find the Names and Values of the elements and put it in the Environment
   CREATE PROCEDURE ContentCount(IN contentRef REFERENCE) BEGIN
      DECLARE I INTEGER 1;
      
      DECLARE N INTEGER;
      DECLARE M INTEGER;
      DECLARE contentVal CHARACTER FIELDVALUE(contentRef.(XMLNSC.Attribute)xmlns);
      IF contentVal IS NULL THEN
         MOVE contentRef FIRSTCHILD;
      ELSE
         MOVE contentRef FIRSTCHILD;
         MOVE contentRef NEXTSIBLING;
      END IF;
      
      WHILE LASTMOVE(contentRef) DO
         IF FIELDNAME(contentRef) = 'simpleContent' THEN
            SET Environment.Content[I].name   =   contentRef.ns:name;
            SET Environment.Content[I].value   =   contentRef.ns:value;
         ELSEIF FIELDNAME(contentRef) = 'complexContent' THEN
            SET Environment.Content[I].name   =   contentRef.ns:elementName;
            IF Environment.Content[I].name IN ('XMLNSC', 'SOAP', 'MRM') THEN
                SET M = M + 1;
                SET OutputLocalEnvironment.PayLoad = contentRef.*[<];
             END IF;
            SET Environment.Content[I].value   =   COALESCE(contentRef.*[<], '');
         END IF;
         SET I = I + 1;
         MOVE contentRef NEXTSIBLING;
      END WHILE;
      MOVE contentRef PARENT;
   END;


When I am trying to put the XML tree poulated in the OutputlocalEnvironment to database of coulmn type 'ntext', it is not not inserting anything.

As this is not working the way I expected, I am thinking a way to PARSE the message payload which is "contentRef.*[<]" in my coe above. If I can put it in the OutputRoot using the CREATE statement with PARSE clause, I can CAST the OutputRoot as text and put it in the database. However, if the domain is MRM, the PARSE caluse expects a messageset, messagetype and format which I do not have as I am capturing only the body.

Please suggest me to form an output tree from the content "contentRef.*[<]" which is the body in the audit event.

Any help/suggestion would be really appreciated.

Thanks
mqxplorer
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Dec 17, 2010 3:40 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
When I am trying to put the XML tree poulated in the OutputlocalEnvironment to database of coulmn type 'ntext', it is not not inserting anything.
Shame. And we can't provide any help because we don't know how you tried to do it, or what happened.

Quote:
As this is not working the way I expected, I am thinking a way to PARSE the message payload which is "contentRef.*[<]" in my coe above. If I can put it in the OutputRoot using the CREATE statement with PARSE clause, I can CAST the OutputRoot as text and put it in the database. However, if the domain is MRM, the PARSE caluse expects a messageset, messagetype and format which I do not have as I am capturing only the body.
Let me check that I understand this correctly, because it sounds fairly strange:
- Flow1 uses MRM to parse the message body and create a message tree
- Flow1 emits a monitoring event containing several fields plus the entire message body
- Flow2 wants to put the info from the monitoring event into a DB. You tried to take the values from the monitoring event and put them into the DB. That sounds quite sane.
- That didn't work, so you are trying to re-parse the message body in Flow2 and re-extract the values that were already extracted in Flow1. That sounds absolutely crazy.
Quote:
Please suggest me to form an output tree from the content "contentRef.*[<]" which is the body in the audit event.
I have a better suggestion. How about finding out why your first approach didn't work?
Back to top
View user's profile Send private message
mqxplorer
PostPosted: Sat Dec 18, 2010 7:03 am    Post subject: Reply with quote

Master

Joined: 22 Jun 2009
Posts: 206

Hi Kimbert,

Thanks for your reply.

Quote:
I have a better suggestion. How about finding out why your first approach didn't work?


Let me try this...

Thanks
mqxplorer
Back to top
View user's profile Send private message
mqxplorer
PostPosted: Mon Dec 20, 2010 7:18 am    Post subject: Reply with quote

Master

Joined: 22 Jun 2009
Posts: 206

Hi Kimbert,

Quote:
Flow2 wants to put the info from the monitoring event into a DB. You tried to take the values from the monitoring event and put them into the DB. That sounds quite sane.
- That didn't work, so you are trying to re-parse the message body in Flow2 and re-extract the values that were already extracted in Flow1. That sounds absolutely crazy.


I could successfully put the values I took from the monitoing event into the DB except the payload part. You can see in my code I pasted earlier, I am putting the key field names and values extracted from the monitoing event in Environment and the payload part in OutputLocalEnvironment.

I have the below code to process the keyfield values I kept in the Environment and put them in database along with the payload I put in OutputLocalEnvironment.

Code:
DECLARE FieldExists BOOLEAN EXISTS(Environment.Content[]);
      
      IF FieldExists THEN
      
      DECLARE envRef REFERENCE TO Environment.Content[1];

                     
      WHILE LASTMOVE(envRef) DO
         SET J = 1;
         SET OLD_NM = '';
         SET CNT1 = CARDINALITY(Environment.Content[]);
       X:WHILE LASTMOVE(envRef) DO
             SET CUR_NM = COALESCE(envRef.name, '');
             IF CUR_NM <> OLD_NM THEN
               SET OutputLocalEnvironment.Insert[J] = COALESCE(envRef.value, '');
               SET OLD_NM = CUR_NM;
               MOVE envRef NEXTSIBLING;      
               DELETE PREVIOUSSIBLING OF envRef;
            
                  IF CNT1 = 1 THEN
                     SET Environment.Content[1] =  NULL;
                  END IF;
                  SET CNT2 = CARDINALITY(Environment.Content[]);
                           
                  IF CNT2 = 1 THEN
                     SET CNT1 = 1;
                     SET CUR_NM = COALESCE(envRef.name, '');
                     IF CUR_NM = OLD_NM THEN
                        LEAVE X;
                     END IF;
                  END IF;


               SET J = J + 1;
             ELSE
          
             MOVE envRef NEXTSIBLING;
                IF CNT1 = 1 THEN
                     SET Environment.Content[1] =  NULL;
                     RETURN FALSE;
               END IF;

            END IF;
         
         END WHILE;
         
         INSERT INTO DataSource.MB_AUDITTB(EVENT_TYPE, EVENT_ID, FLOW_NM, BROKER_NM, EXECUTION_GP, TIME_STAMP, NODE_NM, KEY_FIELD_1, KEY_FIELD_2, KEY_FIELD_3, KEY_FIELD_4, KEY_FIELD_5, KEY_FIELD_6, APPLICATION, USER_NM )
                             VALUES (EVENT_TYPE, EVENT_ID, FLOW_NM, BROKER_NM, EXEGUTION_GP, TIME_STAMP, NODE_NM,OutputLocalEnvironment.Insert[1],OutputLocalEnvironment.Insert[2],OutputLocalEnvironment.Insert[3],OutputLocalEnvironment.Insert[4],OutputLocalEnvironment.Insert[5],OutputLocalEnvironment.PayLoad,APP,USER);
                  
         MOVE envRef TO Environment.Content[1];
      END WHILE;
      ELSE
         INSERT INTO DataSource.MB_AUDITTB(EVENT_TYPE, EVENT_ID, FLOW_NM, BROKER_NM, EXECUTION_GP, TIME_STAMP, NODE_NM, KEY_FIELD_1, KEY_FIELD_2, KEY_FIELD_3, KEY_FIELD_4, KEY_FIELD_5, KEY_FIELD_6, APPLICATION, USER_NM )
                             VALUES (EVENT_TYPE, EVENT_ID, FLOW_NM, BROKER_NM, EXEGUTION_GP, TIME_STAMP, NODE_NM,OutputLocalEnvironment.Insert[1],OutputLocalEnvironment.Insert[2],OutputLocalEnvironment.Insert[3],OutputLocalEnvironment.Insert[4],OutputLocalEnvironment.Insert[5],OutputLocalEnvironment.PayLoad,APP,USER);
      END IF;


I could successfully put the keyfield values into the database, however, the payload part in the OutputLocalEnvironment was inserted - that column in the database contains null value (not inserted anything).

Quote:
so you are trying to re-parse the message body in Flow2 and re-extract the values that were already extracted in Flow1


I am not trying to do this.

Below is my code to extract the messageflowData.

Code:
DECLARE eventRef REFERENCE TO InputRoot.XMLNSC.ns:event.ns:eventPointData;
      
      SET EVENT_TYPE      =   eventRef.ns:eventData.ns:eventIdentity.ns:eventName;
      SET EVENT_ID      =   eventRef.ns:eventData.ns:eventCorrelation.ns:localTransactionId;
      SET FLOW_NM         =   eventRef.ns:messageFlowData.ns:messageFlow.ns:name;
      SET BROKER_NM      =   eventRef.ns:messageFlowData.ns:broker.ns:name;
      SET EXEGUTION_GP   =   eventRef.ns:messageFlowData.ns:executionGroup.ns:name;
      SET TIME_STAMP      =   eventRef.ns:eventData.ns:eventSequence.ns:creationTime;
      SET NODE_NM         =   eventRef.ns:messageFlowData.ns:node.ns:nodeLabel;


Thanks
mqxplorer
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Dec 20, 2010 8:59 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I could successfully put the values I took from the monitoing event into the DB except the payload part.
Thank you - it would have been useful to know that before.
Quote:
he payload part in the OutputLocalEnvironment was inserted - that column in the database contains null value (not inserted anything).
So..what have you done to debug that?
Back to top
View user's profile Send private message
mqxplorer
PostPosted: Mon Dec 20, 2010 9:43 am    Post subject: Reply with quote

Master

Joined: 22 Jun 2009
Posts: 206

Hi Kimbert,

Quote:
So..what have you done to debug that?


This is what I have done.

Code:
SET OutputRoot.XMLNSC = contentRef.*[<];
SET OutputLocalEnvironment.PayLoad = contentRef.*[<];


I have tried to see what is there in OutputRoot and LocalEnvironment.PayLoad by putting a trace node after the compute node.

I have the bleow variations:

Code:
=====================================================================================================

OutputRoot.XMLNSC

( ['xmlnsc' : 0x1e67fd00]
  (0x01000000:Folder):TEST_MSG = (
    (0x03000100:Attribute):TransId   = 'XYZ.TO.00000000' (CHARACTER)
    (0x03000100:Attribute):TransType = '1' (CHARACTER)
    (0x01000000:Folder   ):MsgData   = (
      (0x01000000:Folder):Transaction = (
        (0x01000000:Folder):TEST_WRK = (
          (0x03000100:Attribute  ):class         = 'R' (CHARACTER)
          (0x03000000:PCDataField):POSITION_NBR  = '12345' (CHARACTER)
          (0x03000000:PCDataField):JOB_REQ_NBR   = '12' (CHARACTER)
          (0x03000000:PCDataField):STATUS_DT     = '1999-05-31T13:20:00.000-05:00' (CHARACTER)
          (0x03000000:PCDataField):STATUS_CODE   = 'U' (CHARACTER)
          (0x03000000:PCDataField):DTTM_STAMP    = '1999-05-31T13:20:00.000-05:00' (CHARACTER)
          (0x03000000:PCDataField):OPRID         = '1' (CHARACTER)
          (0x03000000:PCDataField):OPRDEFNDESC   = '1' (CHARACTER)
          (0x03000000:PCDataField):LOCATION_NAME = 'C' (CHARACTER)
        )
      )
    )
  )
)

================================================================================================================

OutputLocalEnvironment.PayLoad

( ['MQROOT' : 0x1e681d58]
  (0x01000000:Name):TEST_MSG = (
    (0x03000000:NameValue):TransId   = 'XYZ.TO.00000000' (CHARACTER)
    (0x03000000:NameValue):TransType = '1' (CHARACTER)
    (0x01000000:Name     ):MsgData   = (
      (0x01000000:Name):Transaction = (
        (0x01000000:Name):TEST_WRK = (
          (0x03000000:NameValue):class         = 'R' (CHARACTER)
          (0x03000000:NameValue):POSITION_NBR  = '12345' (CHARACTER)
          (0x03000000:NameValue):JOB_REQ_NBR   = '12' (CHARACTER)
          (0x03000000:NameValue):STATUS_DT     = '1999-05-31T13:20:00.000-05:00' (CHARACTER)
          (0x03000000:NameValue):STATUS_CODE   = 'U' (CHARACTER)
          (0x03000000:NameValue):DTTM_STAMP    = '1999-05-31T13:20:00.000-05:00' (CHARACTER)
          (0x03000000:NameValue):OPRID         = '1' (CHARACTER)
          (0x03000000:NameValue):OPRDEFNDESC   = '1' (CHARACTER)
          (0x03000000:NameValue):LOCATION_NAME = 'C' (CHARACTER)
        )
      )
    )
  )
)
=====================================================================================================


What I could observe from the above trace is - I am losing the folder structure when I am putting the payload part in OutputLocalEnvironment.PayLoad. This is causing the issue.

I have tried this code:

Code:
                CREATE FIRSTCHILD OF OutputLocalEnvironment DOMAIN 'XMLNSC' TYPE XMLNSC.Folder NAME 'MyCachedData';
                SET OutputLocalEnvironment.MyCachedData = contentRef.*[<];


The trace result for this is:

Code:
LocalEnvironment.MyCachedData

( ['xmlnsc' : 0x1c857298]
  (0x01000000:Folder):TEST_MSG = (
    (0x03000100:Attribute):TransId   = 'XYZ.TO.00000000' (CHARACTER)
    (0x03000100:Attribute):TransType = '1' (CHARACTER)
    (0x01000000:Folder   ):MsgData   = (
      (0x01000000:Folder):Transaction = (
        (0x01000000:Folder):TEST_WRK = (
          (0x03000100:Attribute  ):class         = 'R' (CHARACTER)
          (0x03000000:PCDataField):POSITION_NBR  = '12345' (CHARACTER)
          (0x03000000:PCDataField):JOB_REQ_NBR   = '12' (CHARACTER)
          (0x03000000:PCDataField):STATUS_DT     = '1999-05-31T13:20:00.000-05:00' (CHARACTER)
          (0x03000000:PCDataField):STATUS_CODE   = 'U' (CHARACTER)
          (0x03000000:PCDataField):DTTM_STAMP    = '1999-05-31T13:20:00.000-05:00' (CHARACTER)
          (0x03000000:PCDataField):OPRID         = '1' (CHARACTER)
          (0x03000000:PCDataField):OPRDEFNDESC   = '1' (CHARACTER)
          (0x03000000:PCDataField):LOCATION_NAME = 'C' (CHARACTER)
        )
      )
    )
  )
)

This is what I am expecting, however, the question I have for the above code is - I have used the DOMAIN as XMLNSC which is same as my emitted event:

Code:
<wmb:complexContent wmb:elementName="XMLNSC">
         <XMLNSC>
            <TEST_MSG TransId="XYZ.TO.00000000" TransType="1">
               <MsgData>
                  <Transaction>
                     <TEST_WRK class="R">
                        <POSITION_NBR>12345</POSITION_NBR>
                        <JOB_REQ_NBR>12</JOB_REQ_NBR>
                        <STATUS_DT>1999-05-31T13:20:00.000-05:00</STATUS_DT>
                        <STATUS_CODE>U</STATUS_CODE>
                        <DTTM_STAMP>1999-05-31T13:20:00.000-05:00</DTTM_STAMP>
                        <OPRID>1</OPRID>
                        <OPRDEFNDESC>1</OPRDEFNDESC>
                        <LOCATION_NAME>C</LOCATION_NAME>
                     </TEST_WRK>
                  </Transaction>
               </MsgData>
            </TEST_MSG>
         </XMLNSC>
      </wmb:complexContent>

for an original request belonging to an XMLNSC domain. If the original request for the main flow belong to some other domain like 'MRM', 'SOAP' etc....I do not think the code I used above to write the apyload into OutputLocalEnvironment.MyCachedData will work.

I have not tried for other domains yet. I will...

Please let me know, if you have any better suggestions...

Thanks
mqxplorer
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Dec 20, 2010 12:02 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Your code to set the DOMAIN to 'XMLSNC' in the environment tree is correct. Don't change it
Quote:
If the original request for the main flow belong to some other domain like 'MRM', 'SOAP' etc....I do not think the code I used above to write the apyload into OutputLocalEnvironment.MyCachedData will work.
The flow being monitored can use any domain it likes - the monitoring event will still be an XML message.
The monitoring event is just an XML document so you could parse it using any XML parser you like, but we recommend XMLNSC, as always.

btw, you didn't say whether this has fixed your problem, or just moved you closer to a solution.
Back to top
View user's profile Send private message
mqxplorer
PostPosted: Mon Dec 20, 2010 1:22 pm    Post subject: Reply with quote

Master

Joined: 22 Jun 2009
Posts: 206

Hi Kimbert,

I am closer but not really....

Code:
INSERT INTO DataSource.MB_AUDITTB(EVENT_TYPE, EVENT_ID, FLOW_NM, BROKER_NM, EXECUTION_GP, TIME_STAMP, NODE_NM, KEY_FIELD_1, KEY_FIELD_2, KEY_FIELD_3, KEY_FIELD_4, KEY_FIELD_5, KEY_FIELD_6, APPLICATION, USER_NM )
                             VALUES (EVENT_TYPE, EVENT_ID, FLOW_NM, BROKER_NM, EXEGUTION_GP, TIME_STAMP, NODE_NM,OutputLocalEnvironment.Insert[1],OutputLocalEnvironment.Insert[2],OutputLocalEnvironment.Insert[3],OutputLocalEnvironment.Insert[4],OutputLocalEnvironment.Insert[5],OutputLocalEnvironment.MyCachedData,APP,USER);


When I speicfy the value of the KEY_FIELD_6 column as OutputLocalEnvironment.MyCachedData, it is not inserting anything.

The column type in the database is 'ntext'. Is this casuing the issue?

In order to make this work, I have written the below code:

Code:
DECLARE Load CHARACTER;
                SET PayLoad = cast(asbitstream(OutputLocalEnvironment.MyCachedData,,1208) as CHAR CCSID 1208);


and changed my database insertion as below.

Code:
INSERT INTO DataSource.MB_AUDITTB(EVENT_TYPE, EVENT_ID, FLOW_NM, BROKER_NM, EXECUTION_GP, TIME_STAMP, NODE_NM, KEY_FIELD_1, KEY_FIELD_2, KEY_FIELD_3, KEY_FIELD_4, KEY_FIELD_5, KEY_FIELD_6, APPLICATION, USER_NM )
                             VALUES (EVENT_TYPE, EVENT_ID, FLOW_NM, BROKER_NM, EXEGUTION_GP, TIME_STAMP, NODE_NM,OutputLocalEnvironment.Insert[1],OutputLocalEnvironment.Insert[2],OutputLocalEnvironment.Insert[3],OutputLocalEnvironment.Insert[4],OutputLocalEnvironment.Insert[5],PayLoad,APP,USER);


With this I could successfully insert the payload into the database.

However, I have the issue with the code to convert the payload in OutputLocalEnvironment.MyCachedData to string format, if the original reuqest for the main flow is of SOAP domain.

Below is the auidt event for the SOAP doamin message

Code:
<wmb:event xmlns:wmb="http://www.ibm.com/xmlns/prod/websphere/messagebroker/6.1.0/monitoring/event">
 <wmb:eventPointData>
  <wmb:eventData wmb:productVersion="7001" wmb:eventSchemaVersion="6.1.0.3" wmb:eventSourceAddress="SOAP Input.transaction.Start">
   <wmb:eventIdentity wmb:eventName="SOAP Input.TransactionStart"/>
   <wmb:eventSequence wmb:creationTime="2010-12-20T20:08:48.911Z" wmb:counter="1"/>
   <wmb:eventCorrelation wmb:localTransactionId="b384ae7a-8aa2-4989-bd09-b93b32132c86-5" wmb:parentTransactionId="" wmb:globalTransactionId=""/>
  </wmb:eventData>
  <wmb:messageFlowData>
   <wmb:broker wmb:name="MB7BROKER" wmb:UUID="63ded7aa-e5d7-4e18-acf0-e24eff47f9e7"/>
   <wmb:executionGroup wmb:name="default" wmb:UUID="e1d19709-2c01-0000-0080-fc981634d409"/>
   <wmb:messageFlow wmb:uniqueFlowName="MB7BROKER.default.Interface.MF_Int_Salesforce_Mediation1" wmb:name="Interface.MF_Int_Salesforce_Mediation1" wmb:UUID="05e73df6-2c01-0000-0080-a81a5eecbc9f" wmb:threadId="5912"/>
   <wmb:node wmb:nodeLabel="SOAP Input" wmb:nodeType="ComIbmSOAPInputNode"/>
  </wmb:messageFlowData>
 </wmb:eventPointData>
 <wmb:applicationData xmlns="">
  <wmb:complexContent wmb:elementName="SOAP">
   <SOAP>
    <Context operation="login" operationType="REQUEST_RESPONSE" portType="Soap" portTypeNamespace="urn:partner.soap.sforce.com" port="Soap" service="SforceService" fileName="C:\Documents and Settings\All Users\Application Data\IBM\MQSI\components\MB7BROKER\e1d19709-2c01-0000-0080-fc981634d409\config\XSD\MS_Salesforce_Mediation1/com/sforce/soap/partner/partner.wsdl">
     <SOAP_Version>1.1</SOAP_Version>
     <Namespace xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:partner.soap.sforce.com"/>
    </Context>
    <Header>
     <NS1:CallOptions xmlns:NS1="urn:partner.soap.sforce.com">
      <NS1:client/>
      <NS1:defaultNamespace/>
     </NS1:CallOptions>
     <NS2:LoginScopeHeader xmlns:NS2="urn:partner.soap.sforce.com">
      <NS2:organizationId/>
      <NS2:portalId/>
     </NS2:LoginScopeHeader>
    </Header>
    <Body>
     <NS3:login xmlns:NS3="urn:partner.soap.sforce.com">
      <NS3:username>userA</NS3:username>
      <NS3:password>xxxxxxxxxxxxxxxxxxxxx</NS3:password>
     </NS3:login>
    </Body>
   </SOAP>
  </wmb:complexContent>
 </wmb:applicationData>
</wmb:event>


The exception for this is:

Code:
ExceptionList
   RecoverableException
         File:CHARACTER:F:\build\S700_P\src\DataFlowEngine\ImbDataFlowNode.cpp
         Line:INTEGER:1073
         Function:CHARACTER:ImbDataFlowNode::createExceptionList
         Type:CHARACTER:ComIbmMQInputNode
         Name:CHARACTER:Audit_Flow_Local_Payload#FCMComposite_1_1
         Label:CHARACTER:Audit_Flow_Local_Payload.AuditEvent_Queue
         Catalog:CHARACTER:BIPmsgs
         Severity:INTEGER:3
         Number:INTEGER:2230
         Text:CHARACTER:Node throwing exception
         RecoverableException
               File:CHARACTER:F:\build\S700_P\src\DataFlowEngine\ImbComputeNode.cpp
               Line:INTEGER:489
               Function:CHARACTER:ImbComputeNode::evaluate
               Type:CHARACTER:ComIbmComputeNode
               Name:CHARACTER:Audit_Flow_Local_Payload#FCMComposite_1_2
               Label:CHARACTER:Audit_Flow_Local_Payload.Compute
               Catalog:CHARACTER:BIPmsgs
               Severity:INTEGER:3
               Number:INTEGER:2230
               Text:CHARACTER:Caught exception and rethrowing
               RecoverableException
                     File:CHARACTER:F:\build\S700_P\src\DataFlowEngine\ImbRdl\ImbRdlStatementGroup.cpp
                     Line:INTEGER:641
                     Function:CHARACTER:SqlStatementGroup::execute
                     Type:CHARACTER:ComIbmComputeNode
                     Name:CHARACTER:Audit_Flow_Local_Payload#FCMComposite_1_2
                     Label:CHARACTER:Audit_Flow_Local_Payload.Compute
                     Catalog:CHARACTER:BIPmsgs
                     Severity:INTEGER:3
                     Number:INTEGER:2488
                     Text:CHARACTER:Error detected, rethrowing
                     Insert
                           Type:INTEGER:5
                           Text:CHARACTER:.Audit_Flow_Local_Payload_Compute.Main
                     Insert
                           Type:INTEGER:5
                           Text:CHARACTER:47.3
                     Insert
                           Type:INTEGER:5
                           Text:CHARACTER:ContentCount(appDataRef, finalPayLoad);
                     RecoverableException
                           File:CHARACTER:F:\build\S700_P\src\DataFlowEngine\ImbRdl\ImbRdlRoutine.cpp
                           Line:INTEGER:628
                           Function:CHARACTER:SqlRoutine::invoke
                           Type:CHARACTER:ComIbmComputeNode
                           Name:CHARACTER:Audit_Flow_Local_Payload#FCMComposite_1_2
                           Label:CHARACTER:Audit_Flow_Local_Payload.Compute
                           Catalog:CHARACTER:BIPmsgs
                           Severity:INTEGER:3
                           Number:INTEGER:2934
                           Text:CHARACTER:Error occured in procedure
                           Insert
                                 Type:INTEGER:5
                                 Text:CHARACTER:ContentCount
                           RecoverableException
                                 File:CHARACTER:F:\build\S700_P\src\DataFlowEngine\ImbRdl\ImbRdlStatementGroup.cpp
                                 Line:INTEGER:641
                                 Function:CHARACTER:SqlStatementGroup::execute
                                 Type:CHARACTER:ComIbmComputeNode
                                 Name:CHARACTER:Audit_Flow_Local_Payload#FCMComposite_1_2
                                 Label:CHARACTER:Audit_Flow_Local_Payload.Compute
                                 Catalog:CHARACTER:BIPmsgs
                                 Severity:INTEGER:3
                                 Number:INTEGER:2488
                                 Text:CHARACTER:Error detected, rethrowing
                                 Insert
                                       Type:INTEGER:5
                                       Text:CHARACTER:.Audit_Flow_Local_Payload_Compute.ContentCount
                                 Insert
                                       Type:INTEGER:5
                                       Text:CHARACTER:49.7
                                 Insert
                                       Type:INTEGER:5
                                       Text:CHARACTER:SET finalPayLoad = CAST(ASBITSTREAM(OutputLocalEnvironment.MyCachedData ENCODING 1208) AS CHARACTER CCSID 1208);
                                 ParserException
                                       File:CHARACTER:F:\build\S700_P\src\MTI\MTIforBroker\GenXmlParser4\ImbXMLNSCParser.cpp
                                       Line:INTEGER:786
                                       Function:CHARACTER:ImbXMLNSCParser::refreshBitStreamFromElementsCommon
                                       Type:CHARACTER:ComIbmMQInputNode
                                       Name:CHARACTER:Audit_Flow_Local_Payload#FCMComposite_1_1
                                       Label:CHARACTER:Audit_Flow_Local_Payload.AuditEvent_Queue
                                       Catalog:CHARACTER:BIPmsgs
                                       Severity:INTEGER:3
                                       Number:INTEGER:5010
                                       Text:CHARACTER:XML Writing Errors have occurred
                                       ParserException
                                             File:CHARACTER:F:\build\S700_P\src\MTI\MTIforBroker\GenXmlParser4\ImbXMLNSCWriter.cpp
                                             Line:INTEGER:889
                                             Function:CHARACTER:ImbXMLNSCWriter::writeMisc
                                             Type:CHARACTER:
                                             Name:CHARACTER:
                                             Label:CHARACTER:
                                             Catalog:CHARACTER:BIPmsgs
                                             Severity:INTEGER:3
                                             Number:INTEGER:5016
                                             Text:CHARACTER:Unexpected XML type at this point in document.
                                             Insert
                                                   Type:INTEGER:5
                                                   Text:CHARACTER:Header
                                             Insert
                                                   Type:INTEGER:5
                                                   Text:CHARACTER:folderType


Can the column type in the database be something like xml instead of ntext so that I do not need to cast the payload in the OutputLocalEnvironment.MyCachedData to string?

Thanks
mqxplorer
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Monitoring Event - Capturing Payload
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.