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 » Not able to write non-XML message into database

Post new topic  Reply to topic Goto page 1, 2  Next
 Not able to write non-XML message into database « View previous topic :: View next topic » 
Author Message
shubham_057
PostPosted: Mon Mar 24, 2014 11:59 pm    Post subject: Not able to write non-XML message into database Reply with quote

Novice

Joined: 24 Mar 2014
Posts: 14

I'm using following ESQL code to put the non-xml message (arriving at input queue) into an audit database (Oracle 10g) as BLOB Object. The code is working when i'm using it in IBM WebSphere Message Broker 6.0. But recently i migrated to IBM WebSphere Message Broker 7.0 and now the non-xml message goes to Backout queue instead of being audited into database. The ESQL code i'm using is :

Code:
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 To "OutputRoot"."BLOB";
    DECLARE appError REFERENCE To 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 TO "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" As CHAR CCSID 819 ENCODING OutputRoot.MQMD.Encoding );

    Insert Into Database.Message_Audit (UUID, MSID, Message_Type, Source_Application, Message_Body)
    Values ( SUBSTRING(msgUUID FROM 1 FOR 35),
    msid,
    SUBSTRING(messageType FROM 1 FOR 29),
    SUBSTRING(sourceApplication FROM (LENGTH(sourceApplication) - 9) FOR 10),
    msgChar);

    IF SQLCODE <> 0 THEN
        RETURN FALSE;
    END IF;

    RETURN TRUE;

END;

END MODULE;
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Mar 25, 2014 1:10 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.

What does your error handling tell you the DB (or other reason) error is for the backout?
_________________
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
McueMart
PostPosted: Tue Mar 25, 2014 1:19 am    Post subject: Reply with quote

Chevalier

Joined: 29 Nov 2011
Posts: 490
Location: UK...somewhere

Also why all the random quoting of "BLOB" and "MQRFH2" and "OutputRoot" ?
Back to top
View user's profile Send private message
shubham_057
PostPosted: Tue Mar 25, 2014 1:20 am    Post subject: Reply with quote

Novice

Joined: 24 Mar 2014
Posts: 14

There are no errors.
The messages that arrive are XML messages. If there is any special character in the XML, it is converted to BLOB and stored in db.

But currently when a message with special character arrives it goes into backout queue instead of getting audited into the database.
Plz help i'm in big trouble
Back to top
View user's profile Send private message
shubham_057
PostPosted: Tue Mar 25, 2014 1:30 am    Post subject: Reply with quote

Novice

Joined: 24 Mar 2014
Posts: 14

i have not written the code. it was written years back by a previous employee.
does it makes any difference by putting it in double quotes?
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Mar 25, 2014 1:53 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.

shubham_057 wrote:
There are no errors.


So a message arrives at the Input Q and by some invisible Magic ends up on the BOQ.
Is the BOQ a real BOQ in WMQ Terms?

There should be something in the EventLog that indicates why there is a problem.

If there isn't, run a message that fails through the flow with usertrace enabled. You might be pleasantly surprised what delights looking at the formatted output might reveal.

Not knowing what the error( or errors) are really makes it difficult to help you.
_________________
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
kimbert
PostPosted: Tue Mar 25, 2014 2:53 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I'm using following ESQL code to put the non-xml message (arriving at input queue) into an audit database
later...
Quote:
There are no errors.
The messages that arrive are XML messages.


I also noticed this gem:
Code:
DECLARE aonMSG REFERENCE To "OutputRoot"."BLOB";
...
MOVE aonMSG TO "OutputRoot"."BLOB"; 



You can't blame us for being a bit suspicious, in the circumstances
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Mar 25, 2014 3:10 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

And no check on LASTMOVE(aonMSG) !
What if the reference you're passing does not use a BLOB parser?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
shubham_057
PostPosted: Tue Mar 25, 2014 11:51 pm    Post subject: Reply with quote

Novice

Joined: 24 Mar 2014
Posts: 14

Guys please spare me..
Let me be clear i'm from Java background and since the issue is critical to business that's why i was told to look into it because there were no other resources available.
I'm very new to this.

Here are the broker logs which i'm gettting :

