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 » Debugging and Trace node

Post new topic  Reply to topic
 Debugging and Trace node « View previous topic :: View next topic » 
Author Message
Gideon
PostPosted: Tue Nov 01, 2011 12:52 pm    Post subject: Debugging and Trace node Reply with quote

Chevalier

Joined: 18 Aug 2009
Posts: 403

FIRST ISSUE

I have a simple flow that does the following


Code:
                         (out)
    MQINPUT ---- Compute ---------- Trace Node ----- MQOUTPUT (Q nmaed OUT)
                 Node               to /tmp/tmp/a.1
                   |     (failure)     
                   |--------------- Trace Node ----- MQOUTPUT (Q named ERR)
                                    to /tmp/tmp/a.2

The Compute node contains the following code (this does not have a copy message header or copy message function, just a return TRUE)

Code:
CREATE COMPUTE MODULE FLOWDZE1_Compute
   CREATE FUNCTION Main() RETURNS BOOLEAN
   BEGIN

           
      RETURN TRUE;
   END;

When I sent 2 messages to this flow, the messages were written to the successful trace node

-
Code:
rwxrwxrwx  1 root root 82850 Nov  1 15:45 a.1
-rwxrwxrwx  1 root root     0 Nov  1 15:36 a.2


And both messages were written to my output queue.

The message written to the trace file was my input message sent to the flow

