webservice with vm

11
A Simple Web Service With VM

Upload: mdfkhan625

Post on 20-Feb-2017

114 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Webservice with vm

A Simple Web Service With VM

Page 2: Webservice with vm

We all know how to expose a CXF based SOAP web services in Mule.How about exposing the web service by decomposing a complex flow into smaller part with VM component ??

Page 3: Webservice with vm

One main reason to use this architecture, is that we can fragment the logic into smaller pieces and can connect it and decouple each event, and is done mainly for high performance and high control.

Page 4: Webservice with vm

Advantage with breaking the flow with a queue :-• Help to control on each event queue• The service can be well-conditioned to load• Preventing resources from being over committed when demand exceeds service

capacity.

Page 5: Webservice with vm

So, let’s create our flow to expose a CXF web service by breaking the flow into 2 parts connected with VM components as follows :-

Page 6: Webservice with vm

You can see that we have used a set property after CXF component to store the method name which is actually SOAP action here as the message properties generally get lost if passed through a VM queue.

Page 7: Webservice with vm

Our Mule config will be following :-

You can see in flow2 the SOAP action stored is provided as entry point for web service implementing java class

Page 8: Webservice with vm

Now, we can test our web service in SOAPUI and see that the web service is generating a response which means it is working perfectly

Page 9: Webservice with vm

So, if we are exposing a web service using VM endpoints the first thing we should keep in mind is to store the outbound properties of the message before sending the message to the VM outbound endpoint .

The main reason of doing is to protect the properties and get it in our next flow, since a message may loose it’s outbound properties while passing through a VM.

Page 10: Webservice with vm

In my next slide I will bring some other techniques of implementing VM endpoint in our flow.Hope you have enjoyed this simpler version. Keep sharing your knowledge everywhere and let our mule community grow

I have also shared this in my blog :- http://anirbansenchowdhary.com/blog/?p=220So, Happy coding …

Page 11: Webservice with vm

Thank You