Saturday, November 26, 2011

OSB custom reporting provider

Here an example:
http://www.oracle.com/technetwork/middleware/service-bus/learnmore/index.html

download link:
http://java.net/projects/oracleservicebus1031/downloads/download/SAMPLE-REPORTPROVIDER.zip


Here an interesting presentation http://www.slideshare.net/guest6070853/osb-bam-integration

In a nutshell this is what I understand:

a Reporting Provider should implement a com.bea.wli.reporting.ReportingDataHandler

public interface ReportingDataHandler
{

    public abstract void handle(XmlObject xmlobject, String s)
        throws Exception;

    public abstract void handle(XmlObject xmlobject, InputStream inputstream)
        throws Exception;

    public abstract void handle(XmlObject xmlobject, XmlObject xmlobject1)
        throws Exception;

    public abstract void handle(XmlObject xmlobject, XmlTokenSource xmltokensource)
        throws Exception;

    public abstract void handle(XmlObject xmlobject, Serializable serializable)
        throws Exception;

    public abstract void close();

    public abstract void flush();
}



apparently you only need to implement 3 handle methods:
handle( XmlObject metadata, String str )
void handle( XmlObject metadata, InputStream is )
handle( XmlObject metadata, XmlObject data )

and close() and flush()

(see the CustomReportDataFileProvider associated with the ZIP file above)


The implementation seems quite straightforward.



The OOTB JMS Report Provider uses a
com.bea.wli.reporting.jmsprovider.init.JmsReportingDataHandler implementation,
which uses wli.reporting.jmsprovider.ConnectionFactory and wli.reporting.jmsprovider.queue

Interestingly, the JmsReportingDataHandler suspends the Transaction if there is a non-XA transaction in course.


For the OOTB JMS Reporting provider:

if the Proxy Service where you use the Report action has "Transaction Required" = true, and the Tx fails (reply with error, or no reply), then the Report JMS message will not be produced.

if the Proxy Service where you use the Report action has "Transaction Required" = false, the Report JMS message will be produced no matter what.
See also http://jvzoggel.wordpress.com/2012/02/15/oracle-service-bus-logging-tracing-iii-create-custom-report-provider/ and http://docs.oracle.com/cd/E21764_01/doc.1111/e15867/reporting.htm and http://biemond.blogspot.ch/2013/06/custom-osb-reporting-provider.html
The classes involved in persisting the data in the WLI tables are:
com\bea\wli\reporting\jmsprovider\runtime\MDBMessageReporting
com\bea\wli\reporting\jmsprovider\runtime\ReportingDataAccessImpl
com\bea\wli\reporting\jmsprovider\utils\StatementFactory




No comments: