The property sources that are added to you application by the bootstrap context are often “remote” (e.g. from a Config Server), and by default they cannot be overridden locally, except on the command line. If you want to allow your applications to override the remote properties with their own system properties or config files, the […]

Read More →

In some cases, you may want to fail startup of a Spring Boot application if it cannot connect to the Config Server. You can do that setting the bootstrap configuration property spring.cloud.config.fail-fast=true. In this way the client startup halt with an Exception. Config server may occasionally be unavailable when your application starts, you can make […]

Read More →

If you find you are repeatedly using the same attributes with @Transactional on many different methods, then Spring’s meta-annotation support allows you to define custom shortcut annotations for your specific use cases. For example, defining the following annotations: allows us to write the example from the previous section as As you can see meta-annotations can […]

Read More →

Sometimes it can be usefull inject the Spring context in a legacy Servlet in order to automatically inject spring beans via @Autowired annotation. This can be easily done overriding the init method of HttpServlet and putting the statement SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this) in its implementation.

Read More →

The Spring Web model-view-controller (MVC) framework is designed around a DispatcherServlet that dispatches requests to handlers, with configurable handler mappings, view resolution, locale, time zone and theme resolution as well as support for uploading files. The default handler is based on the @Controller and @RequestMapping annotations, offering a wide range of flexible handling methods. With […]

Read More →

This article describes how to monitor JMS Queue statistics. You can create, collect, analyze, archive, and access diagnostic data generated by a running server and the applications deployed within its containers. Here there are two very simple JMS examples which we can use to monitor any JMS resource deployed on our server. We will focus […]

Read More →