Wednesday, March 26, 2014

Overwrite property in registry mount.

The following configuration section is a part of the mount configuration.

<mount path="/_system/config" overwrite="true|false|virtual">

The overwrite property can be a one of following three value

1. true

If the overwrite is true, the existing resources/collections  of the mount location will be removed before establishing the mount.

2. false

If the overwrite is false, the existing resources of the mount location will NOT  be removed before establishing the mount. But error will be logged if the same resources already exist.

3. virtual

If the overwrite is virtual, the existing resources of the mount location will be kept as it is, but mount will be added on top of it. If the existing resource is a mount or a symbolic link overwriting will not happen.

Tuesday, March 18, 2014

Mount (jdbc) WSO2 ESB registry to WSO2 Governance Registry Server with H2.

When you start the vanilla distribution of wso2 servers (WSO2 ESB , WSO2 Governance Registry , WSO2 Application Server ..etc) the default registry database is  "Embedded mode H2" . In this mode of connection it allows only one connection to the database.  Therefore if you need to mount ESB to external Governance Registry server, then it should have started with "Server mode H2"

Governance Registry Configurations:

1. Add the following  H2DatabaseConfiguration to the carbon.xml to start the Governance Registry with "Server mode H2.
        <property name="tcp" />
        <property name="tcpPort">9092</property>
        <property name="tcpAllowOthers" />        
2. Change the <url> of the default WSO2_CARBON_DB in master-datasources.xml file.
3. Start the Governance Registry server.

ESB Configurations

1. Add the following data source configuration for mount database in master-datasources.xml.
            <description>The datasource used for mounting registry databse</description>
            <definition type="RDBMS">
                    <validationQuery>SELECT 1</validationQuery>
 2. Add the following mount configuration in registry.xml
    <dbConfig name="wso2registry_mount">

    <remoteInstance url="https://localhost:9443/registry">

    <mount path="/_system/config" overwrite="true">
    <mount path="/_system/governance" overwrite="true">
3. If you are ruining ESB in same machine, change the default port <Offset> in carbon.xml  to prevent the port conflicts with Governance Registry server.

4. Start the ESB sever.

5. Logged in to the ESB server and browse the registry to verify that mount has established.

Note: We don't recommend to use the H2 as the mount database for production setup. However this method is useful for the users who don't  have rights to create the databases (MySQL , Oracle ..etc) in their corporate database system but still want to demo/test the registry space sharing/mounting.