Top Banner
Message Driven Architecture in Grails Daniel Woods London, Dec 2013
16

Message Driven Architecture in Grails

May 17, 2015

Download

Education

Daniel Woods

Slides from my GGX 2013 talk. http://skillsmatter.com/podcast/home/message-driven-architecture-in-grails

Code here: https://github.com/danveloper/ggx-2013-mda
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Message Driven Architecture in Grails

Message Driven Architecture in GrailsDaniel Woods

London, Dec 2013

Page 2: Message Driven Architecture in Grails

About Me

@danveloper /danveloper

#[email protected]

Message Driven Architecture in Grails

Page 3: Message Driven Architecture in Grails

QUICK OVERVIEW: SPRING INTEGRATION

Message Driven Architecture in Grails

Page 4: Message Driven Architecture in Grails

GATEWAY

Message Driven Architecture in Grails

Gateway Service Interface

SomewhereMessage Channel

gateway.request(obj)

Page 5: Message Driven Architecture in Grails

HANDLER CHAIN

Message Driven Architecture in Grails

Message Channel Handler

Handler

Handler

Handler

Gateway Service Interface

Page 6: Message Driven Architecture in Grails

APPROACH TO MESSAGE DRIVEN ARCHITECTURE IN GRAILS

Message Driven Architecture in Grails

Page 7: Message Driven Architecture in Grails

MESSAGE DRIVEN ARCHITECTURE IS NOT ALWAYS THE SAME THING AS DISTRIBUTED ARCHITECTURE

Message Driven Architecture in Grails

Page 8: Message Driven Architecture in Grails

- BUILD THE SKELETON OF THE APPLICATION AS A MESSAGING PIPELINE

Message Driven Architecture in Grails

Page 9: Message Driven Architecture in Grails

Message Driven Architecture in Grails

Function #1Room Search

Function #2Booking

Page 10: Message Driven Architecture in Grails

Message Driven Architecture in Grails

• Need to find hotels with rooms that don’t have bookings for the date range requested• RoomSearch

• Need to hand off available rooms to be priced appropriately for the user• RatingEngine

• Need to store the rate that we have have generated for the user, to recall during booking

Function #1Room Search

Page 11: Message Driven Architecture in Grails

FUNCTION #1 – ROOM SEARCH

Message Driven Architecture in Grails

Message Channel

Room Search

RatingEngine

PublishedRoomService

Gateway Service Interface Provides:

List<Room>

Provides:List<PublishedRoom>

DB

Page 12: Message Driven Architecture in Grails

Message Driven Architecture in Grails

• Need to retrieved the room and the stored rate

• Need to validate room is still available• RoomSearch

• Re-rate the room to ensure no major discrepancy• RatingEngine

• Create the booking

Function #2Booking

Page 13: Message Driven Architecture in Grails

FUNCTION #2 – BOOKING

Message Driven Architecture in Grails

Message Channel

RatingEngine

Booking Service

Gateway Service Interface

Provides:PublishedRoom

PublishedRoomService

Provides:PublishedRoom

NotifyHotel

DBProvides:BookingEmailService

Pass-Thru:Booking

MetricsService

Page 14: Message Driven Architecture in Grails

PIPELINE WITH WORKFLOW GROUPS

Message Driven Architecture in Grails

Message Channel

AppPipeline

SearchRequest Handler

BookingRequest Handler

Message Channel Room Search

RatingEngine

PublishedRoomService

Provides:List<Room>

Provides:List<Publishe

dRoom>

DB

Message Channel

RatingEngine

Booking Service

Provides:PublishedRoom

PublishedRoomService

Provides:PublishedRoom

NotifyHotel

DB

Provides:Booking

EmailService

Pass-Thru:Booking

MetricsService

Message Router

Page 15: Message Driven Architecture in Grails

WHY GO MESSAGE DRIVEN?

Message Driven Architecture in Grails

Page 16: Message Driven Architecture in Grails

THANK YOU

Message Driven Architecture in Grails