Using Spring Cloud programmatically
In the last blog, I showed you how to use Spring Cloud's Java configuration option to obtain service connectors declaratively (there is also XML namespace support, if you need it). In this blog, we will take a closer look at how you would use Spring Cloud programmatically. This will help in the situations where you cannot use Java or XML configuration. It will also demystify how Spring Cloud works and prepare for the next blog in this series, where we discuss extending Spring Cloud.
To work with Spring Cloud we need to access an object of the
Cloud class. However, you can’t create a
Cloud object directly (its constructor is not public). Instead, you will obtain it through