Code:
--- Trace Node -=-, ( ['xmlnsc' : 0x2aaae44ab660]
  (0x01000400:NamespaceDecl):                              = (
    (0x03000100:Attribute):Version  = '1.0' (CHARACTER)
    (0x03000100:Attribute):Encoding = 'UTF-8' (CHARACTER)
  )
  (0x01000000:Folder
  ..............


I thought I should not see this since I did not perform a copy message function in my compute node

Why did this happen

SECOND ISSUE

Since the message was coming through the Compute node even though I did not do a copy, I attempted to write to that message in order to pass a value to the TRACE node, so I put something like this in the Compute node:

Code:
      DECLARE xxx NAMESPACE 'http://xxx.com/xxx/xxx';
      DECLARE ci  NAMESPACE 'http://xxx.com/xxx/cxxx';
      DECLARE fi  NAMESPACE 'http://xxx.com/xxx/fxxx';
      DECLARE i INT 1;
      DECLARE j INT 1;
      DECLARE x INT 1;
      DECLARE y INT 1;

      CALL CopyMessageHeaders();
      
      -- Set up the XML declaration
      CREATE FIRSTCHILD OF OutputRoot.XMLNSC TYPE XMLNSC.XmlDeclaration;
      SET OutputRoot.XMLNSC.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Version  = InputRoot.XMLNSC.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Version;
      SET OutputRoot.XMLNSC.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Encoding = InputRoot.XMLNSC.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Encoding;
      
      -- Copy the attributes of the root element so the namespaces will be set properly
      SET   OutputRoot.XMLNSC.xxx:port.(XMLNSC.Attribute)xmlns:xxx = 'http://xxx.com/xxx/xxx';
      SET   OutputRoot.XMLNSC.xxx:port.(XMLNSC.Attribute)xmlns:ci  = 'http://xxx.com/xxx/cxxxInfo';
      SET   OutputRoot.XMLNSC.xxx:port.(XMLNSC.Attribute)xmlns:fi  = 'http://xxx.com/xxx/fxxxInfo';
      SET   OutputRoot.XMLNSC.xxx:port.(XMLNSC.Attribute)xmlns:xsi = 'http://www.w3.org/2001/XMLSchema-instance';

      -- Copy the body of the document
      SET OutputRoot.XMLNSC.xxx:port.ci:owner.ci:name      = 'Test';


However, the previous message was still copied to the trace node, and the 'test; value was not.

Why is this happening

What is the easiest way to send a short string to a trace node without copying the previous message. In other words, how do I copy the word 'test' to the trace node

Thanks
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Tue Nov 01, 2011 1:04 pm    Post subject: Reply with quote

Grand High Poobah

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

You need to check the attributes of the compute node. It will tell you what type of data it is passing to the output: message, localenvironment etc...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Gideon
PostPosted: Wed Nov 02, 2011 9:42 am    Post subject: Reply with quote

Chevalier

Joined: 18 Aug 2009
Posts: 403

using the following link as a guide:

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fac16870_.htm

I set the Compute Mode in the Compute node to

Code:
Compute mode:   Localenvironment


Then I put the following in the ESQL:

Code:
   BEGIN
      
      SET OutputLocalEnvironment.Variables.OutputLocation = 'MQ';
      
           
      RETURN TRUE;
   END;

Then I set the Trace node pattern to :

Code:
Pattern:  --- Trace Node -=-, ${Root}. 

Then I send a message to the flow, I get the following in the trace file:

Code:
--- Trace Node -=-, ( ['MQROOT' : 0x14b035e0]
  (0x01000000:Name  ):Properties = ( ['MQPROPERTYPARSER' : 0x14efa570]
    (0x03000000:NameValue):MessageSet             = 'ZPORT2' (CHARACTER)
    (0x03000000:NameValue):MessageType            = '' (CHARACTER)
    (0x03000000:NameValue):MessageFormat          = '' (CHARACTER)
    (0x03000000:NameValue):Encoding               = 273 (INTEGER)
    (0x03000000:NameValue):CodedCharSetId         = 1208 (INTEGER)
    (0x03000000:NameValue):Transactional          = FALSE (BOOLEAN)
    (0x03000000:NameValue):Persistence            = FALSE (BOOLEAN)
    (0x03000000:NameValue):CreationTime           = GMTTIMESTAMP '2011-11-02 17:30:14.260' (GMTTIMESTAMP)
    (0x03000000:NameValue):ExpirationTime         = -1 (INTEGER)
    (0x03000000:NameValue):Priority               = 4 (INTEGER)
...............


Basically it outputs the headers and the Body iof the incoming message, but I never get the variable I set in the Compute node.

Dooly enough I get the same output if I set the compute node to:

Code:
Compute mode:   Localenvironment


or to

Code:
Compute mode:   All


What should I do, and is there a better link I can learn from?

Thanks
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Wed Nov 02, 2011 10:05 am    Post subject: Reply with quote

Grand High Poobah

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

$Root in your trace will only give you what you are asking for...
The value you set in OutputLocalEnvironment is not part of $Root.

Did you try and have it also output $LocalEnvironment?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Gideon
PostPosted: Wed Nov 02, 2011 10:42 am    Post subject: Reply with quote

Chevalier

Joined: 18 Aug 2009
Posts: 403

Sorry, I was coding from this page:

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fac04840_.htm

And did not see a ${LocalEnvironment}, so I made a bad assumption.

Using the content of your last post, I found the following site

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fac16810_.htm

I Set the Compute node to

Code:
Compute Mode:      All

I set the ESQL to


Code:
   BEGIN
      
      SET OutputLocalEnvironment.Variables.OutputLocation = 'MQ';
      
           
      RETURN TRUE;
   END;

I set the Trace node to:

Code:
Pattern:  --- Local Env:${LocalEnvironment}
          --- Env:${LocalEnvironment}
          --- Excpt:${ExceptionList}
          --------------------------

I get the following results in my trace file:

Code:
--- Local Env:^M
--- Env:^M
--- Excpt:^M
--------------------------

Why did I not get an 'MQ' field in the OutputLocacation variable ?

Thanks
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Wed Nov 02, 2011 11:48 am    Post subject: Reply with quote

Grand High Poobah

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

Did you run a user trace?
What does the user trace say?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Gideon
PostPosted: Wed Nov 02, 2011 1:44 pm    Post subject: Reply with quote

Chevalier

Joined: 18 Aug 2009
Posts: 403

Thanks, that was useful.

I never did a User Trace before, very useful procedure.

Basically I saw lots of commands that were previously in my flow ESQL, but have since been deleted, like:

Code:
S E T   i   =   i   +   1 ;


Originally I had a flow, which I deleted the contents of the ESQL, and replaced it with a simple Localenvironment setting.

I double checked, and there is no ESQL existing with the command I saw in the user trace. Bascailly I am seeing the outputted message that is sent from my previous ESQL, not the new ESQL I put into the flow

Why would this happen, and what can I do to repair this?

Is there a way other than to write a new flow or to replace the Compute node with another

Why does this happen

Thanks
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Nov 02, 2011 1:53 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Did you redeploy your flow after editing your ESQL?

Did you rebuild your BAR file before redeploying your flow after editing your ESQL?
Back to top
View user's profile Send private message
Gideon
PostPosted: Wed Nov 02, 2011 2:19 pm    Post subject: Reply with quote

Chevalier

Joined: 18 Aug 2009
Posts: 403

yes I redeployed, and yes I rebuilt the BAR file.

That is evidenced by the Trace Node being operational and outputting a file (not the user trace, just the trace node file)

So my flow is executing my current and only trace node, but a previous ESQL that is no longer contained in the flow
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Wed Nov 02, 2011 8:11 pm    Post subject: Reply with quote

Grand High Poobah

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

Before rebuilding your bar flow, check that your toolkit settings are on automatic recompile, if not you have to recompile your flow before building the bar file. If you do not recompile before building the bar file, (either automatic or manual), all you are doing is building a bar file with an obsolete version of the flow...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Gideon
PostPosted: Thu Nov 03, 2011 6:51 am    Post subject: Reply with quote

Chevalier

Joined: 18 Aug 2009
Posts: 403

Yep, the Projects->Build Automatically was not set

I set it and saved the file. Everything is working now.

I can get the following output from my Trace Node

Code:
--- Local Env:( ['MQROOT' : 0x14d4c7c0]
  (0x01000000:Name):Variables = (
    (0x03000000:NameValue):OutputLocation = 'MQ' (CHARACTER)
  )


All is well. thanks for your help
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Debugging and Trace node
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.