// Java · Spring · Kafka · DevOps · Algorithms

Practical guides to Java, Spring and DevOps, with code you can run.

Each article explains one topic around a complete example you can copy and run, plus 569 algorithm problems with worked solutions.

Java
@Bean
TaskDecorator localeDecorator() {
  return task -> {
    LocaleContext context =
        new SimpleTimeZoneAwareLocaleContext(
            LocaleContextHolder.getLocale(),
            LocaleContextHolder.getTimeZone());
    return () -> {
      LocaleContext previous =
          LocaleContextHolder.getLocaleContext();
      LocaleContextHolder.setLocaleContext(context);
      try {
        task.run();
      } finally {
        LocaleContextHolder.setLocaleContext(previous);
      }
    };
  };
}
Carry the user's locale into @Async tasks with a Spring TaskDecorator. See how it works
126
Java articles
54
Spring articles
9
Kubernetes and Docker guides
569
algorithm problems