Author |
Message
|
kash3338 |
Posted: Tue Jun 09, 2009 5:05 am Post subject: Doubt on Calling a custom Java Method from Message Flow. |
|
|
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 |
|
 |
mqjeff |
Posted: Tue Jun 09, 2009 5:31 am Post subject: |
|
|
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 |
|
 |
mqseries0209 |
Posted: Tue Jun 09, 2009 5:39 am Post subject: |
|
|
 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 |
|
 |
broker_new |
Posted: Tue Jun 09, 2009 11:36 am Post subject: |
|
|
 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 |
|
 |
WMBDEV1 |
Posted: Tue Jun 09, 2009 11:49 am Post subject: |
|
|
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 |
|
 |
mqseries0209 |
Posted: Tue Jun 09, 2009 12:23 pm Post subject: |
|
|
 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 |
|
 |
broker_new |
Posted: Tue Jun 09, 2009 12:40 pm Post subject: |
|
|
 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 |
|
 |
|