Code:
Mar 25 14:50:31 ukvmgstg008 WebSphere Broker v7005[15201]: (UKS06.ACIF_001)[35]BIP2232E: Error detected whilst handling a 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 a 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 the SQL statement 'DECLARE refAONDataRoot REFERENCE TO 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) : An error occurred when navigating to path element '2' of the field reference at the 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: An XML parsing error 'Invalid character (Unicode: 0x2) ' occurred on line 1 column 441 when parsing element 'app_data'.  Internal error codes are '196' and ''. : 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 a 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 are 2 top level elements 'msg,MSG' in the 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 to a 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
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Mar 26, 2014 2:09 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

This line in the trace:
Code:
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 the SQL statement 'DECLARE refAONDataRoot REFERENCE TO 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
...does not appear in the ESQL that you posted. In other words, you are probably looking for the problem in entirely the wrong place.
Code:
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: An XML parsing error 'Invalid character (Unicode: 0x2) ' occurred on line 1 column 441 when parsing element 'app_data'. Internal error codes are '196' and ''. : UKS06.7aaf0524-3801-0000-0080-9e3a13c0b2a4: /build/S700_P/src/MTI/MTIforBroker/GenXmlParser2/XmlBrokerAsgardParser.cpp: 730: XmlBrokerAsgardParser::error: :
An XML document is a text document, so it must be parsed using the same character encoding that the writer used. In an MQ environment the encoding is supplied by the MQMD header, in the CodedCharSetId field.

I suspect that the message broker XML parser is trying to interpret the incoming XML using the wrong character encoding ( the wrong CCSID, in IBM terminology ). That might be because the sender has labelled it wrongly.

At this point, you need to
- find out the correct place in the flow where the error is occurring
- check whether the bytes being received by the flow are as expected ( same as v6.1, if that is the requirement )
- check whether the sender is correctly setting the MQMD.CodedCharSetId field

...and it would be good if you tag your code and XML snippets using the buttons provided - it makes life easier for those who are trying to help you.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
shubham_057
PostPosted: Wed Mar 26, 2014 2:54 am    Post subject: Reply with quote

Novice

Joined: 24 Mar 2014
Posts: 14

Thanks for looking into it.
Actually the code that i have provided is of the subflow that writes the non-xml messages into audit d/b.

Here is the main flow:

Code:
CREATE COMPUTE MODULE "ACIF_AUDIT_1_5_Insert exception into msg"
CREATE FUNCTION main() RETURNS BOOLEAN BEGIN
SET OutputRoot = InputRoot;
-- Enter SQL below this line.  SQL above this line might be regenerated, causing any modifications to be lost.
/*Version   Who      When      Description

  1.0      ????            Initial Version
  1.1      Shailen Devani   08-11-2004   More description Error Operation, and remove the RFH2 header
*/

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;
-- Enter SQL below this line.  SQL above this line might be regenerated, causing any modifications to be lost.

/*Version   Who      When      Description

  1.0      Simon Farrow         Initial Version
  1.1      Simon Farrow   02-04-2003   Added SOAP header auditing
  1.2      Shailen Devani   08-11-2004   Added AME / BRIDE auditing requirement. The message id from AME to Bridge are treated as UUID
                    for auditing purposes. For these messages a default msid of 9999 is also inserted if none is present.
  1.3      Shailen Devani   02-02-2004   Return TRUE, if unrecognised XML message. FALSE otherwise. NB DB exceptin may also occur.
  1.3      Shailen Devani   02-14-2004   Take into account atlas XML messages.
 
*/

Declare refAONDataRoot       REFERENCE To InputBody.MSG;
Declare refSOAPDataRoot      REFERENCE TO InputBody."SOAP-ENV:Envelope";
Declare MSGChar       CHAR;
Declare MSGBlob       BLOB;
DECLARE intSQLCode      INTEGER;
DECLARE chrSQLErrorText      CHAR;

/* Added by Shailen **/
DECLARE uuid      CHAR;
DECLARE msid      INT;
DECLARE mType      CHAR;
DECLARE srcApp      CHAR;
Declare msgRef       REFERENCE TO InputBody;

