Monday, 11 November 2019

ESB 13 WSO2 ESB Tutorial: Introduction to Dynamic Endpoints with Registry

ESB 13
WSO2 ESB Tutorial:
Introduction to
Dynamic Endpoints with
the Registry

Index

1. Introduction
2. EI configuration Example
3. Running Example
4. Conclusion


1. Introduction

As we show on the previous blog we can make dynamic reference to a resource store in the registry. This time the code makes reference to a dynamic endpoint. The endpoint is dynamically loaded from the remote registry.


2. EI configuration Example


The EI configuration is shown below:
































The endpoint sequence makes reference to a dynamic resource on the registry. The name is: dynamic_endp_1.xml and its content is displayed.

3. Running Example

Now, start the new Axis2 server on HTTP port 9000 and HTTPS 9002:















This is the request for SOAPUI:
(Do not forget to include the header SOAPAction with the value: urn:getQuote)

























On the other hand this is the response:
































If a second request is sent immediately, the endpoint resource is going to be taken from cache. If the cache expires or the resource is modified, for instance pointing to port 9002, then, it is going to be loaded again.


4. Conclusion

As we show on previous blog, an endpoint is another resource that can be loaded dynamically from the registry. This allow us to write maintainable code where the endpoint can be modified without touching the code or the rest of the EI configuration. 

No comments:

Post a Comment