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 » Dynamic message logging

Post new topic  Reply to topic
 Dynamic message logging « View previous topic :: View next topic » 
Author Message
bkteoh
PostPosted: Sun Oct 14, 2012 11:16 pm    Post subject: Dynamic message logging Reply with quote

Newbie

Joined: 14 Oct 2012
Posts: 2

Hi all,

I am trying to implement dynamic message logging.
I have a database table that stores below.

SERVICE_NAME | COL1 | COL2
==============================================================================
GETCUSTOMER | InputRoot.XMLNSC.LOGMSG.CUST.NAME | InputRoot.XMLNSC.LOGMSG.CUST.SSN

During runtime, I will select the appropriate message element to be logged based on service name from the table above. This values should refer to the actual element in the message tree.

Based on the input XML. I was expecting the actual values to be stored.

<LOGMSG>
<CUST>
<NAME>XXXX</NAME>
<SSN>YYYY</SSN>
</CUST>
</LOGMSG>
Instead, BROKER will store the values as is - InputRoot.XMLNSC.LOGMSG.CUST.NAME and InputRoot.XMLNSC.LOGMSG.CUST.SSN to the LOG_TBL table.
I've tried various ways but to no avail.

1) APPROACH 1
INSERT INTO Database.LOG_TBL(C1, C2)
VALUES(Environment.Variables.CONFIG[1].COL1, Environment.Variables.CONFIG[1].COL2);

2) APPROACH 2
DECLARE refcol1 REFERENCE TO Environment.Variables.CONFIG[1].COL1;
DECLARE refcol2 REFERENCE TO Environment.Variables.CONFIG[1].COL2;
INSERT INTO Database.LOG_TBL(C1, C2) VALUES(refcol1, refcol2)

Could anyone shed some light on the above.

Environment:
WebSphere Message Broker V8
AIX 6.1

Thank you.
Back to top
View user's profile Send private message
Gemz
PostPosted: Sun Oct 14, 2012 11:48 pm    Post subject: Reply with quote

Centurion

Joined: 14 Jan 2008
Posts: 124

Hi bktoeh,

Try with EVAL function to get the value from XPATH...

Code:
INSERT INTO Database.LOG_TBL(C1, C2)
VALUES(EVAL(Environment.Variables.CONFIG[1].COL1), EVAL(Environment.Variables.CONFIG[1].COL2));

_________________
GemZ
"An expert is one who knows more and more about less and less until he knows absolutely everything about nothing...."
Back to top
View user's profile Send private message
McueMart
PostPosted: Mon Oct 15, 2012 12:51 am    Post subject: Reply with quote

Chevalier

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

What does your SET statement look like when you are setting the values of

Code:
Environment.Variables.CONFIG[1].COL1
Environment.Variables.CONFIG[1].COL2


?
Back to top
View user's profile Send private message
bkteoh
PostPosted: Mon Oct 15, 2012 2:23 am    Post subject: Reply with quote

Newbie

Joined: 14 Oct 2012
Posts: 2

Gemz wrote:
Hi bktoeh,

Try with EVAL function to get the value from XPATH...

Code:
INSERT INTO Database.LOG_TBL(C1, C2)
VALUES(EVAL(Environment.Variables.CONFIG[1].COL1), EVAL(Environment.Variables.CONFIG[1].COL2));


Hi Gemz,

Your suggestion worked. It is getting the actual values now.
Million thanks.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Oct 15, 2012 2:47 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

EVAL is costly in CPU.

I would personally solve this problem by storing an XPath expression instead of an ESQL path, and then using a short Java procedure to evaluate the XPath against the message tree.

I do not claim this is less costly in CPU.

I would consider using SELECT in ESQL instead of using EVAL to resolve the field references. I do not claim that I've done this, however.
Back to top
View user's profile Send private message
Gemz
PostPosted: Mon Oct 15, 2012 3:11 am    Post subject: Reply with quote

Centurion

Joined: 14 Jan 2008
Posts: 124

Hi mqjeff,

Since the XPATH is in config table and it varies for each SERVICE_NAME.
Any hints to use SELECT instead of EVAL?
_________________
GemZ
"An expert is one who knows more and more about less and less until he knows absolutely everything about nothing...."
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Oct 15, 2012 3:18 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Gemz wrote:
Hi mqjeff,

Since the XPATH is in config table and it varies for each SERVICE_NAME.
Any hints to use SELECT instead of EVAL?


Yes, you would populate the config table with the xpath expression and then pass that into your java procedure.

As I said, I've not tried using SELECT to do this kind of thing, but it strikes me as *possible*. Something vaguely like
Code:
select Environment.Variables.CONFIG[1].COL1,Environment.Variables.CONFIG[1].COL2 from InputRoot


But thinking about it a bit more, that probably won't work. ESQL select always needs a database reference, so it would have to be something like "T.Environment.Variables.CONFIG[1].COL1" and that won't parse. Never mind.
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 » Dynamic message logging
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.