wasser in der wüste · wasser in der wüste vom custom-made sql-db-messaging anti-pattern zum...

19
Wasser in der Wüste Vom custom-made SQL-DB-Messaging Anti-Pattern zum JMS-Standard mit Apache Camel Niko Köbler DOAG, 20.11.2012

Upload: others

Post on 05-Feb-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Wasser in der Wüste · Wasser in der Wüste Vom custom-made SQL-DB-Messaging Anti-Pattern zum JMS-Standard mit Apache Camel Niko Köbler DOAG, 20.11.2012

Wasser in der Wüste

Vom custom-madeSQL-DB-Messaging Anti-Pattern

zum JMS-Standard mit Apache Camel

Niko Köbler

DOAG, 20.11.2012

Page 2: Wasser in der Wüste · Wasser in der Wüste Vom custom-made SQL-DB-Messaging Anti-Pattern zum JMS-Standard mit Apache Camel Niko Köbler DOAG, 20.11.2012

Niko Köbler• Freiberuflicher Berater/Architekt

• IT seit 1999

e: [email protected]

w: www.n-k.de

nikokoebler.blogspot.com

t: @dasniko

Wasser in der Wüste, Niko Köbler 2

Page 3: Wasser in der Wüste · Wasser in der Wüste Vom custom-made SQL-DB-Messaging Anti-Pattern zum JMS-Standard mit Apache Camel Niko Köbler DOAG, 20.11.2012

Herausforderung

Wasser in der Wüste, Niko Köbler 3

Oracle DB

IBM AS/400

DB/400

PL/SQL

JEE Container

JDBC

File

File

SQL

JDBC

Page 4: Wasser in der Wüste · Wasser in der Wüste Vom custom-made SQL-DB-Messaging Anti-Pattern zum JMS-Standard mit Apache Camel Niko Köbler DOAG, 20.11.2012

Der Weg I• IBM Websphere MQ ???

• Oracle SOA-Suite ???

• JMS!

• Lose Kopplung

• Asynchrone Übertragung

• Queues (point-to-point)vs.Topics (publish-subscribe)

Wasser in der Wüste, Niko Köbler 4

NO!

Page 5: Wasser in der Wüste · Wasser in der Wüste Vom custom-made SQL-DB-Messaging Anti-Pattern zum JMS-Standard mit Apache Camel Niko Köbler DOAG, 20.11.2012

Oracle AQ• JMS-Provider „built-in“

• Seit Version 9i Release 2 „Advanced Queuing“

• Auch in XE!

• Robust, stabil, etabliert

• Datenbanktabellen / -user

• Nutzbar über PL/SQL-Packages oder JMS-Adapter

• Kein weiteres System notwendig

Wasser in der Wüste, Niko Köbler 5

Page 6: Wasser in der Wüste · Wasser in der Wüste Vom custom-made SQL-DB-Messaging Anti-Pattern zum JMS-Standard mit Apache Camel Niko Köbler DOAG, 20.11.2012

Der Weg II• Spring Integration

• Mule ESB / Mule Integration

• Apache Camel

Wasser in der Wüste, Niko Köbler 6

Page 7: Wasser in der Wüste · Wasser in der Wüste Vom custom-made SQL-DB-Messaging Anti-Pattern zum JMS-Standard mit Apache Camel Niko Köbler DOAG, 20.11.2012

Was ist Apache Camel?„Apache Camel is messaging technology glue with routing. It

joins together messaging start and end points allowing the

transference of messages from different sources to different

destinations.“

„It‘s a complete production-ready framework for people who

want to implement their solotuion to follow the EIPs.“

Quelle: http://stackoverflow.com/questions/8845186/what-exactly-is-apache-camel

Wasser in der Wüste, Niko Köbler 7

Page 8: Wasser in der Wüste · Wasser in der Wüste Vom custom-made SQL-DB-Messaging Anti-Pattern zum JMS-Standard mit Apache Camel Niko Köbler DOAG, 20.11.2012

Apache Camel• EIP Open Source Framework

• leichtgewichtig

• Implementiert in Java

• Routing / Mediation / Transformation

• DSLs: Java, XML, Scala

• Pipes&Filters, Bean Binding

• Testbar (Unit-Tests)

• Apache Projekte, die Camel verwenden:o ServiceMix

o ActiveMQ

o …

Wasser in der Wüste, Niko Köbler 8

Page 9: Wasser in der Wüste · Wasser in der Wüste Vom custom-made SQL-DB-Messaging Anti-Pattern zum JMS-Standard mit Apache Camel Niko Köbler DOAG, 20.11.2012

Apache Camel – 10.000m

Wasser in der Wüste, Niko Köbler 9

Page 10: Wasser in der Wüste · Wasser in der Wüste Vom custom-made SQL-DB-Messaging Anti-Pattern zum JMS-Standard mit Apache Camel Niko Köbler DOAG, 20.11.2012

