Search code examples
ibm-mqibm-integration-busextended-sql

InputRoot and InputBody are NULL for MQ ESQL ComputeNode


I've been tasked with creating a new flow and for some reason I can't access the data that is coming in from the 'IN' Queue. I'm using MessageBrokerToolkit 7.0.0.1 in windows. The test messages are the same ones that work in production.

CREATE COMPUTE MODULE FLOW_Compute
    CREATE FUNCTION Main() RETURNS BOOLEAN
    BEGIN
        DECLARE TMP ROW PASSTHRU('SELECT RAWTOHEX(UTL_RAW.CAST_TO_RAW(DBMS_OBFUSCATION_TOOLKIT.md5(INPUT_STRING => CURRENT_TIMESTAMP)))UNIQUE_ID FROM DUAL'); 
        DECLARE blobMSG BLOB InputRoot.BLOB.BLOB; 
        DECLARE MSG CHARACTER CAST(blobMSG AS CHARACTER CCSID InputRoot.MQMD.CodedCharSetId ENCODING InputRoot.MQMD.Encoding); 
        DECLARE TITLE CHAR InputRoot.XML.Request."MessageID";

        PASSTHRU(
            'INSERT INTO PA0101.DEBUG_TABLE VALUES(?,?,?)',
            TMP.UNIQUE_ID,
            TITLE,
            MSG,
        );
    RETURN TRUE;
END; 

The DEBUG_TABLE rows come out like: (pipe delimited)

F69A159|||              
11C7EBF|||              
1077ADD|||              

Here is a sample message:

<Request>
 <MessageID>a1f5298a-e339-423b-ac9a-4654cb46e965</MessageID>
 <SendResponse>false</SendResponse>
 <BasicElements>
  <FeedType>Realtime</FeedType>
  <MsgDT>08/09/2015</MsgDt>
  <Category>Action</Category>
  <PriorityCd>1</PriorityCd>
  <SubjectTx>This is important</SubjectTx>
  <DetailTx>[lots of html]</DetailTx>
 </BasicElements>
</Request>

When I try to run command line utils on the server I usually get:

<command>
ld.so.1: <command>: fatal: libjvm.so: open failed: No such file or directory
Killed

The code doesn't produce any warnings and the .bar file builds + deploys so I am at a loss for what could be going wrong.


Solution

  • Most likely you are not using the message domain set on the input node in your ESQL.

    You cannot use both the XML and the BLOB domain at the same time, the input message will be parsed in one or the other domain, as configured on the input node (or ResetContentDescriptor nodes in your flow). So either InputRoot.BLOB or InputRoot.XML will be NULL. And I think that you are actually using the XMLNSC domain in your input node and the messsage body parsed in that domain can be accessed under InputRoot.XMLNSC.

    In case you need the message body as BLOB and parsed as XML in the same flow, you should set the message domain as BLOB in the input node and parse the message latter in the flow by using the ResetContentDescriptor node, or by using the PARSE option of the CREATE in ESQL:

    http://www-01.ibm.com/support/knowledgecenter/api/content/nl/en-us/SSKM8N_8.0.0/com.ibm.etools.mft.doc/ak04950_.htm