Welcome!

Alfredo Diaz

Subscribe to Alfredo Diaz: eMailAlertsEmail Alerts
Get Alfredo Diaz via: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Top Stories by Alfredo Diaz

Many libraries use system properties for settings. For example, you usually have to set a property to enable debug traces or to activate certain behaviors. However, sometimes system properties that are used are not well documented or you are not sure that they are having some effect. In such cases it would be useful to have a way to know which system properties are queried. There are several manners to do this but I have found a simple way that is not so intrusive. By creating a custom Security Manager you can define a method that checks property accesses. This method is able to send to the logger or to the standard output what property has been queried. public class PropertyAccessPrinterSecurityManager extends SecurityManager { @Override public void checkPropertyAccess(String key) { System.out.println("System.getProperty(\""+key+"\")"); } }   This article explain... (more)

Getting the maximum performance of your Java processes

therore-concurrent provides self-tuning thread-pools helping you to make the most of your system. Recently, I have been working in the optimization of an OLTP system. The software has a SEDA architecture (Staged Event Driven Architecture) with lots of threads doing little works. I had to fight with the hard task of adjusting a hundred of parameters. Each of those parameters affected some others and so on. For example if the number of concurrent database connections is set too low, it would cause a contention in getting connections. On the contrary, if that number is set too high... (more)

How to Monitor JVM System Properties

Trace all calls to System.getProperty method Many libraries use system properties for settings.  For example, you usually have to set a property to enable debug traces or to activate certain behaviors.  However, sometimes system properties that are used are not well documented or you are not sure that they are having some effect.  In such cases it would be useful to have a way to know which system properties are queried. There are several manners to do this but I have found a simple way that is not so intrusive. By creating a custom Security Manager you can define a method that ... (more)

Distributed configuration with ZooKeeper, Curator and Spring Cloud Config

Apache ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services. It is used as a cluster coordination service for demanding systems such as Hadoop, Kafka, Storm, Akka, Neo4j, Talend ESB and so on. ZooKeeper is a very versatile tool and a perfect partner for a microservice architecture. These are its most common uses: Centralized configuration Service discovery Resource allocation Failure detection Leader election for failover scenarios High priority queues I have started using ZooKeeper... (more)

YAML files into/from ZooKeeper with zookeeperdump

Spring Boot supports the use of YAML files to externalize configuration. YAML is a superset of JSON, human-readable and very convenient for specifying hierarchical configuration data. This is an example of yaml --- organizations: departments: office: - area: "marketing" employee: - name: "Tom" email: "tom@mail.com" - name: "James" - name: "Mark" - area: "distribution" employee: - name: "Steve" - name: "Richard" You may also want to use Spring Cloud ZooKeeper Config and having your configuration distributed along your cluster. To get it you have to create a tree structure of nod... (more)