Camel Beispiel - Java

Wasser in der Wüste, Niko Köbler 10

Page 11: Wasser in der Wüste · Wasser in der Wüste Vom custom-made SQL-DB-Messaging Anti-Pattern zum JMS-Standard mit Apache Camel Niko Köbler DOAG, 20.11.2012

Camel Beispiel - XML

Wasser in der Wüste, Niko Köbler 11

Page 12: Wasser in der Wüste · Wasser in der Wüste Vom custom-made SQL-DB-Messaging Anti-Pattern zum JMS-Standard mit Apache Camel Niko Köbler DOAG, 20.11.2012

Apache Camel Components• GAuth, GMail, …

• HBase

• HDFS

• HTTP

• iBatis

• IRC

• JDBC

• JMS

• JMX

• JPA

Wasser in der Wüste, Niko Köbler 12

• Atom

• Amazon WS

• Bean / Bean Validation

• Crypto

• CXF (SOAP)

• Direct, Seda, Mock

• EJB

• File

• Freemarker

• FTP

Page 13: Wasser in der Wüste · Wasser in der Wüste Vom custom-made SQL-DB-Messaging Anti-Pattern zum JMS-Standard mit Apache Camel Niko Köbler DOAG, 20.11.2012

Apache Camel Components• RSS

• Solr

• SpringBatch, -Integration

• SQL

• SSH

• StAX

• TCP

• Twitter

• XQuery

• XSLT

Wasser in der Wüste, Niko Köbler 13

• JT400

• LDAP

• Log

• Lucene

• Mail (IMAP, POP3, SMTP)

• MongoDB

• Nagios

• Printer

• REST

• RMI

Page 14: Wasser in der Wüste · Wasser in der Wüste Vom custom-made SQL-DB-Messaging Anti-Pattern zum JMS-Standard mit Apache Camel Niko Köbler DOAG, 20.11.2012

Enterprise Integration Patterns• Gregor Hohpe & Bobby Woolf

• Designing, Building and Deploying Messaging Solutions

• 65 Patternso (einfache) Lösungen und Ansätze für verschiedene bzw. alle Integrations-Werkzeuge

o „Gemeinsame Sprache“ und visuelle Notation

• If you are involved with the operation or development

of an enterprise application, there will doubtless come

a time when you will need to integrate your application

with another using the emerging preferred approach

of messaging. When that time comes, this book will

be your most valuable reference.

(Randy Stafford, Oracle)

Wasser in der Wüste, Niko Köbler 14

Page 15: Wasser in der Wüste · Wasser in der Wüste Vom custom-made SQL-DB-Messaging Anti-Pattern zum JMS-Standard mit Apache Camel Niko Köbler DOAG, 20.11.2012

Ziel-Architektur

Wasser in der Wüste, Niko Köbler 15

Oracle DB

IBM AS/400

DB/400

PL/SQL

JT400DTAQ

JEE Container

AQ

Apache CamelJMS

JMS

JMS

JDBC

SQL

JPA

Page 16: Wasser in der Wüste · Wasser in der Wüste Vom custom-made SQL-DB-Messaging Anti-Pattern zum JMS-Standard mit Apache Camel Niko Köbler DOAG, 20.11.2012

Ziel-Routing

Wasser in der Wüste, Niko Köbler 16

Route1 Route2

Route3

Route4

Transformation, Unmarshalling,

SplittingEndpoint-Input

Content-Based-Routing

XML-Marshalling JMS-Queue

Entity-Transformation

Persistenz

Page 17: Wasser in der Wüste · Wasser in der Wüste Vom custom-made SQL-DB-Messaging Anti-Pattern zum JMS-Standard mit Apache Camel Niko Köbler DOAG, 20.11.2012

Demo

Page 18: Wasser in der Wüste · Wasser in der Wüste Vom custom-made SQL-DB-Messaging Anti-Pattern zum JMS-Standard mit Apache Camel Niko Köbler DOAG, 20.11.2012

Q&A

Page 19: Wasser in der Wüste · Wasser in der Wüste Vom custom-made SQL-DB-Messaging Anti-Pattern zum JMS-Standard mit Apache Camel Niko Köbler DOAG, 20.11.2012

Links• Oracle AQ:

http://en.wikipedia.org/wiki/Oracle_Advanced_Queuing

• JMS: http://de.wikipedia.org/wiki/Java_Message_Service

• Apache Camel: http://camel.apache.org

• Spring Integration:http://www.springsource.org/spring-integration

• Mule ESB: http://www.mulesoft.org

• EAI Patterns: http://www.eaipatterns.com

• JT400: http://jt400.sourceforge.net

Wasser in der Wüste, Niko Köbler 19