Posted: Thu Oct 01, 2009 9:04 pm Post subject: Calling a static Method in a JAR file
Newbie
Joined: 01 Oct 2009 Posts: 1
Does anyone see a problem in calling a static method in a JAR file from a compute node. The JAR method posts a message into a JMS queue and then waits on another queue for the reply based on a correlation ID. I know there is a JMSQueue node in WMB but I am interested to know if there is a problem doing the logic in a Java JAR file. Please advise.
Posted: Fri Oct 02, 2009 7:17 am Post subject: Re: Calling a static Method in a JAR file
Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
j_syed wrote:
I know there is a JMSQueue node in WMB but I am interested to know if there is a problem doing the logic in a Java JAR file. Please advise.
As a new poster, I'll warn you my Java is a bit dubious, so bear that in mind.
Problems I can see:
- you're reinventing the wheel; why not let WMB manage this? It's why you're paying the license fee for the software
- you could have problems if there are multiple threads running. Remember that WMB doesn't run in a JVM and spins up one for the compute node
- how does this method integrate with WMB's transactional control?
- how does this method signal WMB that a reply has not bee received, so that the flow can respond accordingly?
There may be other problems; not all of these may be problems. _________________ Honesty is the best policy.
Insanity is the best defence.
Posted: Fri Oct 02, 2009 7:38 am Post subject: Re: Calling a static Method in a JAR file
Grand Master
Joined: 25 Jun 2008 Posts: 17447
Vitor wrote:
- you could have problems if there are multiple threads running. Remember that WMB doesn't run in a JVM and spins up one for the compute node
No, that's not true.
Large portions of WMB these days are written in Java in the first place. Every EG is both a C++ Runtime and a JVM.
You certainly *can* use JMS from a JavaCompute node or from a static method called from a compute node.
But all of the rest of Vitor's responses do apply for why you shouldn't do this. The only reasonable cause for doing so is if you need to Get a message from a JMS queue in the middle of a flow - as there is not currently a JMSGet node.
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