2. In my previous slide I have demonstrate how to use Cache with SOAP web service.
This time I am going to use the Cache in REST web service
3.
4. To use Cache with Mule we have to construct our flow in following way :-
You can see the flow is divided into 2 parts and is connected by VM component. Just the only extra effort
we need is to copy all HTTP headers before sending it through VM as the HTTP headers may lost while
travelling through VM. We have use the VM component to Cache the flow and the Web service request
6. Now, our flow is ready .. If we can test our flow in REST client using the url :-
http://localhost:8082/getData/retrieve/?id=2 which will retrieve all the value from the database
with id=2 as follows :-
7. Now we will manually delete the record from Database whose id is 2 as follows :-
You can see I have deleted the entire row from the table with id=2 from Database
8. Now, If we hit the same url with same id=2 in REST client using the url :-
http://localhost:8082/getData/retrieve/?id=2 we will get the same result which means it’s actually
taking the response from Cache and not from Database !!!
9. In my next slide I will bring some other techniques in Mule implementation .
Hope you have enjoyed this simpler version.
Keep sharing your knowledge and let our Mule community grow