Monday, February 23, 2015

How to store and read resources with WSO2 Registry API.

In this short tutorial I will show how we can store and read data from the Registry with the WSO2 Registry API. 
Registry is a content store and a meta data repository. Registry is used to store and refer SOA artifacts like services,WSDLs and configuration files. The resources stored in the Registry can be referred by a resource path.

For this example I used Local Repository which is one of the main three Registry partitions  any WSO2 carbon based product has.

Followings are the Three main Registry partitions.

1. Local repository - Use to store configuration data and runtime data local to the server. This portion of registry is not shared with multiple servers.

2. Configuration repository - Use to store product specific configurations and this registry portion can be shared with the multiple instances of the same product.

3. Governance repository  - Use to store configurations and data which is shared across the Carbon platform. This registry partition contains services,service descriptions, endpoints and data sources.

You can find the full set of operations provided by the Registry API from following documentation.

Lets see how we can store and read data from the Registry.

Adding a Resource with API.

If you are using Maven add following repository and dependencies to your pom.xml file.

Maven repository

Maven dependencies

Import following classes to access the Registry

Adding a Resource
We can set content as String, byte array or InputStream for a resource.

Reading a Resource


No comments:

Post a Comment