WSO2Con 2013 CFP Banner

How do I configure Storage Managers of Sandesha2 ?

Apache Sandesha2 storage Managers can be divided into two types.

1. InMemory Storage Managers.

2. Persistent Storage Managers.

Date: Tue, 20th Jun, 2006
Level:
Reads: 2230
Discuss this article on Stack Overflow
Chamikara Jayalath
Software Engineer
WSO2 Inc.

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="http://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