0

In Tibco, sometimes warnings are printed to the console, e.g.:

2014-06-25 18:13:22 RV: TIB/Rendezvous Error Not Handled by Process: {ADV_CLASS="WARN" ADV_SOURCE="RVCM" ADV_NAME="REGISTRATION.NOT_CERTIFIED.cm.test.subject" subject="cm.test.subject" sender="cm.sender.cmname"}

I am using the .NET wrappers for Tibco. It appears as if these errors are not actually making it into the .NET, and they can't be caught with try/catch so they can be handled appropriately.

Is there any way to handle this error in .NET? Perhaps some method of registering a handler to handle errors such as this? Or alternatively, is there a method to redirect these warnings into a sink other than the console, e.g. a log file?

Contango
  • 76,540
  • 58
  • 260
  • 305

1 Answers1

0

The solution is to add a "catch all" handler.

The current subject that I was listening to was:

private readonly string _subjectDeliveryConfirm = "_RV.INFO.RVCM.DELIVERY.CONFIRM.>";

To add a catch all, add another listener on:

private readonly string _subjectDeliveryGlobal = ">";

When you add a new listener, remember to use a separate Listener concrete class per listener, or else Tibco will mysteriously stop working after the first message (see the demo code for how to create multiple listeners).

_confirmListener1 = new Listener(Queue.Default, _netTransport, _subjectDeliveryConfirm, null);
_confirmListener1.MessageReceived += new MessageReceivedEventHandler(OnCertifiedMessageConfirmed);

// Subscribe to error messages, in particular error messages related to remote listener processes
// disappearing.
_confirmListener2 = new Listener(Queue.Default, _netTransport, _subjectDeliveryGlobal, null);
_confirmListener2.MessageReceived += new MessageReceivedEventHandler(OnTibcoCatchAll);

There is lots of sample C# code in the \src\ directory for the Tibco install that illustrates the techniques shown above.

Contango
  • 76,540
  • 58
  • 260
  • 305
  • Careful - by adding a "Catch All" handler, you end up subscribing to all Tibco messages on the entire network. Rather than adding a catch all, add individual catchers for each type of unhandled message that could realistically occur, and limit the subject to messages you are interested in. – Contango Jan 13 '16 at 13:38