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 » Doubt on Calling a custom Java Method from Message Flow.

Post new topic  Reply to topic
 Doubt on Calling a custom Java Method from Message Flow. « View previous topic :: View next topic » 
Author Message
kash3338
PostPosted: Tue Jun 09, 2009 5:05 am    Post subject: Doubt on Calling a custom Java Method from Message Flow. Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

Hi,

I have a scenario where in i have to write and call a Java method in my flow, which is the better way of doing it?

Should i go for Java Compute Node and write my method in that or should i write a wrapper Java class where in i write the java method and invoke the method from ESQL code?

Which is a better approch or is there any advantage of taking any particular approch in this?
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Tue Jun 09, 2009 5:31 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

If the java method is small, and can use straight Java types as input and output and does not need to know about the message tree at all, then it is okay and reasonable to call it from ESQL.

If the Java method is anything more complex than that, it should be invoked from an appropriately named JavaCompute node.
Back to top
View user's profile Send private message
mqseries0209
PostPosted: Tue Jun 09, 2009 5:39 am    Post subject: Reply with quote

Voyager

Joined: 30 Mar 2006
Posts: 90

Either way you need a java project and/or dependent jar files to be associated to the broker project.

Two cases:

1) If you already have a predefined set of common classes and you want to define your java method there, then go with calling JAVA from ESQL.
Also incase if you are handling most of the transformations or parsing in ESQL.

2) If the Java code you are writing is entirely flow specific and need not be shared by other projects, then go with the JAVA compute node.

just my 2 cents
_________________
IBM Certified Solution Developer - WebSphere Message Broker V6.1

IBM Certified Solution Developer - WebSphere Integration Developer V6.0
Back to top
View user's profile Send private message
broker_new
PostPosted: Tue Jun 09, 2009 11:36 am    Post subject: Reply with quote

Yatiri

Joined: 30 Nov 2006
Posts: 614
Location: Washington DC

If we use a Java Compute Node will there be any performance (CPU or Memory usage) issues.

Lets take the example of reading a 4GB file and processing it (WMB v6.0).
We are calling the Java method from ESQL to process the records from a flat file. I am in the process of embedding the same method into a JCN and check which is the best. Can you guys let us know which would be the best option in this scenario
_________________
IBM ->Let's build a smarter planet
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Tue Jun 09, 2009 11:49 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

Dont forget that Java methods called from ESQL cannot throw exceptions but you can throw exceptions from a Java Compute node. This could help sway decisions about the best approach.
Back to top
View user's profile Send private message
mqseries0209
PostPosted: Tue Jun 09, 2009 12:23 pm    Post subject: Reply with quote

Voyager

Joined: 30 Mar 2006
Posts: 90

Quote:
If we use a Java Compute Node will there be any performance (CPU or Memory usage) issues.

Lets take the example of reading a 4GB file and processing it (WMB v6.0).
We are calling the Java method from ESQL to process the records from a flat file. I am in the process of embedding the same method into a JCN and check which is the best. Can you guys let us know which would be the best option in this scenario


I think it depends on how u r designing the flow and how u r processing the 4 GB file.
are you using FileInputNode or planning to process using Java compute Java I/O ?
If fileInputNode then:
each line as saperate record ?
fixed length processing ?
Parsed record sequence processing ?
read entire 4GB and process the whole file at a time ?

Its better to search this forum for large file processing ... I remember lot of discussions on similar questions and if you dont find any proper answer open a new thread with specific question.
_________________
IBM Certified Solution Developer - WebSphere Message Broker V6.1

IBM Certified Solution Developer - WebSphere Integration Developer V6.0
Back to top
View user's profile Send private message
broker_new
PostPosted: Tue Jun 09, 2009 12:40 pm    Post subject: Reply with quote

Yatiri

Joined: 30 Nov 2006
Posts: 614
Location: Washington DC

As we are still hanging around Version 6.0 we are using JCN to read the file.
We are going to test the performance of calling Java vs using JCN.

At the same time we are trying to process the same file using the FileInputNode for the environment which we are newly building, we increased the JVMHeapSize and set the environment variable which is consuming more CPU and memory.
_________________
IBM ->Let's build a smarter planet
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 » Doubt on Calling a custom Java Method from Message Flow.
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.