Topic
  • 4 replies
  • Latest Post - ‏2017-02-11T02:26:57Z by menotyou
menotyou
menotyou
6 Posts

Pinned topic Retail Pack - include BLOB in caught exception message

‏2016-12-29T18:07:24Z |

We are implementing the RetaliPack for IIB, version 9.0.0.3.

 

Messages arrive via HTTPInput node in the BLOB data.  The input message is parsed with DFDL.

If there is an error in the parsing, the failure terminal leads to a java compute node that sends an exception message to an error queue.

The exception message wraps the input message which consists of the MQRFH2C and DFDL elements:

// copy the input tree in to the Exception/InputMessage element
MbElement inputMessage = (MbElement)inAssembly.getMessage().getRootElement();
MbElement inputMessage_Element = exception_Element.createElementAsLastChild (MbElement.TYPE_NAME, "InputMessage", null );
inputMessage_Element.copyElementTree( inputMessage ) ;

It would be useful if the original binary data BLOB were also included in this exception message, but I don't know how to do this.  I would appreciate any help to point me in the right direction.

 

Update:  After poking around a bit, it looks like one solution could be to change the input node domain from DFDL to BLOB, introduce a compute node to save the BLOB in the Environment, then pass the message to a Reset Content Descriptor node which would do the DFDL parsing.  In the java compute node that catches the exception, I can append the BLOB from the Environment to the InputMessage.

 

I will give this a try but still welcome any advice.

 

Updated on 2016-12-29T19:06:24Z at 2016-12-29T19:06:24Z by menotyou
  • menotyou
    menotyou
    6 Posts

    Re: Retail Pack - include BLOB in caught exception message

    ‏2017-01-26T16:13:28Z  

    I was not been able to get this working.  I tried the RCD and different combinations of message domains, but none of them allow me to capture and propagate the BLOB and successfully perform the DFDL parsing.

     

    Hoping some folks who can help will see this now and point me in the right direction.

     

     

  • lancelotlinc
    lancelotlinc
    485 Posts

    Re: Retail Pack - include BLOB in caught exception message

    ‏2017-01-26T18:40:45Z  
    • menotyou
    • ‏2017-01-26T16:13:28Z

    I was not been able to get this working.  I tried the RCD and different combinations of message domains, but none of them allow me to capture and propagate the BLOB and successfully perform the DFDL parsing.

     

    Hoping some folks who can help will see this now and point me in the right direction.

     

     

    Adding a Trace node to your flow would be of big help.

     

    Pattern :

     

    Root:

    ${Root}

    ===

    LocalEnvironment:

    ${LocalEnvironment}

    ===

    Environment:

    ${Environment}

    ===

    ExceptionList:

    ${ExceptionList}

    ===

    ${CURRENT_TIMESTAMP}

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

  • menotyou
    menotyou
    6 Posts

    Re: Retail Pack - include BLOB in caught exception message

    ‏2017-02-03T19:03:24Z  

    Adding a Trace node to your flow would be of big help.

     

    Pattern :

     

    Root:

    ${Root}

    ===

    LocalEnvironment:

    ${LocalEnvironment}

    ===

    Environment:

    ${Environment}

    ===

    ExceptionList:

    ${ExceptionList}

    ===

    ${CURRENT_TIMESTAMP}

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

    Thank you for the advice!  I am working through other priorities at the moment but will do this when I get back to this one.

  • menotyou
    menotyou
    6 Posts

    Re: Retail Pack - include BLOB in caught exception message

    ‏2017-02-11T02:26:57Z  

    I finally got it working.  I did it in a compute node early in the flow:

            DECLARE l_blob BLOB ASBITSTREAM(InputRoot.DFDL);
            DECLARE c_guid CONSTANT CHAR UUIDASCHAR; -- the UUIDASCHAR command generates the GUID
      
            SET OutputRoot = InputRoot;
      
            CREATE NEXTSIBLING OF OutputRoot.[<2] DOMAIN 'MQRFH2C' TYPE Name NAME 'MQRFH2C';
            CREATE FIRSTCHILD OF OutputRoot.MQRFH2C TYPE NameValue NAME 'Version' VALUE MQRFH_VERSION_2;
            CREATE LASTCHILD OF OutputRoot.MQRFH2C TYPE NameValue NAME 'Format' VALUE 'MQRFH2C';
            CREATE LASTCHILD OF OutputRoot.MQRFH2C TYPE NameValue NAME 'Encoding' VALUE MQENC_NATIVE;
            CREATE LASTCHILD OF OutputRoot.MQRFH2C TYPE NameValue NAME 'CodedCharSetId' VALUE 1208;
            CREATE LASTCHILD OF OutputRoot.MQRFH2C TYPE NameValue NAME 'Flags' VALUE MQRFH_NONE;
            CREATE LASTCHILD OF OutputRoot.MQRFH2C TYPE NameValue NAME 'NameValueCCSID' VALUE 1208;
            CREATE LASTCHILD OF OutputRoot.MQRFH2C TYPE Name NAME 'usr';
            
            SET OutputRoot.MQRFH2C.usr.GUID                      = c_guid;
            
            -- Add BLOB
            CREATE LASTCHILD OF OutputRoot.MQRFH2C.usr DOMAIN('BLOB') PARSE(l_blob);
      
            RETURN TRUE;
           
    

    Which generates the following XML in the message:

        <MQRFH2>
          <Version>2</Version>
          <Format>MQRFH2C </Format>
          <Encoding>546</Encoding>
          <CodedCharSetId>1208</CodedCharSetId>
          <Flags>0</Flags>
          <NameValueCCSID>1208</NameValueCCSID>
          <usr>
            <GUID>75bf2473-a030-4556-9e8d-f2ea57a8f183</GUID>
            <BLOB>
              <BLOB>22003a00083a00033a17021014113a003a0a</BLOB>
            </BLOB>
          </usr>
          <mcd>
            <Msd>jms_map</Msd>
            <Set></Set>
            <Type></Type>
            <Fmt></Fmt>
          </mcd>
        </MQRFH2>