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 » Acessing User defined property from a user defined node

Post new topic  Reply to topic
 Acessing User defined property from a user defined node « View previous topic :: View next topic » 
Author Message
vininx
PostPosted: Tue Oct 11, 2011 2:51 am    Post subject: Acessing User defined property from a user defined node Reply with quote

Acolyte

Joined: 13 Oct 2009
Posts: 69

Hi All,
I am implemeting a user defined node and its purpose is to get the value of the user defined property and set it in the Environment.variables in the outgoing message and by this user need not use some other nodes like Compute etc...which will consume more resources. I am using Java to implement the User defeined node. Please let me know how to access the UDP of user defined node and set it in the ougoing message, Thanks.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Oct 11, 2011 4:29 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Seems overkill. Why not just read the UDPs from Compute or Java nodes directly? What is special about your custom node that cannot be done in standard Compute nodes?
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Tue Oct 11, 2011 4:55 am    Post subject: Re: Acessing User defined property from a user defined node Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

vininx wrote:
by this user need not use some other nodes like Compute etc...which will consume more resources.


But if the user's not using either a Compute node or a JCN, what's going to access the values this node of yours is putting in the message?

So given that something is going to reference these values, why doesn't this something reference the UDPs, thereby eliminating the need for your user node and the resources it will consume?

Your node sounds like a solution looking for a problem.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Oct 11, 2011 5:11 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

To be slightly more helpful than my colleagues, esteemed or otherwise, above.

The way you access a user defined property in a java user defined node is the exact same way you access a user defined property in a JavaCompute node.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Oct 11, 2011 5:15 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

mqjeff wrote:
my colleagues, esteemed or otherwise


I seem to resemble that remark.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Tue Oct 11, 2011 5:23 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

lancelotlinc wrote:
mqjeff wrote:
my colleagues, esteemed or otherwise


I seem to resemble that remark.


I was intentionally vague in the attribution.
Back to top
View user's profile Send private message
vininx
PostPosted: Tue Oct 11, 2011 6:04 am    Post subject: Acessing User defined property from a user defined node Reply with quote

Acolyte

Joined: 13 Oct 2009
Posts: 69

@Vitor
But if the user's not using either a Compute node or a JCN, what's going to access the values this node of yours is putting in the message?

Ans:- A common error logging message flow.

So given that something is going to reference these values, why doesn't this something reference the UDPs, thereby eliminating the need for your user node and the resources it will consume?

Ans:- Actually we have developed a generic common logger message flow for logging errors and exception scenarios. Any application developer will be able to use the logger message flow by adding it as a subflow. For the logger message flow to work, some variables should be set in the Environment.variables tree. In order to avoid application developers use Compute or JCN, I am developing an user defined node which will set the values for the user(this is supposed to be a common plugin) for all app developers. Since the logger message flow is generic, I cannot touch that to set the environment variables. In future, my user defined node will be expanded as per the needs of the logger message flow.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Oct 11, 2011 6:20 am    Post subject: Re: Acessing User defined property from a user defined node Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

vininx wrote:
@Vitor
But if the user's not using either a Compute node or a JCN, what's going to access the values this node of yours is putting in the message?

Ans:- A common error logging message flow.


This subflow presumably contains Compute nodes of one flavour or the other so my question stands. If you're going to respond with:

vininx wrote:
Since the logger message flow is generic, I cannot touch that to set the environment variables.


Then how is it going to reference what your node is setting up?

vininx wrote:
Actually we have developed a generic common logger message flow for logging errors and exception scenarios. Any application developer will be able to use the logger message flow by adding it as a subflow.


You and everyone else who uses WMB.

vininx wrote:
For the logger message flow to work, some variables should be set in the Environment.variables tree.


So why does the common flow reference the Environment tree not the UDP directly? Which would still prevent the developer adding anything.

vininx wrote:
In future, my user defined node will be expanded as per the needs of the logger message flow.


Why not expand the logger message flow?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
vininx
PostPosted: Tue Oct 11, 2011 6:52 am    Post subject: Acessing User defined property from a user defined node Reply with quote

Acolyte

Joined: 13 Oct 2009
Posts: 69

Please find below the logger message flow which uses environment variables...
Code:
 
