Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info
iconfalse

Message Receiver is one of many well-defined extension points supported by the WSO2 Governance Registry. Read more on Supported Extension Points for a complete list of extension points supported by WSO2 Governance Registry.

WSO2 Governance Registry generates events for each significant registry operation. Through the Management Console and through APIs, you can create subscriptions to these events. WSO2 Governance Registry can publish notifications to external or internal endpoints. On the other hand, WSO2 Governance Registry contains an Apache Axis2 based runtime as a part of the WSO2 Carbon Framework. You can deploy web services on this runtime, which can be used as internal endpoints to receive notifications generated on the WSO2 Governance Registry. A Message Receiver is an extension mechanism of Apache Axis2 which allows service authors to define how message processing should happen within a service endpoint. Using a message receiver you can implement an endpoint without physically requiring an implementation class for your service. This makes it much easier for us to very easily develop event subscribers.

...

This sample is similar to the Statistics Collector Sample and uses the same BAM Toolbox.

Once successfully deployed this sample will forward notification generated on WSO2 Governance Registry to the WSO2 Business Activity Monitor. We will be reusing the code of the Handler Sample in this example. This sample requires Apache Maven and WSO2 Business Activity Monitor. See Installing Apache Maven for Governance Registry on Windows or Installing Apache Maven for Governance Registry on Linux. Also see Installing Business Activity Monitor on Windows from Binary Distribution or Installing  Business Activity Monitor  on Linux and Solaris from Binary Distribution.

Instructions

1. Open to BAM_HOME/ repository/conf/carbon.xml and set the port offset to 1.

...

2. Start the WSO2 Business Activity Monitor. See Installing Business Activity Monitor on Windows from Binary Distribution or Installing  Business Activity Monitor  on Linux and Solaris from Binary Distribution.

3. Deploy the KPI_Registry_Activity.tbox BAM Toolbox to WSO2 Business Activity Monitor.

...

Code Block
languagehtml/xml
<?xml version="1.0" encoding="UTF-8"?>
<serviceGroup>
    <service name="Subscriber" scope="transportsession">
        <transports>
            <transport>http</transport>
        </transports>
        <operation name="receive">
            <actionMapping>http://ws.apache.org/ws/2007/05/eventing-extended/Publish</actionMapping>
            <messageReceiver
                    mep="http://www.w3.org/2004/08/wsdl/in-only"
                    class="org.wso2.carbon.registry.samples.receiver.SampleMessageReceiver" />
        </operation>
    </service>
</serviceGroup>

...

Info
titleNote

The command mvn clean install will trigger an Apache Maven Build in your command line. This requires you having installed Apache Maven. See Installing Apache Maven for Governance Registry on Windows or Installing Apache Maven for Governance Registry on Linux.

A successful run of Apache Maven will generate a report similar to the following:

...

11. Start the server and observe the command prompt. See Starting Governance Registry Management Console Installing on Windows or Starting Governance Registry Management Console Installing on Linux and Solaris.

You should also observe a log similar to the following explaining that your Message Receiver was successfully deployed.

...

13. Now perform various operations on the registry such such Adding/Updating Resources, Setting Properties etc. This should generate notifications which will then be forwarded for BAM. You should see lines similar to the following printed on your command prompt, which indicates that you events were successfully generated. For best results, create multiple user accounts and log in using different credentials while you perform operations.

...