+ All Categories
Home > Documents > Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Date post: 29-Nov-2014
Category:
Upload: ralf-sigmund
View: 853 times
Download: 2 times
Share this document with a friend
Description:
 
46
Ralf Sigmund / Christoph Ortmann OPITZ CONSULTING GmbH Integrationsprojekte auf dem Weg zur Continuous Delivery
Transcript
Page 1: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Ralf Sigmund / Christoph OrtmannOPITZ CONSULTING GmbH

Integrationsprojekte auf dem Weg zur Continuous Delivery

Page 2: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Agenda

ErfolgRahmen

Tests

Build

Deployment

Konfiguration

Page 5: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Erfolgsrezept

KANBAN&

PL / SQL

Kurze Time to Market

Page 6: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Projekt

Scan Dienstleister anbinden!

Page 7: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

B2BBooks on Demand Digitalisierungs-Anbieter

digitale Publikationsplattform externe Dienste

Order

Order Ready Notification

Delivery

Page 8: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

?

Page 9: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10
Page 10: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Forts.

ORACLE Internet

Page 11: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Zielarchitektur EIPs mit Camel

http://www.enterpriseintegrationpatterns.com/

Page 12: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Big Picture

Page 13: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Start

Dr. Ralf Sigmund
bild
Page 14: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Auftragversand

Page 15: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Die Antwort verarbeiten

Statusinformationen über den Erhalt des Auftrags .

Sowohl der Returncode als auch die vollständige Antwort werden mithilfe des O/R Mappers in der Datenbank gespeichert.

Page 16: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Fertig zum liefern

HTTP ServiceEine zweite Route bildet die Auftragsbestätigung durch das System des Dienstleisters ab. Er sendet diese an BoD, sobald die Bearbeitung des Auftrages abgeschlossen ist.

Page 17: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Camel und PL/SQL passen prima zusammen

Fachlogik

PL/SQL

Integration

Camel

Page 18: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Monitoring und Verfügbarkeit

• Datenbank als zentraler Monitoringpunkt

Page 19: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

SelbsttestTest-NachrichtenUm die Verfügbarkeit des Integrationsservers zu kontrollieren, werden die Camel-Routen in äquidistanten Zeitabständen durch spezielle Testaufträge angestoßen.

2

Page 20: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Internet-Verbindung

Test-Nachricht an Google Chart API

Page 21: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Agenda

ErfolgRahmen

Tests

Build

Deployment

Konfiguration

Page 22: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Performance & Load Testing

Security Testing„ility“ Testing NFRs

Welche Tests benötigen wir?

FunctionalExamplesStory TestsSimulations

Unit TestsComponent Tests

Exploratory

manuell

Tools/ Autom.Autom.

Autom.

Supp

ortin

g th

e Te

am Critique Product

Technologie

Geschäftsanforderungen

Q1 Q4

Q3Q2

Page 23: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Unit Tests vermeiden Fehler

• Testgetrieben vorgehen

• Lean Prinzipien• Camel Test Support

Qualität

Page 24: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Camel unterstützt Unit Tests durch Mock Endpunkte

↘Müssen explizit in Routendefinition angelegt werden => Testcode in Produktionscode

statusOK.expectedMessageCount(1);statusOK.expectedMessagesMatches(new ResultMessagePredicate("ok"));<< PRODUCE >>

assertMockEndpointsSatisfied();

Page 25: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Camel bietet Mocks als Stellvertreter

• Verhalten eines Mocks kann durch Hinzufügen eines Processors gesteuert werden

• Rückgabe von Antwortnachrichten• Exceptions für Test des Fehlerhandling

partnerA.whenAnyExchangeReceived(new MockStatusProcessor("ok"));

Page 26: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Interceptoren können im Test bestehende Routen ändern

interceptSendToEndpoint("direct:partnerA").skipSendToOriginalEndpoint().to("mock:partnerA").to("direct:wsResponse");

context.getRouteDefinition("resultDecision").adviceWith(context,createRouteBuilderResultDecision());

BA C

X C

Page 27: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Continuous Integration

• Ganz normal mit Jenkins / Hudson

Page 28: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Functional Tests

• Für die Auftraggeber verständliche Tests

• Build the right thing

Akzeptanz

