ibm mq - Not able to write Non-XML message arriving at MQ Queue into database -


i'm using following esql code put non-xml message (arriving @ input queue) audit database (oracle 10g) blob object. code working when i'm using in ibm websphere message broker 6.0. migrated ibm websphere message broker 7.0 , non-xml message goes backout queue instead of being audited database. esql code subflow (that writes non xml messages db) i'm using is:

create compute module "writenonxmltoaudit_1_0_writenonxmltoaudit" create function main() returns boolean begin     set outputroot = inputroot;      declare ver char;     declare codename char;      set ver = '1_0_2';     set codename = 'writenonxmltoaudit.' || 'version:' || ver;      declare aonmsg reference "outputroot"."blob";     declare apperror reference inputexceptionlist;      declare msid integer;     declare messagetype char;      declare sourceapplication char;      declare mqhdrblob blob;     declare mqhdrchar char;      declare msgblob blob;     declare msgchar char;     declare msguuid char;      set outputroot.mqmd.format = 'mqstr   ';     set outputroot.mqmd.codedcharsetid = 819;     set outputroot.mqmd.encoding = 273;     set outputroot."mqrfh2" = null;      move aonmsg "outputroot"."blob";      set msgchar = aonmsg;      set messagetype = 'non_standard_message';     set msid = 9998;      set msguuid = uuidaschar;     set sourceapplication = rtrim(outputroot.mqmd.putapplname);      set msgchar = cast(outputroot."blob"."blob" char ccsid 819 encoding   outputroot.mqmd.encoding );      insert database.message_audit (uuid, msid, message_type, source_application, message_body)     values ( substring(msguuid 1 35),     msid,     substring(messagetype 1 29),     substring(sourceapplication (length(sourceapplication) - 9) 10),     msgchar);      if sqlcode <> 0         return false;     end if;      return true;  end;  end module; 

the main flow follows:

