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 » WMQSI 2.1 JAVA PLUGIN NODE

Post new topic  Reply to topic
 WMQSI 2.1 JAVA PLUGIN NODE « View previous topic :: View next topic » 
Author Message
danielaphex
PostPosted: Tue Feb 17, 2004 8:21 am    Post subject: WMQSI 2.1 JAVA PLUGIN NODE Reply with quote

Apprentice

Joined: 07 Apr 2003
Posts: 28

Hi to all,

After crossing by a sea of tears trying to develop a plugin node in Java (due to documentation bugs and other problems) I have the clue about the way to do it without taking into account some doubts about exception propagation in the message flow. This can be expressed as follow:

1) In the API definition of all the Exceptions (Java PlugIn exceptions) such as MbFatalException, MbRecoverableException, etc; the constructor is defined:

Quote:
MbRecoverableException(String className, String methodName, String messageSource, String messageKey, String traceText, Object[] inserts)


But no further explanation is made about the meaning of each one of this parameters.
What is the meaning and use of the parameters messageSource and
messageKey?
How could I obtain it?
What about the last parameter?
What is it used for?

2) In my plugin node I have some code appart the typycal one relevant with the MQ architecture (for example to open a file). When I control the Exceptions (not WQMSI exception) ,for example in this case the IOException, I throw a new MbRecoverableException passing the exception cause in the parameter traceText like this:

Quote:
catch(IOException ioe)
{
throw new MbRecoverableException("SendMail","evaluate","","","Exception Produced",null);
}


but, nevertheless, when I check the ExceptionList generated I obtain a following message:

Quote:
(0x1000000)Insert = (
(0x3000000)Type = 5
(0x3000000)Text = '<com.ibm.broker.plugin.MbRecoverableException class:SendMail method:evaluate source: key:message: Unable to resolve message: Source: Key: >'


But I can not understand the reason why the 'ExceptionList' (better said the Broker) is not able to resolve message.


Could anybody please help me?
Has anybody worked over this sorts of problems?
Does the exception generated by a plugin node work prooperly?

Thanks in advance,

Regards
Back to top
View user's profile Send private message
bolek
PostPosted: Wed Feb 18, 2004 7:03 am    Post subject: Re: WMQSI 2.1 JAVA PLUGIN NODE Reply with quote

Apprentice

Joined: 25 Jul 2002
Posts: 35
Location: Germany

Hi,

you can find ( indirectly ) some usefull information in WMQI Programming Guide, "Implementing a plug-in node or parser" / "Using event logging from a plug-in".
Generally, you have to package your exception messages into a standard Java resource bundle. WMQI will resolve the message using messageSource ( name of your resource bundle ), messageKey ( key in the resource bundle ) and inserts ( parameters for your exception message ), and then insert it as a single text insert into the appropriate broker exception ( I think BIP4367 ).
Back to top
View user's profile Send private message
danielaphex
PostPosted: Thu Feb 19, 2004 5:17 am    Post subject: Reply with quote

Apprentice

Joined: 07 Apr 2003
Posts: 28

Thanks very much for your help.

I was trying but It was not successful.

Quote:
WMQI will resolve the message using messageSource ( name of your resource bundle ), messageKey ( key in the resource bundle ) and inserts ( parameters for your exception message ), and then insert it as a single text insert into the appropriate broker exception ( I think BIP4367 ).


Can you please tell me the code you have used to develop this?

Regards,
Back to top
View user's profile Send private message
danielaphex
PostPosted: Thu Feb 19, 2004 8:20 am    Post subject: Reply with quote

Apprentice

Joined: 07 Apr 2003
Posts: 28

I tried what you have said and It worked!!!!!

So my friend I appreciate hugely your help...

Thanks,
Back to top
View user's profile Send private message
jpm
PostPosted: Thu Apr 08, 2004 3:27 am    Post subject: Reply with quote

Newbie

Joined: 23 Apr 2003
Posts: 6

Hi,

I am having the same problem. Please could you (Bolek, Danielaphex or anybody else who can help) post an example of the code used to create an instance of MbRecoverableException.

In particular, do you create a java.util.ResourceBundle? What do you put in the Object[]?

Many thanks,
John
Back to top
View user's profile Send private message
Mohit Gupta
PostPosted: Mon Nov 22, 2004 10:00 pm    Post subject: Reply with quote

Apprentice

Joined: 16 Sep 2004
Posts: 34

Hi,

I am also facing the same problem can anybody help me out ?

here is the code;

public void evaluate(MbMessageAssembly arg0, MbInputTerminal arg1)
throws MbException {

try
{
MbMessage msg = arg0.getMessage();
MbElement rootElement = msg.getRootElement();

byte[] msgdata = msg.getBuffer();
String data = new String(msgdata);
int pos = data.indexOf("1,");
data = data.substring(pos);
byte[] bitstream = data.getBytes();

FTPClientTest obj = new FTPClientTest();
obj.FTPMessage(
attHost,
attUserName,
attPassword,
attLocalPathFile,
attRemoteFileName,
attRemotePathFile,
attTransferType,
attFTPType,
bitstream);
}
catch(IOException ioex)
{
throw new MbRecoverableException("FTPSend","evaluate","","","IOException Produced",null);

}
catch(FTPException ftpex)
{
throw new MbRecoverableException("FTPSend","evaluate","","","FTPException Produced",null);
}
catch(Exception _ex)
{
throw new MbRecoverableException("FTPSend","evaluate","","","Exception Produced",null);
}

}
Back to top
View user's profile Send private message
Mohit Gupta
PostPosted: Tue Nov 23, 2004 4:16 am    Post subject: Reply with quote

Apprentice

Joined: 16 Sep 2004
Posts: 34

Problem is resolved!

Ignore the previous post
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Nov 23, 2004 11:39 pm    Post subject: Reply with quote

Jedi Knight

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

It'd help others if you could share your solution to this problem.
_________________
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
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » WMQSI 2.1 JAVA PLUGIN NODE
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.