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 » Java Input Node

Post new topic  Reply to topic
 Java Input Node « View previous topic :: View next topic » 
Author Message
marco
PostPosted: Mon Aug 22, 2005 6:19 am    Post subject: Java Input Node Reply with quote

Apprentice

Joined: 16 Feb 2004
Posts: 46

Hi,

does anyone have an efficient & elegant way to handle an MbBrokerException ?
Currently I just log that there was an error and try to push the message to the failure terminal.

Tx
Marco
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Aug 22, 2005 6:24 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I guess this depends on what you mean by "handle".

In my opinion, an input node should make sure to produce as much information as possible about failures with the input source in question and try to make that information as useful as possible. So, for example, returning the input source error message and etc.

Also, the docs for MbBrokerException says
Quote:
An MbBrokerException is thrown when an interal error occurs in the broker. Normal MbBrokerExceptions are not caught and will be passed back to the broker. However, if they are caught by user code they must be rethrown to the broker for additional error recovery to be performed.
(not my emphasis)
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
recallsunny
PostPosted: Mon Aug 22, 2005 9:13 am    Post subject: Reply with quote

Disciple

Joined: 15 Jun 2005
Posts: 163
Location: Massachusetts

The way we do it is, Log the complete Exception trace to a Log file using apache-log4j and then throw the exception back to the broker for any additional error recovery steps.

We have a process monitoring the Log file for further notifications/page's.
Back to top
View user's profile Send private message
marco
PostPosted: Wed Aug 24, 2005 12:00 am    Post subject: Reply with quote

Apprentice

Joined: 16 Feb 2004
Posts: 46

Tx for the input and sorry for the late reaction ...


Throw the exception seems like the perfect thing to do, but how can I do this ? The signature of the run method only allows to throw an MbException

public synchronized int run(MbMessageAssembly assembly) throws MbException
Back to top
View user's profile Send private message
marco
PostPosted: Wed Aug 24, 2005 1:23 am    Post subject: Reply with quote

Apprentice

Joined: 16 Feb 2004
Posts: 46

I just now tried it like this :

catch(MbBrokerException mbbrkex)
{
log("MbBrokerException occured : "+mbbrkex.getMessage());

if (catchTerminal.isAttached())
{
catchTerminal.propagate(newMsgAssembly);
log(" Message propagated to catch terminal ");
}
throw mbbrkex;
}

it seems to work, but I'm not getting the exception tree in the catch handling.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Aug 24, 2005 3:15 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Do you get "Message propagated to catch terminal" in your log?

Did you augment newMsgAssembly with the exception tree?

Maybe you should just throw the exception and let the broker propagate to the catch terminal.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
marco
PostPosted: Wed Aug 24, 2005 4:49 am    Post subject: Reply with quote

Apprentice

Joined: 16 Feb 2004
Posts: 46

Indeed,
just catching and rethrowing the exception did the trick !!!

The broker automatically propagates to the catch terminal.

Thanks !!!!


I have a small side-question, when getting a message from a queue, with my own inputnode, I just can't seem to put the message on an outputQueue with the "pass-all" option.
"Set all" works perfectly, but I just think it's odd, because I open the queue correctly :
openOptions = MQC.MQOO_INPUT_AS_Q_DEF+MQC.MQOO_SAVE_ALL_CONTEXT+MQC.MQOO_FAIL_IF_QUIESCING;

Has anyone seen this before ?
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 » Java Input 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.