Saturday, March 18, 2017

Spring Boot Reference

Configure Jetty in Boot Application


Coding Standards

Performance Standards








Configure Jetty in Boot Application

The Spring Boot starters generally use Tomcat as the default embedded server. If that needs to be changed – you can exclude the Tomcat dependency and include Jetty instead:
Configuring Jetty

<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-web</artifactId>
   <exclusions>
       <exclusion>
           <groupId>org.springframework.boot</groupId>
           <artifactId>spring-boot-starter-tomcat</artifactId>
       </exclusion>
   </exclusions>
</dependency>
<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-jetty</artifactId>
</dependency>


@Bean
public JettyEmbeddedServletContainerFactory  jettyEmbeddedServletContainerFactory() {
   JettyEmbeddedServletContainerFactory jettyContainer =
     new JettyEmbeddedServletContainerFactory();
    
   jettyContainer.setPort(9000);
   jettyContainer.setContextPath("/springbootapp");
   return jettyContainer;
}


Logging

Spring Boot has no mandatory logging dependency, except for the Commons Logging API, of which there are many implementations to choose from. To use Logback you need to include it and jcl-over-slf4j (which implements the Commons Logging API) on the classpath. The simplest way to do that is through the starters which all depend on spring-boot-starter-logging. For a web application you only need spring-boot-starter-web since it depends transitively on the logging starter. For example, using Maven:
<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-web</artifactId>
</dependency>
Spring Boot has a LoggingSystem abstraction that attempts to configure logging based on the content of the classpath. If Logback is available it is the first choice.
If the only change you need to make to logging is to set the levels of various loggers then you can do that in application.properties using the "logging.level" prefix, e.g.
logging.level.org.springframework.web=DEBUG
logging.level.org.hibernate=ERROR
You can also set the location of a file to log to (in addition to the console) using "logging.file".
To configure the more fine-grained settings of a logging system you need to use the native configuration format supported by the LoggingSystem in question. By default Spring Boot picks up the native configuration from its default location for the system (e.g. classpath:logback.xml for Logback), but you can set the location of the config file using the "logging.config" property.


In the code.

private final Logger logger = LoggerFactory.getLogger(this.getClass());





Coding Standards


SonarLint for Eclipse

SonarLint is an Eclipse plugin that provides on-the-fly feedback to developers on new bugs and quality issues injected into Java, JavaScript and PHP code.

































Monday, May 4, 2015

Welcome Fluidera team!


fluid
[floo-id] 

adjective

1. pertaining to a substance that easily changes its shape; capable of flowing.
2. changing readily; shifting; not fixed, stable, or rigid:

era
[eer-uh, er-uh] 


noun

the period of time to which anything belongs or is to be assigned.









--------------------------
The name pertains to our design philosophy. We will be flexible enough to get the right solutions for the issues at hand.