Book Image

Spring Integration Essentials

By : CHANDAN K PANDEY
Book Image

Spring Integration Essentials

By: CHANDAN K PANDEY

Overview of this book

Table of Contents (18 chapters)
Spring Integration Essentials
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Creating your first project


The following steps will help you in creating your first project:

  1. Create a Spring Integration project by navigating to File | Spring Project, as shown in the following screenshot:

  2. Under the templates section, select Spring Integration Project - Simple. Provide a project name, for example, sisimple, as shown in the following screenshot:

  3. Fill in the information required to create a Maven-based project, as shown in this screenshot:

  4. Click on Finish; this will create a project with the name that was provided by us (sisimple), as shown in this screenshot:

This project is as simple as it can be. Let's take a quick look at the generated Java classes in the following points:

  • Main.java: This file is located at the path: /sisimple/src/main/java/com/chandan/example/si/. It has the main method and will be used to run this sample. Right-click on this file from the package explorer and click on Run As | Java Application—this will start the program. This class has the code to bootstrap Spring Integration configuration files and load components defined in it. Additionally, it converts user input to upper case.

  • StringConversionService.java: This file is located at the path: /sisimple/src/main/java/com/chandan/example/si/service/. This is the service interface that is used to convert user input to upper case.

  • spring-integration-context.xml: This file is located at the path: /sisimple/src/main/resources/META-INF/spring/integration/. It is the Spring Integration configuration file. It contains the XML-based declaration of Spring Integration components.

  • log4j.xml: This file is located at the path: /sisimple/src/main/resources/. It is the Log4j configuration file. It can be edited to control the log level, appenders, and other logging-related aspects.

  • StringConversionServiceTest.java: This file is located at the path: /sisimple/src/test/java/com/chandan/example/si/. This is the test file for StringConversionService. This will be used to run tests against the service classes.

  • pom.xml: This is the file used for rmaven dependency management, located in /sisimple/. It has entries for all the dependencies used by the project.

It will be a bit heavy and premature to explain each of the components in these classes and configuration files without having built up some theoretical concepts—we will discuss each of the elements in detail, as we move ahead in the chapters.