Cloud-Native Microservices With TIBCO: Configuration Management Using Consul
In this tutorial, we will be learning how to use cloud-native microservices with TIBCO using the configuration management tool, Consul.
Join the DZone community and get the full member experience.Join For Free
In the microservices world, each service needs to connect to different systems and services. Storing information about the URLs and passwords and other configurations locally is not a feasible option as maintaining individual configuration is a mammoth task. There is a growing need for externalizing configurations and managing configurations. In microservices, Consul, Spring config, and Zuul are tools which are used for configuration management.
TIBCO enables developers to build cloud-native applications and support many configuration management tools like Consul, Zuul, and Spring config. In this tutorial, we will be learning how to use cloud-native microservices with TIBCO using the configuration management tool, Consul.
TIBCO provides the ability to define configuration files, called properties. Depending on where and how they are defined and qualified, properties can be classified into application properties, module properties, process properties, and activity configuration properties.
The user can group module properties with the current set of property values into a named profile for any application. An application can have multiple profiles, each having its own set of property values. At run time, you can deploy the same application and stage it multiple times using different profiles.
TIBCO can be integrated with configuration management services like ZULL, Spring Cloud Config, and Consul. Applications can read the values given for particular application properties from external config management. The user can use configurations from the configuration management services by defining a token such a #<property name># in the application properties, where <property name> is the name of the configuration parameter.
Consul Config Management Tool
Apart from service discovery and integrated health checking, Consul provides an easy to use Key/Value store. This can be used to hold dynamic configuration, assist in service coordination, build leader election, and enable anything else a developer can think to build.
Go to the key/value tab on consul web UI and click on create the key.
The key should contain the TIBCO application's name/profile name/property name.
Once the property is defined, the user can provide its value in the text area.
Once you have an application ready to deploy, create a Docker container for the application and while running the Docker container provide two environment variables, i.e. CONSUL_SERVER_URL and APP_CONFIG_PROFILE:
docker run -d -e CONSUL_SERVER_URL="http://184.108.40.206:8500" -e APP_CONFIG_PROFILE="DEV" QuoteService
Opinions expressed by DZone contributors are their own.