Friday, August 29, 2008

Connecting WSO2 Registry with WSO2 ESB

The recent releases of WSO2 ESB supported the use of a back-end Registry to store various configuration bits and other related information. The support comes in two flavors, local and remote. The use of a local registry is a fact that has been broadly discussed on the user guides. But, the same does not apply when it comes to using a Remote Registry.

Setting up WSO2 Registry is as simple as installing Apache Tomcat (can be downloaded from here) and deploying the wso2registry.war file. More instructions can be found in here. Having gone through the process, you should be able to access the WSO2 Registry from http://localhost:8080/wso2registry (please note that the port may vary depending on your configuration).

Now all that it takes is to inform WSO2 ESB to make use of your registry. This can be done by adding the following info into, server.xml (located in webapps/WEB-INF/classes/conf by default):

<registry>
    <importRoot>file:registry</importRoot>
    <type>remote</type>
    <configuration>
        <url>http://localhost:8080/wso2registry</url>
        <username>admin</username>
        <password>admin</password>
    </configuration>
</registry>

Please note that the port number and the username/password might vary according to your configuration.

Now, you will have to do some other changes to your synapse.xml. I assume that you know how to setup a local registry implementation (Simple URL Registry) in WSO2 ESB. If you don't please read this. In order to use the WSO2 Registry you will need to add this configuration information:

<registry provider="org.wso2.esb.registry.WSO2Registry">
    <parameter name="root">/</parameter>
</registry>

Well that's it. You can now upload what ever documents on the WSO2 Registry and access it within WSO2 ESB.

1 comment:

Graham said...

I was wondering if you could go into a bit more detail on how setup a local registry implementation. Ive got another older tutorial but it seems a bit outdated. Thanks in advance!