|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to thow exception from Java compute node in MB V6 |
« View previous topic :: View next topic » |
Author |
Message
|
CuriCAT |
Posted: Wed Oct 11, 2006 12:49 am Post subject: How to thow exception from Java compute node in MB V6 |
|
|
 Voyager
Joined: 26 Sep 2006 Posts: 82
|
I want to thow exception from Java compute node, I am using Message Broker V6.
we can only allowed to throw MbException from the evaluate methode. How can I handle other exceptions such as IOException or User defined exceptions.
How can we throw those exceptions to the flow, I have attached error handling subflow to catch terminal of Inputnode, I want to handle these user defined exceptions there instead at java compute node.
My Code :
public class FTPTest_JavaCompute extends MbJavaComputeNode{
public void evaluate(MbMessageAssembly contact admin) throws MbException {
try{
// My code
}
catch(Exception){
// here want to handle and thow the exception to the flow
// or want to update in the Exception List
} |
|
Back to top |
|
 |
Yaroslav |
Posted: Wed Oct 11, 2006 1:06 am Post subject: |
|
|
Novice
Joined: 28 Sep 2006 Posts: 12 Location: Russia
|
As MbUserException inherited from MbException.
You may simple use operator "throw new MbUserException(...)"
in your evaluate method. _________________ IBM Certified Solution Designer WebSphere MQ V6.0
IBM Certified Solution Developer WebSphere Message Broker V6.0 |
|
Back to top |
|
 |
CuriCAT |
Posted: Wed Oct 11, 2006 1:48 am Post subject: |
|
|
 Voyager
Joined: 26 Sep 2006 Posts: 82
|
Thanks,
But how will you handle IOException as it is, you can not throw IOException, you can only throw MbException from evaluate function.
How to do this ? I am trying to access file and when there is IOException I can not trhow as it is. Instead I should only be able to thow MbException or MbUserException (as you said)
How to do this ? |
|
Back to top |
|
 |
elvis_gn |
Posted: Wed Oct 11, 2006 2:01 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi ganeshgurukkal,
Throw a User Exception and in the Text fields specify the IO Error...You cannot be creating your own ExceptionList structure...work with whats closest.
Regards. |
|
Back to top |
|
 |
CuriCAT |
Posted: Wed Oct 11, 2006 2:44 am Post subject: |
|
|
 Voyager
Joined: 26 Sep 2006 Posts: 82
|
Thanks,
I was doing the same, Still I was curious to know is there any other way. I have used as follows.
throw new MbRecoverableException("MyCustomClass","evaluate",inMessage.getRootElement().getName(),"",exception.toString(),null); |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|