Topic
1 reply Latest Post - ‏2012-10-12T10:24:40Z by kimbert@uk.ibm.com
SystemAdmin
SystemAdmin
4179 Posts
ACCEPTED ANSWER

Pinned topic Dynamic message logging

‏2012-10-11T07:17:30Z |
Hi all,

I am trying to implement dynamic message logging.
I have a database table that stores below.

SERVICE_NAME | COL1 | COL2
==============================================================================
GETCUSTOMER InputRoot.XMLNSC.LOGMSG.CUST.NAME InputRoot.XMLNSC.LOGMSG.CUST.SSN

During runtime, I will select the appropriate message element to be logged based on service name from the table above. This values should refer to the actual element in the message tree.

Based on the input XML. I was expecting the actual values to be stored.

<LOGMSG>
<CUST>
<NAME>XXXX</NAME>
<SSN>YYYY</SSN>
</CUST>
</LOGMSG>
Instead, BROKER will store the values as is - InputRoot.XMLNSC.LOGMSG.CUST.NAME and InputRoot.XMLNSC.LOGMSG.CUST.SSN to the LOG_TBL table.
I've tried various ways but to no avail.

1) APPROACH 1
INSERT INTO Database.LOG_TBL(C1, C2)
VALUES(Environment.Variables.CONFIG[1].COL1, Environment.Variables.CONFIG[1].COL2);

2) APPROACH 2
DECLARE refcol1 REFERENCE TO Environment.Variables.CONFIG[1].COL1;
DECLARE refcol2 REFERENCE TO Environment.Variables.CONFIG[1].COL2;
INSERT INTO Database.LOG_TBL(C1, C2) VALUES(refcol1, refcol2)

Could anyone shed some light on the above.
Thank you.
Updated on 2012-10-12T10:24:40Z at 2012-10-12T10:24:40Z by kimbert@uk.ibm.com
  • kimbert@uk.ibm.com
    kimbert@uk.ibm.com
    466 Posts
    ACCEPTED ANSWER

    Re: Dynamic message logging

    ‏2012-10-12T10:24:40Z  in response to SystemAdmin
    Not sure what you're doing wrong. The best way to diagnose things like this is
    • add a Trace node into the flow
    • take a debug-level user trace using mqsichangetrace, mqsireadlog and mqsiformatlog ( in that order )
    • read the resulting text file carefully to see what your flow has been doing. Compare that with what you expected your flow to do.
    • Change flow and re-test
    • Repeat until flow does what you need.