Set OutputRoot.Properties.CodedCharSetId=1208;
      SET OutputRoot.MQMD = InputRoot.MQMD;
        SET OutputRoot.MQMD.Persistence=0;  -- Force the Message to be non-persistent and make MQMD the first child of OutputRoot
      SET OutputRoot.MQRFH2.(MQRFH2.Field)Format='MQSTR   ';

      
      set OutputRoot.XMLNSC.Log.EventDateTime = SUBSTRING(CAST(CURRENT_TIMESTAMP AS CHAR) from 12 for 24);
      SET OutputRoot.MQRFH2.usr.AppCode=COALESCE(AppCode,'XXX');
      SET OutputRoot.XMLNSC.Log.AppCode=COALESCE(AppCode, 'XXX');
      SET OutputRoot.MQRFH2.usr.AttnCode=COALESCE([b]Environment.Variables.ESB.AttnCode[/b],'I');
      SET OutputRoot.XMLNSC.Log.AttnCode=COALESCE([b]Environment.Variables.ESB.AttnCode[/b], 'I');
      SET OutputRoot.XMLNSC.Log.EventCode=''; -- create placeholder, fill in the value later.
      SET OutputRoot.MQRFH2.usr.Broker=BrokerName;
      SET OutputRoot.MQRFH2.usr.ExecGrp=ExecutionGroupLabel;
      SET OutputRoot.MQRFH2.usr.FlowName=MessageFlowLabel;
      SET OutputRoot.MQRFH2.usr.SourceQueue=InputRoot.MQMD.SourceQueue;
      set OutputRoot.MQRFH2.usr.LogText=[b]Environment.Variables.ESB.LogText[/b];
      set OutputRoot.XMLNSC.Log.Status=Environment.Variables.ESB.Status;
      set OutputRoot.XMLNSC.Log.Broker=BrokerName;
      set OutputRoot.XMLNSC.Log.ExecGrp=ExecutionGroupLabel;
      set OutputRoot.XMLNSC.Log.FlowName=MessageFlowLabel;
      set OutputRoot.XMLNSC.Log.LogText=[b]Environment.Variables.ESB.LogText[/b];
      SET OutputRoot.MQRFH2.usr.Format=InputRoot.MQMD.Format;
      SET OutputRoot.MQMD.Format='MQHRF2  ';  -- Remember exactly 8 bytes long
      SET OutputRoot.MQRFH2.(MQRFH2.Field)Version=2;
      SET OutputRoot.MQRFH2.(MQRFH2.Field)CodedCharSetId=1208;
      SET OutputRoot.MQRFH2.usr.Status=Environment.Variables.ESB.Status;

      set OutputRoot.XMLNSC.Log.ExceptionData = Environment.Variables.BrokerData;
      IF NOT Exists(OutputRoot.XMLNSC.Log.ExceptionData[]) THEN
         SET OutputRoot.XMLNSC.Log.ExceptionData='';
         SET OutputRoot.XMLNSC.Log.EventCode=COALESCE(Environment.Variables.ESB.EventCode, '0000');
      ELSE
         -- If the message flow provided an EventCode, then use that, if not,
         --   then use the error Number from the exception list if one exists
         SET OutputRoot.XMLNSC.Log.EventCode=COALESCE([b]Environment.Variables.ESB.EventCode[/b], OutputRoot.XMLNSC.Log.ExceptionData.LastError.Number, '0000');
      END IF;
      SET OutputRoot.MQRFH2.usr.EventCode=OutputRoot.XMLNSC.Log.EventCode;
      IF UPPER(SaveMessage) = 'TRUE' OR ((UPPER(SaveMessage) = 'ERROR') AND Exists(OutputRoot.XMLNSC.Log.ExceptionData.LastError[])) THEN
         SET OutputRoot.XMLNSC.Log.OriginalMessage.(XML.CDataSection) = CAST(msgbody AS CHAR CCSID 1208);
         SET OutputRoot.MQRFH2.usr.SaveMessage='TRUE';
      ELSE
         SET OutputRoot.MQRFH2.usr.SaveMessage=UPPER(SaveMessage);
         SET OutputRoot.XMLNSC.Log.OriginalMessage = '';
      END IF;
           Set OutputRoot.Properties.CodedCharSetId=1208;
         SET OutputRoot.MQMD = InputRoot.MQMD;
           SET OutputRoot.MQMD.Persistence=0;  -- Force the Message to be non-persistent and make MQMD the first child of OutputRoot
         SET OutputRoot.MQRFH2.(MQRFH2.Field)Format='MQSTR   ';
   
         SET OutputRoot.XMLNSC.Log='';
         set OutputRoot.XMLNSC.Log.LogVersion='1.0';
         SET OutputRoot.MQRFH2.usr.LogVersion='1.0';
         set OutputRoot.XMLNSC.Log.EventDateTime = SUBSTRING(CAST(CURRENT_TIMESTAMP AS CHAR) from 12 for 24);
         SET OutputRoot.MQRFH2.usr.AppCode=COALESCE(AppCode,'XXX');
         SET OutputRoot.XMLNSC.Log.AppCode=COALESCE(AppCode, 'XXX');
         SET OutputRoot.MQRFH2.usr.AttnCode=COALESCE([b]Environment.Variables.ESB.AttnCode[/b],'I');
         SET OutputRoot.XMLNSC.Log.AttnCode=COALESCE([b]Environment.Variables.ESB.AttnCode[/b], 'I');
         SET OutputRoot.XMLNSC.Log.EventCode=''; -- create placeholder, fill in the value later.
         SET OutputRoot.MQRFH2.usr.Broker=BrokerName;
         SET OutputRoot.MQRFH2.usr.ExecGrp=ExecutionGroupLabel;
         SET OutputRoot.MQRFH2.usr.FlowName=MessageFlowLabel;
         SET OutputRoot.MQRFH2.usr.SourceQueue=InputRoot.MQMD.SourceQueue;
         set OutputRoot.MQRFH2.usr.LogText=[b]Environment.Variables.ESB.LogText[/b];
         set OutputRoot.XMLNSC.Log.Status=Environment.Variables.ESB.Status;
         set OutputRoot.XMLNSC.Log.Broker=BrokerName;
         set OutputRoot.XMLNSC.Log.ExecGrp=ExecutionGroupLabel;
         set OutputRoot.XMLNSC.Log.FlowName=MessageFlowLabel;
         set OutputRoot.XMLNSC.Log.LogText=[b]Environment.Variables.ESB.LogText[/b];
         SET OutputRoot.MQRFH2.usr.Format=InputRoot.MQMD.Format;
         SET OutputRoot.MQMD.Format='MQHRF2  ';  -- Remember exactly 8 bytes long
         SET OutputRoot.MQRFH2.(MQRFH2.Field)Version=2;
         SET OutputRoot.MQRFH2.(MQRFH2.Field)CodedCharSetId=1208;
         SET OutputRoot.MQRFH2.usr.Status=Environment.Variables.ESB.Status;
      END IF;
      RETURN TRUE;



