How do I configure Storage Managers of Sandesha2 ?

Archived Content
This article is provided for historical perspective only, and may not reflect current conditions. Please refer to relevant product page for more up-to-date product information and resources.
  • By Chamikara Jayalath
  • 20 Jun, 2006

Both types of StorageManagers implement the same set of interfaces. So the difference comes in the way they are implemented.

InMemory Storage Managers are expected to give a fast in-memory storage mechanism while Persistent Storage Managers are expected to store the data in a persistent manner, most probably in a database.

In Sandesha2 module.xml you can mention the two Storage Manager classes as given in the example below.

   <wsp:Policy xmlns:wsp="https://schemas.xmlsoap.org/ws/2004/09/policy" >
<!-- Other policies -->
<wsrm:StorageManagers>

<wsrm:InMemoryStorageManager>
org.apache.sandesha2.storage.inmemory.InMemoryStorageManager
</wsrm:InMemoryStorageManager>

<wsrm:PermanentStorageManager>
com.wso2.sandesha2.storage.persistent.hibernate.PersistentStorageManager
</wsrm:PermanentStorageManager>

</wsrm:StorageManagers>
</wsp:Policy>

Sandesha2 will load both the Storage Managers in the module initialization. Note that this is currently a system wide property. Therefore Sandesha2 will pick one storage Manager as the affective one when the system starts.

If you want Sandesha2 to use the InMemory Storage Manager and keep all the data in the memory, add the following property to the axis2.xml file:

<parameter name="Sandesha2StorageManager" locked="false">inmemory</parameter>

If you want Sandesha2 to use the Persistent Storage Manager, set that property as follows:

<parameter name="Sandesha2StorageManager" locked="false">persistent</parameter>

Applies To:

Apache Sandesha2/Java versions post 1.0