EIEIOTECHNOVATION
← Training programmes

EIEIO / PROGRAMMING & DEVELOPMENT

Spring with Redis and RabbitMQ

Course outline

5 days

Duration

Spring with Redis and RabbitMQ

5 days

Overview

A framework provides a standard way to build and deploy applications. Framework provides generic functionality, which can be selectively changed by additional user-written code, thus providing application-specific software.

Frameworks aim to facilitate software development by allowing programmers to devote their time to meeting software requirements rather than dealing with more standard low-level details of providing a working system, thereby reducing overall development time. For instance, a team developing a banking website can focus on writing code particular to banking rather than the mechanics of request handling, user role management and state management.

Web applications can be developed using existing JEE technologies such as servlets, JDBC, JSP. When application grows without a framework the hard-wired page navigations, control logic, business logic will start causing headaches and the code gets messy. Spring is an open-source powerful Java application framework, used in a wide range of Java applications. Spring provides enterprise services to Plain Old Java Objects (POJOs) and uses dependency injection to achieve simplification and increase testability. The extensions available in Spring framework assist in building web applications on top of Java EE platform. Spring framework targets to make J2EE development easier to use and promotes good programming practices by enabling a POJO-based programming model.

This course provides an introduction to Spring framework. It discusses the features of Spring and how to utilize Spring to rapidly develop web applications using Spring.

Objective

  • 1. Understand the basics of Web Application - POST, GET, HTTP, MVC Pattern
  • 2. Create Spring MVC Applications using various options
  • 3. Styling the web project using Bootstrap framework
  • 4. Connect to databases using Spring Data
  • 5. Build REST Services in Spring
  • 6. Secure your applications using Spring Security
  • 7. In-memory Cache using Spring Data Redis
  • 8. Messaging using RabbitMQ

Course Outline :: Spring with Redis and RabbitMQ::

Target Participants

The primary target audience for this course is software developers / programmers. Students new & beginner to the

Spring Framework.

Program Prerequisites

  • 1. Students should be familiar with the Java programming language
  • 2. Web Development Experience (HTML / CSS / JavaScript)
  • 3. A computer that can run Spring Tools Suite
  • 4. Familiar with MVC

Mode of Delivery

Every participant will be provided with course notes and are required to bring in their own laptops for hands-on exercise and practice sessions.

Course Outcome

By end of this program every participant will complete "creating a web based customer profile solution". The solution will allow the administrator to login and create customers. Every customer record will have multiple tabs consisting of address details, order details, payment details and shipping details.

The customer will be able to login to the portal and view their details, modify their address details, order details and also update their payment details.

Day 1

Introduction to Spring

Overview

Spring Framework

Why Spring

Spring Introduction

Shortcomings of Java EE and the Need for Loose Coupling

Managing Beans, The Spring Container, Inversion of Control

The Factory Pattern

Configuration Metadata - XML, @Component, Auto-Detecting Beans

Course Outline :: Spring with Redis and RabbitMQ::

Dependencies and Dependency Injection (DI) with the BeanFactory

Setter Injection

Dependency Injection

Using the Application Context

Constructor Injection

Property Editors

Factory Methods

Crucial Namespaces 'p' and 'c'

Configuring Collections

Bean Definition Inheritance and Collection Merging

Expression Languages, SpEL

The Spring Container and API

The Spring Managed Bean Lifecycle

Key interfaces, Annotations and BeanPostprocessors

Event Handling and Listeners

Message Sources and Internationalization

Autowiring Dependencies

Day 2

Other Metadata Configurations

Annotation Configuration @Autowired, @Required, @Resource

@Component, Component Scans. Component Filters

@Value and @Qualifier

Life Cycle Annotations

Java Configuration, @Configuration, XML free configuration (Optional)

The Annotation Config Application Context

Spring and Persistence

Spring and JDBC

JdbcTemplate

JdbcDaoSupport

Spring and Hibernate

HibernateTemplate

HibernateDaoSupport

Spring and JPA

Course Outline :: Spring with Redis and RabbitMQ::

JpaTemplate

JpaDaoSupport

Direct access to JPA via @PersistenceUnit and @PersistenceContext

CRUD methods

Spring AOP

PointCuts, JoinPoints, Aspects, Adices

Before, After

AfterReturning, AfterThrowing

Around

Annotation Configuration

XML Configuration

Transaction Management

Transaction Propagation

Declarative Transaction Management: @Transactional

Annotation Configuration, Rollback Rules, Isolation

Advisors

XML Configuration

Day 3

Develop Web Applications using the Spring Framework – Spring MVC

The WebApplicationContext and the ContextLoaderListener

Model View Controller

Front Controller Pattern

DispatcherServlet Configuration

Controllers, RequestMapping

Working with Forms

Getting at the Request @RequestParam

Getting at the @RequestHeader

Getting at the @CookieValue

ModelAndView

Using the POST Redirect GET pattern with FlashAttributes

RESTful Web Services

Core REST concepts

REST support in Spring 4.x

Course Outline :: Spring with Redis and RabbitMQ::

Use Spring MVC to create RESTful Web services

REST specific Annotations in Spring

Introduction to spring Microservices

Working with RestTemplate

URITemplates, @PathVariable, @RequestParam

JSON and XML data exchange

@RequestMapping

Day 4

Redis

Installation

Configuration

Starting Redis

Redis client libraries and language bindings

Redis data types and commands to manipulate them

Strings

List, Sets & Sorted sets

Hashes

Bit arrays

Redis Pub/Sub

Expiration

Redis transactions & Lua scripts

Mass insertion

Spring Data Redis

Installation

Configuration

Creating Configuration Class

Creating a model

Creating DAO Interface

Creating DAO Implementation

Creating Spring Controller

Implement CRUD operation

Redis Cache

Configuration

Course Outline :: Spring with Redis and RabbitMQ::

Defining Repository

Defining Controller

Updating Cache

Clearing Cache

Redis Cache Limits

Day 5

Introduction to RabbitMQ

Introduction to Message Queues

Overview of Messaging Systems

Message brokers and their roles

Benefits of Messaging Systems

Producers and Consumers

Queues, Exchanges, Routing Keys and Bindings

Direct, Fanout, Topic and Headers exchanges

Configuration

Setting Up RabbitMQ in a Spring Project

Adding Spring AMQP dependencies

Configuring RabbitMQ connection properties

Defining Queues

Defining Exchanges

Bindings

Creating queues, exchanges, and routing configurations

Defining custom configuration beans for queues and exchanges

Sending and Receiving Messages

RabbitTemplate for sending messages

Sending simple messages and JSON objects

Receiving Messages with @RabbitListener

Setting up a message listener using @RabbitListener

Processing messages asynchronously and handling errors

Advanced RabbitMQ Configurations and Patterns

Configuring Message Converters

Using JSON Message Converters with Jackson2JsonMessageConverter

Converting and receiving JSON data for structured communication

Course Outline :: Spring with Redis and RabbitMQ::

Message Acknowledgment

Automatic and manual acknowledgment modes

Ensuring reliable message processing with basicAck and basicNack

Retry Mechanism and Dead Letter Exchanges

Configuring a retry policy for message consumers

Setting up Dead Letter Exchanges (DLX) to handle failed messages

Programme scope, delivery arrangements and suitability are confirmed during enquiry.