Page 29: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Features beschreiben ausübbare Anforderungen

Feature: Place order As a Digital Publisher In order to be able to offer a book on my Publishing Plattform I want to order the scanning of the book by a Digitizing Provider

Scenario: place an order Given I am a valid API user And I use the payloadID "[email protected]" And I send and accept XML And I give the order an orderID "XYZ-001" And I add an item with lineNumeber "1" and quantity "1" to the order And I set the Supplier EAN "1234567890123" for line item "1" When I send a POST request to "/orders" with the following: Then the response should be "200" And the XML response should be a cXML with payloadID "[email protected]" and status code "200"

Page 30: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Feature-Tests werden ausführbar durch Step Definitions

When I send a DELETE request to /incidents/task/5

steps.rb:When /^I send a DELETE request to "([^\"]*)"$/ do |path| delete pathend

Page 31: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Agenda

ErfolgRahmen

Tests

Provisionierung

Deployment

Konfiguration

Page 32: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Fehlerquellen gibt es auch nach den Tests

Fehler

Code

Konfig-uration

Umgebung

Karaf-VersionJDK-Version,.

DB-URLQueue-NameService URL

Page 33: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Eine Deployment Pipeline

Commit stage

Akzeptanz- tests Lasttests Release

Commits

Page 34: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Umsetzung der Deployment Pipeline

Alles unter Versionskontrolle

Provisionierung Konfiguration

Alles automatisieren

Provisionierung Konfiguration

Infrastructure as Code

Page 35: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Mit Chef einen Karaf Server provisionieren

Kochbuch für Linux apt tool..für Java

Infrastructure as Code(in GIT oder SVN)

Page 36: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Ein Rezept für Karaf

Das Rezept

Dateien zur Basiskonfiguration

Page 37: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

remote_file "/tmp/k.tar.gz" do action :create_if_missing source "http:///www.apache.org/karaf/2.2.4/apache-karaf-2.2.4.tar.gz" mode "0644" checksum "a09f85142e9bb8290cdf332af8201b31ba6d993a"end

Mit Chef das Karaf Archiv herunterladen

Page 38: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

bash "install_karaf" do user "vagrant" cwd "/home/vagrant" code <<-EOH tar -zxf /tmp/#{KARAF}.tar.gz EOHend

.. und auspacken

Page 39: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Entwicklungssysteme einfach mit Vagrant provisionieren

Virtualbox• Basis ISO

Vagrant• Chef Rezept

laufender Karaf

Server

Page 40: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

genauer

Vagrant::Config.run do |config| config.vm.box = "base"

config.vm.forward_port("karaf_remote_console", 8101, 48101) config.vm.provision :chef_solo do |chef| chef.cookbooks_path = "cookbooks" chef.add_recipe "apt" chef.add_recipe "java" chef.add_recipe "karaf" chef.json.merge!({ :java => { :install_flavor => "sun" }, :karaf => { :db_host => host_ip(), :db_user => "camel", :db_password => "demo" } }) endend

def host_ip()VirtualBox::Global.global.host.network_interfaces.each do |ifce| if ifce.interface_type == :host_only return ifce.ip_address end endend

Page 41: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Start

vagrant up

Page 42: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Deployment

<bundle>mvn:camel/backendService/${pom.version}</bundle> <config name="com.opitz_consulting.cameldemo"> database.driverClassName = oracle.jdbc.OracleDriver </config>

Bundles• URI-basiert mvn /

http

Konfiguration• OSGi Config Manager• Property Placeholder

feature.xml

Page 43: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Continuous Delivery braucht Konfigurationsmöglichkeiten

• Karaf Shell• Karaf Fabric Run

• Karaf Features DateiDeploy

• Chef RezepteProvision

Page 44: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Reproduzierbarkeit ist machbar

Reproduzierbarkeit

Alles automatisieren

Alles einchecken Binaries nur einmal bauen

Exakt gleicher Deployment

Mechanismus in jeder Umgebung

Page 45: Wjax integrationsprojekte auf dem weg zur continuous delivery 2011 11-10

Nennen wir es Lean

Schnell liefern

Qualität gewährleisten

Optimierung (Deming Cycle)

Waste eliminieren

Decide Late

Empower the team

umsetzenspezifizieren testen testen

Stop the line!


Recommended