If FIELDNAME(refAONDataRoot.AONHEADER) = 'AONHEADER' Then
   /*
    * If there is not a UUID value in the header, then lets check to see if we have a BRIDGE Message.
    * NB This is a legacy message, and does not follow all the rules for a AONHEADER fields etc.
    */
   Set MSGBlob = BITSTREAM(refAONDataRoot);
   Set MSGChar  = CAST(MSGBlob As CHAR CCSID InputRoot.MQMD.CodedCharSetId);
   Set msid = refAONDataRoot.AONHEADER.MSID;
   
   IF  refAONDataRoot.APP_DATA.APP_HEADER.UUID IS NOT NULL THEN
      SET uuid = refAONDataRoot.APP_DATA.APP_HEADER.UUID;
   ELSE
      /* Let check for MESSAGE_ID - BRIDGE Messages */
      IF  FIELDNAME(refAONDataRoot.APP_DATA.AON_APPLICATION_MESSAGE.HEADER.MESSAGE_ID ) IS NOT NULL THEN
         SET uuid = refAONDataRoot.APP_DATA.AON_APPLICATION_MESSAGE.HEADER.MESSAGE_ID;
         SET msid = 9999;
      END IF;
   END IF;

   /*
    * If there is MESSAGE_TYPE value in the header, then lets check to see if we have a BRIDGE Message.
    */   
   IF  FIELDNAME(refAONDataRoot.APP_DATA.APP_HEADER.MESSAGE_TYPE) IS NOT NULL THEN
      SET mType = refAONDataRoot.APP_DATA.APP_HEADER.MESSAGE_TYPE;
   ELSE
      /* Let check another location - historical message type location */
      IF  FIELDNAME(refAONDataRoot.APP_DATA.AON_APPLICATION_MESSAGE.HEADER.MESSAGE_TYPE ) IS NOT NULL THEN
         SET mType = refAONDataRoot.APP_DATA.AON_APPLICATION_MESSAGE.HEADER.MESSAGE_TYPE;
      END IF;
   END IF;
   
   Insert Into 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 that the flow will throw an error on an database error.
    * As part of this change the flow is being changed to do this, otherwise the message is just thrown away.
   
   RETURN FALSE;   
    */
ElseIf FIELDNAME(refSOAPDataRoot."SOAP-ENV:Header") = 'SOAP-ENV:Header' Then

   Set MSGBlob = BITSTREAM(refSOAPDataRoot);
   Set MSGChar  = CAST(MSGBlob As CHAR CCSID InputRoot.MQMD.CodedCharSetId);

   Insert Into 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 that the flow will throw an error on an database error.
    * As part of this change the flow is being changed to do this, otherwise the message is just thrown away.
   RETURN FALSE;
    */   
ElseIf FIELDNAME(InputBody.AON_APPLICATION_MESSAGE) IS NOT NULL Then
   /* This is to audit the message from AME to bridge.
    * The MESSAGE ID is effectively the UUID for this message.
    */
   MOVE msgRef TO InputBody.AON_APPLICATION_MESSAGE;
   Set MSGBlob = BITSTREAM(msgRef);
   Set MSGChar = CAST(MSGBlob As CHAR CCSID InputRoot.MQMD.CodedCharSetId);

   Set msid = '9999';
   Set mType = 'Unset';
   Set srcApp = 'Unset';
   
   IF FIELDNAME(msgRef.HEADER.MESSAGE_ID) IS NOT NULL THEN
      SET uuid = msgRef.HEADER.MESSAGE_ID;
   END IF;
   
   IF FIELDNAME(msgRef.HEADER.MSID) IS NOT NULL THEN
      SET msid = CAST(msgRef.HEADER.MSID AS INT);
   END IF;
   
   IF FIELDNAME(msgRef.HEADER.MESSAGE_TYPE) IS NOT NULL THEN
      SET mType = msgRef.HEADER.MESSAGE_TYPE;
   END IF;
   
   IF FIELDNAME(msgRef.HEADER.SENDER) IS NOT NULL THEN
      SET srcApp = msgRef.HEADER.SENDER;
   END IF;
   
   Insert Into 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 that the flow will throw an error on an database error.
    * As part of this change the flow is being changed to do this, otherwise the message is just thrown away.
   RETURN FALSE;   
    */   
