Integrace s eGovernmentem na 2 řádky - OpenAlt · Apache Camel “ Apache Camel is a powerful...

Post on 04-Jun-2020

3 views 0 download

Transcript of Integrace s eGovernmentem na 2 řádky - OpenAlt · Apache Camel “ Apache Camel is a powerful...

Integrace s eGovernmentemna 2 řádky

Josef LudvíčekSotware engineer @Wandera

Czech eGovernment

zákon č. 365/2000 Sb.

zákon č. 300/2008 Sb.

zákon č. 111/2009 Sb.

https://www.datoveschranky.info/o-datovych-schrankach/vyzkousejte-si-datovou-schranku

http://www.abclinuxu.cz/datove-schranky

https://github.com/czgovJava ISDS

přístup k datovým schránkám z javyGit tag >> maven centralfork

Camel ISDSintegrace Java ISDS do Apache CamelGit tag >> maven central

hlidacsmluv-dotacevyhledávání v registru smluv pro aplikace z

xrosecky/JAVA_ISDS

https://dotacni-parazit.cz/https://hackujstat.cz/

Apache Camel

“ Apache Camel is a powerful open sourceintegration framework based on known

Enterprise Integration Patterns withpowerful Bean Integration.

Apache Camel

Co jsou Enterprise Integration Patterns (EIP) ?

Je to kniha.

Apache Camel

Co jsou Enterprise Integration Patterns (EIP) ?

Apache Camel

Apache Camel

import org.apache.camel.builder.RouteBuilder;

public class TestRouteBuilder extends RouteBuilder { @Override public void configure() throws Exception {

from("activemq:queue:neworder") .choice() .when(xpath("/order/product = 'widget'")) .to("activemq:queue:widget") .otherwise() .to("activemq:queue:gadget") .end(); }}

Apache Camel

import org.apache.camel.builder.RouteBuilder;

public class TestRouteBuilder extends RouteBuilder { @Override public void configure() throws Exception {

from("file:/var/incoming?delete=true") .choice() .when(xpath("/order/product = 'widget'")) .to("ftp:joe@somewhere.com/upload?password=123") .otherwise() .to("isds:message?username=ABC&password=123") .end(); }}

Apache Camelhttp://camel.apache.org/components.html

200+ components

SQL

from("isds:messages?environment=test&username=AAA&password=123&zfo=true") .to("file:messages");

Integrace na 2 řádky

package com.github.czgov.playground.route;

import org.apache.camel.builder.RouteBuilder;

public class ZFORoute extends RouteBuilder { @Override public void configure() throws Exception { from("isds:messages?environment=test&" + "username={{isds.login}}&password={{isds.password}}&zfo=true") .to("file:messages"); }}

Integrace na 2 řádky

https://github.com/czgov

new Shiny Componenthttp://camel.apache.org/creating-a-

new-camel-component.htmlclass ShinyComponent extends UriEndpointComponent { // component starting point // creates Endpoint protected Endpoint createEndpoint();}

class ShinyEndpoint extends DefaultEndpoint { // define all parameters and configuration options // used for parsing uri and docs generation // create consumer and producer}

class ShinyConsumer extends ScheduledPollConsumer { // from("shiny:..") protected int poll();}

class ShinyProducer extends DefaultProducer { // to("shiny:...") public void process(Exchange exchange);}

Děkuji za pozornost

Josef LudvíčekSotware engineer @Wanderajosef.ludvicek.cz@gmail.com

Zdroje

dokumentace frameworku Apache Camel

prezentace Microservices with Apache Camel, Claus Ibsen

kniha Camel In Action, Claus Ibsen and Jonathan Anstey

http://camel.apache.org/

https://www.slideshare.net/davsclaus/microservices-with-apache-camel

https://www.manning.com/books/camel-in-action