The items which are bolded are expected to be set in the incoming message's environment and this should be done by the user defined node. This is how the logger flow uses the Environment variables of the incoming message. If I am able to populate the values of variables like AttnCode, LogText etc... from my user defined node (java implementation), then I will be using UDP to set the above properties.

If I am going to expand the logger flow then how it could be done.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Oct 11, 2011 7:00 am    Post subject: Re: Acessing User defined property from a user defined node Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

vininx wrote:
If I am going to expand the logger flow then how it could be done.


By reading the required UDP directly. Or from either for backward compatibility with existing flows if you prefer.

It's a standard enough design for a broker error subflow.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
vininx
PostPosted: Tue Oct 11, 2011 7:16 am    Post subject: Acessing User defined property from a user defined node Reply with quote

Acolyte

Joined: 13 Oct 2009
Posts: 69

So I am going to read UDP directly then will the application developer set the UDP's in a Compute or JCN of their main message flow?

Or from either for backward compatibility with existing flows if you prefer.

this means? please advise.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Oct 11, 2011 7:52 am    Post subject: Re: Acessing User defined property from a user defined node Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

vininx wrote:
So I am going to read UDP directly then will the application developer set the UDP's in a Compute or JCN of their main message flow?


Stop.

Think.

You have already decided that these values will be set by a UDP.

This means you have already determined how these values will be set.

So why are you asking us how these values will be set?
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Oct 11, 2011 9:09 am    Post subject: Re: Acessing User defined property from a user defined node Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mqjeff wrote:
vininx wrote:
So I am going to read UDP directly then will the application developer set the UDP's in a Compute or JCN of their main message flow?


Stop.

Think.

You have already decided that these values will be set by a UDP.

This means you have already determined how these values will be set.

So why are you asking us how these values will be set?



_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Acessing User defined property from a user defined 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.