ElseIf FIELDNAME(InputBody.msg.header.application_name) IS NOT NULL Then
   /* Then assume this is an ATLAS message.
    * The MESSAGE ID is effectively the UUID for this message.
    */
   MOVE msgRef TO InputBody.msg;
   Set MSGBlob = BITSTREAM(msgRef);
   Set MSGChar = CAST(MSGBlob As CHAR CCSID InputRoot.MQMD.CodedCharSetId);

   Set srcApp = msgRef.header.application_name;

   IF FIELDNAME(msgRef.header.msid) IS NOT NULL Then
      Set msid = msgRef.header.msid;
   ELSE
      Set msid = '9997';
   END IF;
   
   Set mType = 'Unset:ATLAS_MESSAGE';
   Set uuid = UUIDASCHAR;
   
   Insert Into 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 that the flow will throw an error on an database error.
    * As part of this change the flow is being changed to do this, otherwise the message is just thrown away.
   RETURN FALSE;   
    */      
Else
   /* We have an XML message, but we do not know what it is. Lets treat is a a NONXML Message.
    */
   RETURN TRUE;
End If;

/*
 * Return FALSE - this means that everything was okay in this case. We have wired up the TRUE terminal to handle the case when we have
 * an XML message, but one that is not recognised. NB Non XML messages will cause an error because the MQINPUT node is expecting an XML
 * message.
 */
RETURN FALSE;

END;

END MODULE;
Back to top
View user's profile Send private message
shubham_057
PostPosted: Wed Mar 26, 2014 3:14 am    Post subject: Reply with quote

Novice

Joined: 24 Mar 2014
Posts: 14

Also this error is occurring because there are some special characters (manually inserted for testing purpose) in the xml messg.
But under this scenarios the mssg must be written as a blob object into the d/b but its going to backout queue.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed Mar 26, 2014 4:31 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.

As a hint for future posts

1) Please enclose actual code in [C O D E] Tags (See above). Notice how nice Kimbert's replies look to your posts and already suggested by Kimbert.

2) Please obfuscate names and other informatino that can identify the company and project etc. You never know who is reading this Public forum.
also I suspect that Simon F might not be too best pleased to see his name plastered over some 11yr old code.

I'd start by looking at the incoming message and verifying that the data and the MQMD (MQ Message Header) match in terms of CCSID.

stop the flow and browse a message with a tool that will give you the raw hex values of the data in the message. AMQSBCG is there ready and waiting for you as it is part of the WMQ Installation. Then look at the CCSID in the MQMD (or if as it seems likely in the MQRFH2 Header) and try to match the hex values of the data to the actual contents you think is in the message. There are many web sites where you can map the HEX values to a character using the CCSID.
If it turns out that the CCSID does not match the characters in the message then you will have to get the sender of the message to fix their code.

At the end of this you may become the local Character Set expert for your site.

If you have to start editiing the ESQL you might be better off by making the move from the XML Parser which when this code was written was the only XML Parser available to the more modern and far better XMLNSC one.
The error reporting in the XMLNSC parser is a lot better that the old XML one as Kimbert will no doubt concurr.
_________________
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
shubham_057
PostPosted: Wed Mar 26, 2014 6:10 am    Post subject: Reply with quote

Novice

Joined: 24 Mar 2014
Posts: 14

@smdavies99 : Thanks for looking into it.

Just to remind you we are manually inserting special characters in message body for testing purpose.
I have the incoming messages. This is the header of the incoming message:

Code:
<msg><header><application_name>IBIS</application_name><mtid>100</mtid><group_id>19916_2014-3-25</group_id><sequence_number>1</sequence_number><checksum>7140</checksum><msg_date>2014-3-25</msg_date><msg_time>12:40:20:1</msg_time><route flag="T"><node name="Test Node" step="1"><action>Test Action</action></node></route><to_q_manager>PL00</to_q_manager><to_q>IBISATLAS_TO_ACIFBROKER_02</to_q><msid>1045</msid></header><app_data>
Back to top
View user's profile Send private message
ganesh
PostPosted: Wed Mar 26, 2014 6:45 am    Post subject: Reply with quote

Master

Joined: 18 Jul 2010
Posts: 294

What is the source of your message to message broker?
On what o/s is the source system hosted?
Broker fixpack level and its o/s?
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 » Not able to write non-XML message into database
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.