create compute module "acif_audit_1_5_insert exception msg" create function main() returns boolean begin set outputroot = inputroot;   create firstchild of outputroot.xml.msg.app_data name 'app_error'; create lastchild of outputroot.xml.msg.app_data.app_error name 'error_source' value   'acifbroker'; create lastchild of outputroot.xml.msg.app_data.app_error name 'error_operation' value 'acif_audit_exception'; create lastchild of outputroot.xml.msg.app_data.app_error name 'error_code' value ''; create lastchild of outputroot.xml.msg.app_data.app_error name 'error_string'; set outputroot.xml.msg.app_data.app_error.error_string = inputexceptionlist; create lastchild of outputroot.xml.msg.app_data.app_error name 'error_detail' value 'exception list';  set outputroot."mqrfh2" = null; set outputroot.mqmd.codedcharsetid = mqccsi_inherit;  /*819*/ set outputroot.mqmd.encoding = mqenc_native;          /*273*/ set outputroot.mqmd.format = 'mqstr';   return true; end;  end module; create compute module "acif_audit_1_5_insert audit record" create function main() returns boolean begin set outputroot = inputroot;   declare refaondataroot      reference inputbody.msg; declare refsoapdataroot     reference inputbody."soap-env:envelope"; declare msgchar         char; declare msgblob         blob; declare intsqlcode      integer; declare chrsqlerrortext     char;  /* added shailen **/ declare uuid        char; declare msid        int; declare mtype       char; declare srcapp      char; declare msgref      reference inputbody;  if fieldname(refaondataroot.aonheader) = 'aonheader'      set msgblob = bitstream(refaondataroot);     set msgchar  = cast(msgblob char ccsid inputroot.mqmd.codedcharsetid);     set msid = refaondataroot.aonheader.msid;      if  refaondataroot.app_data.app_header.uuid not null         set uuid = refaondataroot.app_data.app_header.uuid;     else         /* let check message_id - bridge messages */         if  fieldname(refaondataroot.app_data.aon_application_message.header.message_id ) not null             set uuid = refaondataroot.app_data.aon_application_message.header.message_id;             set msid = 9999;         end if;     end if;  if  fieldname(refaondataroot.app_data.app_header.message_type) not null     set mtype = refaondataroot.app_data.app_header.message_type; else     /* let check location - historical message type location */     if    fieldname(refaondataroot.app_data.aon_application_message.header.message_type ) not null             set mtype = refaondataroot.app_data.aon_application_message.header.message_type;         end if;     end if;      insert database.message_audit (uuid,msid,message_type,source_application,mq_header,message_body)      values (uuid,msid,mtype,refaondataroot.aonheader.application_name,'',msgchar);  /* 08-11-2004:the following assumes flow throw error on database error.  * part of change flow being changed this, otherwise message thrown away.  return false;     */ elseif fieldname(refsoapdataroot."soap-env:header") = 'soap-env:header'      set msgblob = bitstream(refsoapdataroot);     set msgchar  = cast(msgblob char ccsid inputroot.mqmd.codedcharsetid);      insert database.mquser.message_audit (uuid,msid,message_type,source_application,mq_header,message_body)      values (refsoapdataroot."soap-env:header".messageheader.uuid,'',refsoapdataroot."soap-env:header".messageheader.messagetype,'','',msgchar);     /* 08-11-2004:the following assumes flow throw error on database error.  * part of change flow being changed this, otherwise message thrown away. return false;  */  elseif fieldname(inputbody.aon_application_message) not null     /* audit message ame bridge.      * message id uuid message.      */     move msgref inputbody.aon_application_message;     set msgblob = bitstream(msgref);     set msgchar = cast(msgblob char ccsid inputroot.mqmd.codedcharsetid);      set msid = '9999';     set mtype = 'unset';     set srcapp = 'unset';      if fieldname(msgref.header.message_id) not null         set uuid = msgref.header.message_id;     end if;      if fieldname(msgref.header.msid) not null         set msid = cast(msgref.header.msid int);     end if;      if fieldname(msgref.header.message_type) not null         set mtype = msgref.header.message_type;     end if;      if fieldname(msgref.header.sender) not null         set srcapp = msgref.header.sender;     end if;      insert database.message_audit (uuid,msid,message_type,source_application,mq_header,message_body)      values (uuid,msid,mtype,srcapp,'',msgchar);      /* 08-11-2004:the following assumes flow throw error on database error.      * part of change flow being changed this, otherwise message thrown away.     return false;         */  elseif fieldname(inputbody.msg.header.application_name) not null     /* assume atlas message.      * message id uuid message.      */     move msgref inputbody.msg;     set msgblob = bitstream(msgref);     set msgchar = cast(msgblob char ccsid inputroot.mqmd.codedcharsetid);      set srcapp = msgref.header.application_name;      if fieldname(msgref.header.msid) not null         set msid = msgref.header.msid;     else         set msid = '9997';     end if;      set mtype = 'unset:atlas_message';     set uuid = uuidaschar;      insert database.message_audit (uuid,msid,message_type,source_application,mq_header,message_body)      values (uuid,msid,mtype,srcapp,'',msgchar);      /* 08-11-2004:the following assumes flow throw error on database error.      * part of change flow being changed this, otherwise message thrown away.     return false;         */      else     /* have xml message, not know is. lets treat a nonxml message.      */     return true; end if;  /*   * return false - means okay in case. have wired true terminal handle case when have   * xml message, 1 not recognised. nb non xml messages cause error because mqinput node expecting xml   * message.  */ return false;  end;  end module; 

broker logs:

