TIBCO Adapter SDK provides an advisory methodology for developers and end users to report or listen to advisory messages generated by TIBCO Adapters and TIBCO Rendezvous.
Both TIBCO Rendezvous and the TIBCO Adapter SDK software present asynchronous advisory messages to custom adapters based on the SDK. Advisory messages indicate errors, warnings, and other information.
In contrast to status codes, which indicate success or failure within a specific TIBCO Adapter SDK call, asynchronous advisory messages notify custom adapters of events that occur
outside of the adapter’s direct flow of control. For example, the adapter is processing inbound messages too slowly, causing the TIBCO Rendezvous daemon’s message queue to overflow.
For example, the subject _RV.*.SYSTEM.> matches all advisories related to TIBCO Rendezvous communications. Programs can also listen for specific advisories. Where the advisory becomes available depends on whether they are related to a transport.
To handle advisories, a custom adapter can instantiate MAdvisory directly and use the default advisory handling capabilities, or create a custom advisory listener.
The SDK provides a default advisory listener that reports advisory messages being collected to the
MTrace object. The advisory listener can listen to advisory messages from the sources listed in
Table 32.
A typical usage scenario is to have an application listen to TIBCO Rendezvous error advisories such as
_RV.ERROR.>. Using a simple configuration with the default advisory listener, any TIBCO Rendezvous error would be routed directly to the
errorRole of the SDK
MTrace object.
You can replace the SDK default advisory listener with a custom advisory listener. For example, a custom advisory listener can be used to handle
_RV.RVCM.COLLISION. In this case, the application might need to take specific action. To extend the default behavior, you can create a subclass that inherits
MAdvisoryListener and explicitly calls the superclass callback.
User advisories are intended for situations where there is no other way of notifying internal code that an unusual situation has occurred. For example, in cases where an API is using the SDK to offer services, it is possible that exceptions cannot be thrown when errors occur. It may be appropriate to send a user-generated advisory under these circumstances.
_SDK.<class>.<category>.<name>
_SDK.<class>.<category>.<subject suffix>
Table 33 lists the message fields and descriptions.
|
|
|
ERROR—problem is severe and not repairable.
WARN—problem exists during the operation but the program managed to resolve the problem. Undesirable side effects might occur.
INFO—information that may be of interest to the user. SDK takes no action. It only detects these conditions and reports to the users.
|
|
RPC—operations-related advisory messages
USER—user-reported advisory messages
|
|
|
|
|
Advisory messages are free-form. They are attached to an MTree to be sent out. All SDK advisory messages are wrapped into an
MTree and sent to the advisory event listener. The advisory event mechanism delivers messages among the threads of a program and does not go into the network.
Use the MAdvisory::send() method for user-defined advisories.
,"Insert operation failed
,"remoteLoggingSession" );
In Java, use the MAdvisory.send() method, as in the following example:
"Insert operation failed",