rest service with active mq
TRANSCRIPT
![Page 1: Rest service with active mq](https://reader036.vdocuments.mx/reader036/viewer/2022091121/58aa4fed1a28ab10578b5035/html5/thumbnails/1.jpg)
REST Service with ActiveMQ
![Page 2: Rest service with active mq](https://reader036.vdocuments.mx/reader036/viewer/2022091121/58aa4fed1a28ab10578b5035/html5/thumbnails/2.jpg)
Could you actually think how a REST web service can be integrated with a JMS queue.Yes, we can re design a Mule Flow to break a flow into 2 to run a REST web service with ActiveMQ
![Page 3: Rest service with active mq](https://reader036.vdocuments.mx/reader036/viewer/2022091121/58aa4fed1a28ab10578b5035/html5/thumbnails/3.jpg)
How to use ActiveMQ with REST in Mule ??
![Page 4: Rest service with active mq](https://reader036.vdocuments.mx/reader036/viewer/2022091121/58aa4fed1a28ab10578b5035/html5/thumbnails/4.jpg)
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 JMS component. The object to XML Transformer is placed before JMS outbound to make the payload as an XML since a JMS payload cannot be Object type.
![Page 5: Rest service with active mq](https://reader036.vdocuments.mx/reader036/viewer/2022091121/58aa4fed1a28ab10578b5035/html5/thumbnails/5.jpg)
Our Mule config will be as follow:-
![Page 6: Rest service with active mq](https://reader036.vdocuments.mx/reader036/viewer/2022091121/58aa4fed1a28ab10578b5035/html5/thumbnails/6.jpg)
Now, our flow is ready .. If we can test our flow in REST client using the url :- http://localhost:8082/getData/retrieve/?id=1 which will retrieve all the value from the database with id=1 as follows :-
![Page 7: Rest service with active mq](https://reader036.vdocuments.mx/reader036/viewer/2022091121/58aa4fed1a28ab10578b5035/html5/thumbnails/7.jpg)
In log we will get the following which shows it is actually connected to ActiveMQ and displaying the response and which means it is working perfectly
![Page 8: Rest service with active mq](https://reader036.vdocuments.mx/reader036/viewer/2022091121/58aa4fed1a28ab10578b5035/html5/thumbnails/8.jpg)
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
![Page 9: Rest service with active mq](https://reader036.vdocuments.mx/reader036/viewer/2022091121/58aa4fed1a28ab10578b5035/html5/thumbnails/9.jpg)
Thank You