In one of my previous posts I explained how we can add persistence to Apache Synapse. Please go through the following article for an elaboration of how you go about doing this.
Article on WSO2 OxygenTank - Adding Persistence to Apache Synapse - The Queuing Model