mar 25 14:50:31 ukvmgstg008 websphere broker v7005[15201]: (uks06.acif_001)[35]bip2232e: error detected whilst handling previous error in node 'acif_audit_1_5.acif_error_01'. : uks06.7aaf0524-3801-0000-0080-9e3a13c0b2a4: /build/s700_p/src/dataflowengine/imbdataflownode.cpp: 893: imbdataflownode::logexceptionlist: comibmmqoutputnode: acif_audit_1_5#fcmcomposite_1_2 mar 25 14:50:31 ukvmgstg008 websphere broker v7005[15201]: (uks06.acif_001)[35]bip2230e: error detected whilst processing message in node 'acif_audit_1_5.insert audit record'. : uks06.7aaf0524-3801-0000-0080-9e3a13c0b2a4: /build/s700_p/src/dataflowengine/imbcomputenode.cpp: 489: imbcomputenode::evaluate: comibmcomputenode: acif_audit_1_5#fcmcomposite_1_4 mar 25 14:50:31 ukvmgstg008 websphere broker v7005[15201]: (uks06.acif_001)[35]bip2488e:  (.acif_audit_1_5_insert audit record.main, 16.1) error detected whilst executing sql statement 'declare refaondataroot reference inputbody.msg;'. : uks06.7aaf0524-3801-0000-0080-9e3a13c0b2a4: /build/s700_p/src/dataflowengine/imbrdl/imbrdlstatementgroup.cpp: 643: sqlstatementgroup::execute: comibmcomputenode: acif_audit_1_5#fcmcomposite_1_4 mar 25 14:50:31 ukvmgstg008 websphere broker v7005[15201]: (uks06.acif_001)[35]bip2498e: (.acif_audit_1_5_insert audit record.main, 16.39) : error occurred when navigating path element '2' of field reference @ given location. : uks06.7aaf0524-3801-0000-0080-9e3a13c0b2a4: /build/s700_p/src/dataflowengine/imbrdl/imbrdlfieldref.cpp: 1916: sqlfieldreference::navigateabsolutetofirst: comibmcomputenode: acif_audit_1_5#fcmcomposite_1_4 mar 25 14:50:31 ukvmgstg008 websphere broker v7005[15201]: (uks06.acif_001)[35]bip5009e: xml parsing errors have occurred. : uks06.7aaf0524-3801-0000-0080-9e3a13c0b2a4: /build/s700_p/src/mti/mtiforbroker/genxmlparser2/xmlimbparser.cpp: 720: xmlimbparser::parserightsibling: :  mar 25 14:50:31 ukvmgstg008 websphere broker v7005[15201]: (uks06.acif_001)[35]bip5004e: xml parsing error 'invalid character (unicode: 0x2) ' occurred on line 1 column 441 when parsing element 'app_data'.  internal error codes '196' , ''. : uks06.7aaf0524-3801-0000-0080-9e3a13c0b2a4: /build/s700_p/src/mti/mtiforbroker/genxmlparser2/xmlbrokerasgardparser.cpp: 730: xmlbrokerasgardparser::error: :  mar 25 14:50:31 ukvmgstg008 websphere broker v7005[15201]: (uks06.acif_001)[35]bip2628e: exception condition detected on input node 'acif_audit_1_5.acif_audit_01'. : uks06.7aaf0524-3801-0000-0080-9e3a13c0b2a4: /build/s700_p/src/dataflowengine/imbcommoninputnode.cpp: 1912: imbcommoninputnode::run: comibmmqinputnode: acif_audit_1_5#fcmcomposite_1_5 mar 25 14:50:31 ukvmgstg008 websphere broker v7005[15201]: (uks06.acif_001)[35]bip2230e: error detected whilst processing message in node 'acif_audit_1_5.acif_error_01'. : uks06.7aaf0524-3801-0000-0080-9e3a13c0b2a4: /build/s700_p/src/dataflowengine/imbmqoutputnode.cpp: 864: imbmqoutputnode::evaluate: comibmmqoutputnode: acif_audit_1_5#fcmcomposite_1_2 mar 25 14:50:31 ukvmgstg008 websphere broker v7005[15201]: (uks06.acif_001)[35]bip5010e: xml writing errors have occurred. : uks06.7aaf0524-3801-0000-0080-9e3a13c0b2a4: /build/s700_p/src/mti/mtiforbroker/genxmlparser2/xmlimbparser.cpp: 443: xmlimbparser::refreshbitstreamfromelementsinner: comibmmqinputnode: acif_audit_1_5#fcmcomposite_1_5 mar 25 14:50:31 ukvmgstg008 websphere broker v7005[15201]: (uks06.acif_001)[35]bip5005e: there 2 top level elements 'msg,msg' in document. : uks06.7aaf0524-3801-0000-0080-9e3a13c0b2a4: /build/s700_p/src/mti/mtiforbroker/genxmlparser2/xmlimbparser.cpp: 954: xmlimbparser::checkforbodyelement: :  mar 25 14:50:31 ukvmgstg008 websphere broker v7005[15195]: (uks06.concert_001)[7]bip2648e: message backed out queue; node 'acif_audit_1_5.acif_audit_01'. : uks06.d0420624-3801-0000-0080-83fda0200698: /build/s700_p/src/dataflowengine/imbmqinputnode.cpp: 2122: imbcommoninputnode::eligibleforbackout: comibmmqinputnode: acif_audit_1_5#fcmcomposite_1_5 

you need hold of exception list , find out root cause of failure is. if don't have catch of fail terminals error messages in syslog / event viewer.

if have error handling need ensure process exception list in suitable way report root cause of exception.

if stuck try taking user trace , following through execution of affected compute node try , identify point of failure.

if issue db or db driver problem bip message gets thrown should have sqlstate , native error code can reference in db vendors documentation.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -