centr
centr

Reputation: 655

WSO2 ESB - Storing/Logging Messages in db

We have decided to try WSO2 ESB and for our project we need to save all messages in a database to be viewable through a web based custom interface.

What's the best way to store all the complete requests and responses in a database? Is there any mediator for this purpose? We looked into STORE and DBREPORT and apparently none are built for this purpose.

Thanks.

Upvotes: 0

Views: 1463

Answers (1)

Philipp
Philipp

Reputation: 4749

I think you could use DBReport to do so - a simple SQL insert and as parameter you select the whole MessageContext. See this link and just select the value you want to save:

DBReport Documentation

Other solution is to create your own Custom Mediator(Class Mediator) and do your insert directly within normal Java code. Creating a Class Mediator just write a new Java Class and implement the org.apache.synapse.Mediator class. Build a .jar and copy it to the component/lib directory in your WSO2 installation folder.

Class Mediator

Upvotes: 1

Related Questions