Thursday, June 26, 2014

Spring4Netty without Web.XML configuration on Java 8 (JBoss WildFly and Tomcat 8) - part.1::introduction

  Although I'm working with Netty for while ( in different scenarios ;) ,  I've not found so much examples how to use Netty 4.x together with Spring Framework 4.x. Honestly I've found mostly some pieces of the whole solution (maybe I was not search so much around). 
  My following project shows how to make it  run. Another purpose of it is to present Spring 4 configuration without web.xml.

  My idea at the beginning was that this blog post will be just only small description how to. Pretty soon I realised that there is no chance to sum everything up into one blog post. I'd rather split everything into smaller parts than long fuzzy text (hopefully this text won't be fuzzy :). So I've separated everything  and parts could be accessed individually if  it's needed.  

The project is also available over my GiTHub repository .

img.0.: s4netty results (s4netty-web, s4netty-worker and JSON)


  1. Configure Netty as service provider (s4netty-worker) 
  2. Configure s4netty-worker Spring MVC without Web.xml usage 1
  3. Configure Spring MVC without web.xml (s4netty-web) usage 2
  4. Run everything on JBoss Wildfly or Tomcat 8 with logging
  1. Tomcat 8
  2. JBoss WildFly

development IDE: IntelliJ IDEA 13.x
other technologies: JRebel 6.x Experimental 
building tool: Maven 3.2.x
libraries: see the maven pom.xml - the parent module

  The basic abstraction behind the application is exchanging JSON object between web spring MVC BASE (s4netty-web) and s4netty WORKER (s4netty-worker) (img.1.). The object exchange is done over defined port P.  For this purpose JSON has been used as the type of object serialisation. 
img.1.: s4netty app abstraction
  Both Spring-Base (s4netty-web) and Netty-Worker (s4netty-worker) modules use Spring MVC Framework with different type of WebApplication context initialisation. Aside Netty-Worker uses Netty (asynchronous event-driven framework) to open the Port P to provide the result of the spring service to the Spring-Base (s4netty-web). Spring-Base uses restTemplate for communication with  Netty-Worker. 

  So let's start to exchanging cars and move to the PART 2. (click).

No comments: