31
© Unic - Seite 1 About the speaker: 31 years old Degree in Computer Science (BA) in 2008 Professional Java Developer ever since Experience with CQ since 2012 Published Open Source Software Introduction

Integrating Backend Systems

Embed Size (px)

Citation preview

© Unic - Seite 1

• About the speaker:

• 31 years old

• Degree in Computer Science (BA) in 2008

• Professional Java Developer ever since

• Experience with CQ since 2012

• Published Open Source Software

Introduction

© Unic - Seite 2

• Extensible Component Scanner

• Allows scanning for components with a fluent API

• select(javaClasses()).from(„my.package“).returning(allExtending(A.class))

• Available from Maven and Sourceforge at http://sf.net/projects/extcos

• TestNG Data Binding

• Allows the binding of test data from external data sources to TestNG test method

parameters

• Available from Maven and Sourceforge at http://sf.net/projects/testngdatabind

• Join the community on http://facebook.com/TestNGDataBinding

Published Open Source Software

CQCon 2013: Integrating Backend Systems into CQ Matthias Rothe

19.06.2013

© Unic - Seite 4

Integrating Backend Systems into CQ

• CQ in an Enterprise Environment

• System Integration Layer

• Connecting to the ESB

• Modes of Content Retrieval

• Conclusion

CQ in an Enterprise Environment

© Unic - Seite 6

CQ can be used standalone as a WCMS

But:

• Usually a company has more systems then just the WCMS to store, process and

retrieve data from

• A company might want to display and let the user enter data from these other

systems through their CQ-powered website

• Integrating these other systems in real-time opens up great new business

opportunities

CQ in an Enterprise Environment

© Unic - Seite 7

CQ in an Enterprise Environment

Product

Management

System

User Management

System Car Connect

System

CQ (User Access System)

CRM

System Software

Distribution

System

Other

Systems

© Unic - Seite 8

CQ in an Enterprise Environment

CQ (User Access System)

Product

Management

System

Browser

User Frontend Backend

System Integration Layer

© Unic - Seite 10

• Most use cases require not just one backend system, but the ordered access to

several of them – all of which might greatly differ from each other

System Integration Layer

Business Rules and

Processes

Service Orchestration

Different Data

Structures and

Protocols

Heterogeneous

Technologies

Transactions

© Unic - Seite 11

System Integration Layer

Product

Management

System

User Management

System Car Connect

System

CQ (User Access System)

CRM

System Software

Distribution

System

Other

Systems

JMS / Binary

JMS / XML

REST / JSON

FTP / Binary

HTTP / SOAP

SMTP / SOAP

© Unic - Seite 12

System Integration Layer

Product

Management

System

User Management

System Car Connect

System

CQ (User Access System)

CRM

System Software

Distribution

System

Other

Systems

JMS / Binary

JMS / XML

REST / JSON

FTP / Binary

HTTP / SOAP

SMTP / SOAP

? ?

?

© Unic - Seite 13

System Integration Layer

Product

Management

System

Car Connect

System

CQ

CRM

System

Software

Distribution

System

Content Management

ESB: Only 1 Simple Point of Access

En

terp

rise

Se

rvic

e B

us

Business Rules

Business Processes

Service Orchestration

Intelligent Routing

Data Validation

Transformation

Traceability

Auditing of SLAs

Error Handling

Transaction Handling

© Unic - Seite 14

System Integration Layer

CQ Backend

Systems

Apache ServiceMix

CXF (JAX-RS)

CXF (JAX-RS, JAX-WS)

Camel Routing Engine

Business Process Execution with Orchestration / Aggregation

using Enterprise Architecture Patterns

Protocol and Data Conversion

REST

REST / SOAP J

M

S

F

T

P

T

C

P

© Unic - Seite 15

• Advantages of using an ESB like Apache ServiceMix

• Separation of Concerns

• Leveraging the individual strengths of each system

• Easy reuse of middleware for different frontends

• Increased organizational flexibility

• Increased specialization of development teams

• Opportunity to scale integration layer and CQ independently

• More reliable system, by using technologies specially tailored for integration

• Increased cost efficiency and lower TCO

System Integration Layer

Connecting to the ESB

© Unic - Seite 17

• The communication between CQ and Apache ServiceMix is

• RESTful

• Based on the HTTP protocol

• Exchange of JSON request and response objects

• As the client library we chose the OSGI version of the Apache HTTP components

library

• For ease of use we built a light-weight „RelayService“ framework on top of it

Connecting to the ESB

© Unic - Seite 18

Connecting to the ESB

CustomRelayService

JsonRelayService

DefaultRelayService

Apache HttpClient

Service Controller

CQ

Apache ServiceMix

Automatic adding

of common headers

Automatic JSON

handling

HttpClient Abstraction

© Unic - Seite 19

• To support the full live cycle of resources, we use all of these HTTP methods

• GET To get lists of resources and single resources

• POST To create a new resource

• PUT To update a resource

• DELETE To delete a resource

Connecting to the ESB

doGet(…)

doPost(…)

doPut(…)

doDelete(…)

© Unic - Seite 20

• Resource: Custom lists of Points of Interest

• Retrieve lists:

• relayService.doGet(„http://smxhost/vehicles/v123/s/ppoi/lists“);

• Upload a new list:

• relayService.doPost(„http://smxhost/vehicles/v123/s/ppoi/lists“, listJson);

• Update a list:

• relayService.doPut(„http://smxhost/vehicles/v123/s/ppoi/lists/list1“, updatedJson);

• Delete a list:

• relayService.doDelete(„http://smxhost/vehicles/v123/s/ppoi/lists/list1“);

Connecting to the ESB

© Unic - Seite 21

• Data Exchange Format: JSON

• Lightweight, Easy to use – especially within Javascript frontend

• Conversion to and from Java objects is done with Google Gson

• For dependency injection Gson is wrapped in a Spring component

• All changes, validation, localization etc. are done on Java objects

Connecting to the ESB

Modes of Content Retrieval

© Unic - Seite 23

Modes of Content Retrieval

Browser ESB Component

JSP

Resource

Model Service

Relay

Service

CQ

Synchroneous Mode

© Unic - Seite 24

Modes of Content Retrieval

Browser ESB Component

JSP

Resource

Model

Spring MVC

Controller

Relay

Service

CQ

Asynchroneous Mode

AJAX

© Unic - Seite 25

• Based on Unic proprietary library NEBA II

• Allows mapping of CRX content to Java objects (Resource Models)

• Integrates Spring framework into CQ

• Dependency Injection

• Spring MVC with Spring DispatcherServlet as Sling registered servlet

Modes of Content Retrieval

Conclusion

© Unic - Seite 27

• Todays enterprises have numerous systems holding and processing data

• Business processes require the interaction with several of these systems

• CQ can act as the user facing system and a channel to the backend systems

• An ESB like Apache ServiceMix can be used to integrate the various backend

systems in real-time

• Lots of technical, organizational, financial and business advantages can be

achieved

Conclusion

© Unic - Seite 28

References

Brand Portal: audi.de

myAudi: my.audi.de

© Unic - Seite 29

Questions

© Unic - Seite 30

Belpstrasse 48

3007 Bern

Tel +41 31 560 12 12

Fax +41 31 560 12 13

[email protected]

www.unic.com

Unic AG

© Unic - Seite 31