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 » Custom Java Node- plugin

Post new topic  Reply to topic
 Custom Java Node- plugin « View previous topic :: View next topic » 
Author Message
apsy
PostPosted: Mon Oct 11, 2004 8:14 am    Post subject: Custom Java Node- plugin Reply with quote

Novice

Joined: 10 Feb 2004
Posts: 24

I have written a experimental custom Java node to read a file and load the contents into a HashMap .

Every time I change my java code , I stop my broker , export my new jar into /<wbimb installpath> /jplugin and re-start my broker.

I see that the constructor in my code gets executed.

e.g: myNode()
{ Note start time;
construct input and output terminals;
while not end of file
{
Read flat file ;
append to hashmap;
}
Note end time ;
Print out timetaken ;
}

Question 1) I see that the whole code block in the constructor gets executed twice. Why is that ?

Queston2 I wanted to use log 4 J for logging debug statements. I used the following lines of code to instantiate the log4 J within my Java Node.

PropertyConfigurator.configure("abc.properties");
dlogger = Logger.getLogger("com.sears.mds.dataLogger");

contents of abc.properties

log4j.appender.root_app1=org.apache.log4j.ConsoleAppender
log4j.logger.com.sears.dataLogger=DEBUG,dataLogger_app1
log4j.appender.root_app1.Threshold=DEBUG
log4j.appender.root_app1.layout=org.apache.log4j.PatternLayout
log4j.logger.com.text.samples.myLogger=DEBUG,dataLogger_app1
log4j.appender.dataLogger_app1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.dataLogger_app1.datePattern='.'yyyyMMdd
log4j.appender.dataLogger_app1.File=d:/logs/mds/myNodeLogger.log
log4j.appender.dataLogger_app1.layout=org.apache.log4j.PatternLayout




It seems to me like the property configurator works, but there seems to be a clash between the
mynode.properties file that gets created when I initially configured my node in the toolkit .
contents of mynode.properties
#This is a generated file.
#The values in this file have syntax: key = value
#User modifications to the values in this file will be preserved
#Wed Oct 06 09:51:37 CDT 2004
OutTerminal.out=out
myNode=myNode
InTerminal.in=in
OutTerminal.failure=failure
As a result, I get errors when I try to deploy my flow.
I tried to edit this file to include my log4j configurations. The editor would not save my changes.
Am I doing something wrong?

Question3 ) If I use MbService API to log my messages, it by default logs it to the wbimb system log. Is this an asynchronous call?.

Question 4If I wanted to re-direct the output messages to a different log , and keep the logging asynchronous, what do I do ?


Thanks
Apsy
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Oct 11, 2004 8:40 am    Post subject: Re: Custom Java Node- plugin Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

apsy wrote:

Question 1) I see that the whole code block in the constructor gets executed twice. Why is that ?

Two execution groups?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
apsy
PostPosted: Mon Oct 11, 2004 8:51 am    Post subject: Reply with quote

Novice

Joined: 10 Feb 2004
Posts: 24

Nope. Just one execution group
Back to top
View user's profile Send private message
kirani
PostPosted: Mon Oct 11, 2004 11:15 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Is this a plug-in Input node or normal processing node?

Quote:

A Java User-defined message processing node is instantiated when a broker deploys a message flow containing the user-defined message processing node. When the node is instantiated, the constructor of the message processing node’s class is called.


Do you have multiple instances set for this message flow?
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
apsy
PostPosted: Mon Oct 11, 2004 12:51 pm    Post subject: Reply with quote

Novice

Joined: 10 Feb 2004
Posts: 24

This is a message processing node.There is just one instance of this node deployed in one execution group
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Oct 11, 2004 1:11 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

apsy wrote:
This is a message processing node.There is just one instance of this node deployed in one execution group


Does that single message flow have more than one instance running?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
apsy
PostPosted: Mon Oct 11, 2004 1:14 pm    Post subject: Reply with quote

Novice

Joined: 10 Feb 2004
Posts: 24

Its one message flow, with just one running instance.
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 » Custom Java Node- plugin
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.