Versions of microservices (Content Interaction Services)
By default, any code you write that interacts with the Content Delivery microservices, also called Content Interaction Services (CIS), is assumed to work with any version of the microservices. But you can use annotations to specify exactly which version(s) of the CIS your code will work with.
You can find out the CIS version by making a metadata request to the Content Service. The response contains a response header called X-SDL-CIS-Version which lists the version of this CIS.
- only works from a certain CIS version onward
- only works up to a certain CIS version
- works from one CIS version up to and including another, later CIS version
If the CIS does not have a correct version, the Content Service returns a message: Unsupported version: VERSION, where VERSION is the version of the CIS.
public void example1() {
/* perform some call on the CIS – should be backwards compatible with 8.1.0 CIS and work with all future versions */
}
@SupportedCisVersion(from = "8.1.1.0", to = "8.1.1.0")
public void example2() {
/* perform some call on the CIS – will only work if CIS version is 8.1.1.0
and will throw ODataClientRuntimeException if CIS version not compatible */
}
@SupportedCisVersion(from = "8.1.0", to = "8.5.0")
public void example3() {
/* perform some call on the CIS – will only work if CIS version is from 8.1.0 to 8.5.0 inclusive
and will throw ODataClientRuntimeException if CIS version not compatible */
}