DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • C/C++ Is Where Vulnerability Programs Go to Guess
  • Building a Java 17-Compatible TLD Generator for Legacy JSP Tag Libraries
  • Extracting Clean Excel Tables From PDFs Using Python + Docling
  • Looking at the Evolving Landscape of ITSM Through the Lens of AI

Trending

  • A System Cannot Protect What It Does Not Understand
  • 5 Common Security Pitfalls in Serverless Architectures
  • Building a RAG-Powered Bug Triage Agent With AWS Bedrock and OpenSearch k-NN
  • MuleSoft IDP: Enhancing Efficiency and Accuracy in Data Extraction
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Library for Configuration Management From Netflix

Library for Configuration Management From Netflix

Archaius is the library that is used by all of the Netflix OSS components for configuration, and it is an extension of the Apache Commons Configuration project.

By 
Rafael Salerno user avatar
Rafael Salerno
·
Oct. 15, 16 · Opinion
Likes (3)
Comment
Save
Tweet
Share
5.5K Views

Join the DZone community and get the full member experience.

Join For Free

Archaius is the Netflix client side configuration library. It is the library that is used by all of the Netflix OSS components for configuration, and it is an extension of the Apache Commons Configuration project. It also allows updates to configure by either polling a source for changes or allowing for a source to push changes to the client. Additionally, Archaius uses Dynamic Property classes as handles to properties.

Some Archaius features include the following: 

  • Dynamic, typed properties.
  • High throughput and threadsafe configuration operations.
  • A polling framework that allows for the obtainment property changes of a configuration source.
  • A callback mechanism that gets invoked on effective.
  • A JMX MBean that can be accessed via JConsole to inspect and invoke operations on properties.
  • Out of the box, composite configurations for applications.
  • Implementations of dynamic configuration sources for URLs, JDBC and Amazon DynamoDB.
  • Scala dynamic property wrappers.

In my sample, I will be showing you how to use the Dynamic Properties and how it is able to be used Archaius with configuration with many environments.

About ArchaiusSandBox class:

  • Set default configuration with property archaius.properties.
  • InstallConfig is a method that apply the config, with polling to each one second.
  • In a set environment, we will get value from "environment" variable, we expected in this case DEV or TEST
  • In the main method, we call the configuration to get "myprop".
    • It is possible to put default configuration to property. I defined "NOT FOUND", but it is possible put any value.
    • Wait 10 seconds to put the new configuration and call again.

Resources folder. There are three properties:

  1. archaius.properties is the default configuration with  reference to configuration available per environment.

  2. archaius-dev.properties configuration specific to DEV.
  3. archaius-test configuration specific to TEST.

In runtime, it is possible to change property. Work in this sample should be added on archaius.properties (within 10 seconds) to the property myprop=TEST-VALUE. After 10 seconds, put in the main method. It should print the new value.

In this post, I used some Archaius functionalities. There are many others also available, but with these few codes, it is possible to create a configuration to many environments with the possibility to change in the runtime.

Here is my sample.

Configuration management Library Property (programming)

Opinions expressed by DZone contributors are their own.

Related

  • C/C++ Is Where Vulnerability Programs Go to Guess
  • Building a Java 17-Compatible TLD Generator for Legacy JSP Tag Libraries
  • Extracting Clean Excel Tables From PDFs Using Python + Docling
  • Looking at the Evolving Landscape of ITSM Through the Lens of AI

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook