Enviar pesquisa
Carregar
Spring integration概要
•
15 gostaram
•
6,963 visualizações
K
kuroiwa
Seguir
2013-12-26 勉強会資料
Leia menos
Leia mais
Tecnologia
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 39
Baixar agora
Baixar para ler offline
Recomendados
Spring Integration 超入門
Spring Integration 超入門
Yasutaka Sugamura
システム間連携を担うSpring Integrationのエンタープライズ開発での活用
システム間連携を担うSpring Integrationのエンタープライズ開発での活用
apkiban
Azure load testingを利用したパフォーマンステスト
Azure load testingを利用したパフォーマンステスト
Kuniteru Asami
決済システムの内製化への旅 - SpringとPCFで作るクラウドネイティブなシステム開発 #jsug #sf_h1
決済システムの内製化への旅 - SpringとPCFで作るクラウドネイティブなシステム開発 #jsug #sf_h1
Toshiaki Maki
Spring Initializrをハックする-カスタマイズを通してその内部実装を覗く
Spring Initializrをハックする-カスタマイズを通してその内部実装を覗く
apkiban
オススメのJavaログ管理手法 ~コンテナ編~(Open Source Conference 2022 Online/Spring 発表資料)
オススメのJavaログ管理手法 ~コンテナ編~(Open Source Conference 2022 Online/Spring 発表資料)
NTT DATA Technology & Innovation
自動化を支えるCI/CDツールの私の選択 ~何をするためにCI/CDツールを選ぶか~
自動化を支えるCI/CDツールの私の選択 ~何をするためにCI/CDツールを選ぶか~
Recruit Lifestyle Co., Ltd.
Spring Boot × Vue.jsでSPAを作る
Spring Boot × Vue.jsでSPAを作る
Go Miyasaka
Recomendados
Spring Integration 超入門
Spring Integration 超入門
Yasutaka Sugamura
システム間連携を担うSpring Integrationのエンタープライズ開発での活用
システム間連携を担うSpring Integrationのエンタープライズ開発での活用
apkiban
Azure load testingを利用したパフォーマンステスト
Azure load testingを利用したパフォーマンステスト
Kuniteru Asami
決済システムの内製化への旅 - SpringとPCFで作るクラウドネイティブなシステム開発 #jsug #sf_h1
決済システムの内製化への旅 - SpringとPCFで作るクラウドネイティブなシステム開発 #jsug #sf_h1
Toshiaki Maki
Spring Initializrをハックする-カスタマイズを通してその内部実装を覗く
Spring Initializrをハックする-カスタマイズを通してその内部実装を覗く
apkiban
オススメのJavaログ管理手法 ~コンテナ編~(Open Source Conference 2022 Online/Spring 発表資料)
オススメのJavaログ管理手法 ~コンテナ編~(Open Source Conference 2022 Online/Spring 発表資料)
NTT DATA Technology & Innovation
自動化を支えるCI/CDツールの私の選択 ~何をするためにCI/CDツールを選ぶか~
自動化を支えるCI/CDツールの私の選択 ~何をするためにCI/CDツールを選ぶか~
Recruit Lifestyle Co., Ltd.
Spring Boot × Vue.jsでSPAを作る
Spring Boot × Vue.jsでSPAを作る
Go Miyasaka
Apache Spark の紹介(前半:Sparkのキホン)
Apache Spark の紹介(前半:Sparkのキホン)
NTT DATA OSS Professional Services
ドメイン駆動設計サンプルコードの徹底解説
ドメイン駆動設計サンプルコードの徹底解説
増田 亨
SQL大量発行処理をいかにして高速化するか
SQL大量発行処理をいかにして高速化するか
Shogo Wakayama
Springを何となく使ってる人が抑えるべきポイント
Springを何となく使ってる人が抑えるべきポイント
土岐 孝平
大規模・長期保守を見据えたエンタープライズシステム開発へのSpring Frameworkの適用
大規模・長期保守を見据えたエンタープライズシステム開発へのSpring Frameworkの適用
apkiban
GraalVM の概要と、Native Image 化によるSpring Boot 爆速化の夢
GraalVM の概要と、Native Image 化によるSpring Boot 爆速化の夢
apkiban
さくっと理解するSpring bootの仕組み
さくっと理解するSpring bootの仕組み
Takeshi Ogawa
Go 製リアルタイムサーバーの Kubernetes での運用について
Go 製リアルタイムサーバーの Kubernetes での運用について
KairiOkumura
ドメイン駆動で開発する ラフスケッチから実装まで
ドメイン駆動で開発する ラフスケッチから実装まで
増田 亨
Kubernetesのしくみ やさしく学ぶ 内部構造とアーキテクチャー
Kubernetesのしくみ やさしく学ぶ 内部構造とアーキテクチャー
Toru Makabe
Vue.jsでFormをAtomic Designしてみた時のコンポーネント間のデータのやりとり
Vue.jsでFormをAtomic Designしてみた時のコンポーネント間のデータのやりとり
Yuta Ohashi
Spring Cloud Data Flow の紹介 #streamctjp
Spring Cloud Data Flow の紹介 #streamctjp
Yahoo!デベロッパーネットワーク
Landoを利用したdrupal開発環境構築
Landoを利用したdrupal開発環境構築
otofu1
これからSpringを使う開発者が知っておくべきこと
これからSpringを使う開発者が知っておくべきこと
土岐 孝平
Web開発者が始める .NET MAUI Blazor App
Web開発者が始める .NET MAUI Blazor App
TomomitsuKusaba
Event Driven Microservices with Spring Cloud Stream #jjug_ccc #ccc_ab3
Event Driven Microservices with Spring Cloud Stream #jjug_ccc #ccc_ab3
Toshiaki Maki
Practical migration from JSP to Thymeleaf
Practical migration from JSP to Thymeleaf
Toshiki Iga
ドメイン駆動設計 基本を理解する
ドメイン駆動設計 基本を理解する
増田 亨
コンテナネットワーキング(CNI)最前線
コンテナネットワーキング(CNI)最前線
Motonori Shindo
ドメイン駆動設計 本格入門
ドメイン駆動設計 本格入門
増田 亨
Pattern driven Enterprise Architecture
Pattern driven Enterprise Architecture
WSO2
SpringOne 2GX 2014 参加報告 & Spring 4.1について #jsug
SpringOne 2GX 2014 参加報告 & Spring 4.1について #jsug
Toshiaki Maki
Mais conteúdo relacionado
Mais procurados
Apache Spark の紹介(前半:Sparkのキホン)
Apache Spark の紹介(前半:Sparkのキホン)
NTT DATA OSS Professional Services
ドメイン駆動設計サンプルコードの徹底解説
ドメイン駆動設計サンプルコードの徹底解説
増田 亨
SQL大量発行処理をいかにして高速化するか
SQL大量発行処理をいかにして高速化するか
Shogo Wakayama
Springを何となく使ってる人が抑えるべきポイント
Springを何となく使ってる人が抑えるべきポイント
土岐 孝平
大規模・長期保守を見据えたエンタープライズシステム開発へのSpring Frameworkの適用
大規模・長期保守を見据えたエンタープライズシステム開発へのSpring Frameworkの適用
apkiban
GraalVM の概要と、Native Image 化によるSpring Boot 爆速化の夢
GraalVM の概要と、Native Image 化によるSpring Boot 爆速化の夢
apkiban
さくっと理解するSpring bootの仕組み
さくっと理解するSpring bootの仕組み
Takeshi Ogawa
Go 製リアルタイムサーバーの Kubernetes での運用について
Go 製リアルタイムサーバーの Kubernetes での運用について
KairiOkumura
ドメイン駆動で開発する ラフスケッチから実装まで
ドメイン駆動で開発する ラフスケッチから実装まで
増田 亨
Kubernetesのしくみ やさしく学ぶ 内部構造とアーキテクチャー
Kubernetesのしくみ やさしく学ぶ 内部構造とアーキテクチャー
Toru Makabe
Vue.jsでFormをAtomic Designしてみた時のコンポーネント間のデータのやりとり
Vue.jsでFormをAtomic Designしてみた時のコンポーネント間のデータのやりとり
Yuta Ohashi
Spring Cloud Data Flow の紹介 #streamctjp
Spring Cloud Data Flow の紹介 #streamctjp
Yahoo!デベロッパーネットワーク
Landoを利用したdrupal開発環境構築
Landoを利用したdrupal開発環境構築
otofu1
これからSpringを使う開発者が知っておくべきこと
これからSpringを使う開発者が知っておくべきこと
土岐 孝平
Web開発者が始める .NET MAUI Blazor App
Web開発者が始める .NET MAUI Blazor App
TomomitsuKusaba
Event Driven Microservices with Spring Cloud Stream #jjug_ccc #ccc_ab3
Event Driven Microservices with Spring Cloud Stream #jjug_ccc #ccc_ab3
Toshiaki Maki
Practical migration from JSP to Thymeleaf
Practical migration from JSP to Thymeleaf
Toshiki Iga
ドメイン駆動設計 基本を理解する
ドメイン駆動設計 基本を理解する
増田 亨
コンテナネットワーキング(CNI)最前線
コンテナネットワーキング(CNI)最前線
Motonori Shindo
ドメイン駆動設計 本格入門
ドメイン駆動設計 本格入門
増田 亨
Mais procurados
(20)
Apache Spark の紹介(前半:Sparkのキホン)
Apache Spark の紹介(前半:Sparkのキホン)
ドメイン駆動設計サンプルコードの徹底解説
ドメイン駆動設計サンプルコードの徹底解説
SQL大量発行処理をいかにして高速化するか
SQL大量発行処理をいかにして高速化するか
Springを何となく使ってる人が抑えるべきポイント
Springを何となく使ってる人が抑えるべきポイント
大規模・長期保守を見据えたエンタープライズシステム開発へのSpring Frameworkの適用
大規模・長期保守を見据えたエンタープライズシステム開発へのSpring Frameworkの適用
GraalVM の概要と、Native Image 化によるSpring Boot 爆速化の夢
GraalVM の概要と、Native Image 化によるSpring Boot 爆速化の夢
さくっと理解するSpring bootの仕組み
さくっと理解するSpring bootの仕組み
Go 製リアルタイムサーバーの Kubernetes での運用について
Go 製リアルタイムサーバーの Kubernetes での運用について
ドメイン駆動で開発する ラフスケッチから実装まで
ドメイン駆動で開発する ラフスケッチから実装まで
Kubernetesのしくみ やさしく学ぶ 内部構造とアーキテクチャー
Kubernetesのしくみ やさしく学ぶ 内部構造とアーキテクチャー
Vue.jsでFormをAtomic Designしてみた時のコンポーネント間のデータのやりとり
Vue.jsでFormをAtomic Designしてみた時のコンポーネント間のデータのやりとり
Spring Cloud Data Flow の紹介 #streamctjp
Spring Cloud Data Flow の紹介 #streamctjp
Landoを利用したdrupal開発環境構築
Landoを利用したdrupal開発環境構築
これからSpringを使う開発者が知っておくべきこと
これからSpringを使う開発者が知っておくべきこと
Web開発者が始める .NET MAUI Blazor App
Web開発者が始める .NET MAUI Blazor App
Event Driven Microservices with Spring Cloud Stream #jjug_ccc #ccc_ab3
Event Driven Microservices with Spring Cloud Stream #jjug_ccc #ccc_ab3
Practical migration from JSP to Thymeleaf
Practical migration from JSP to Thymeleaf
ドメイン駆動設計 基本を理解する
ドメイン駆動設計 基本を理解する
コンテナネットワーキング(CNI)最前線
コンテナネットワーキング(CNI)最前線
ドメイン駆動設計 本格入門
ドメイン駆動設計 本格入門
Destaque
Pattern driven Enterprise Architecture
Pattern driven Enterprise Architecture
WSO2
SpringOne 2GX 2014 参加報告 & Spring 4.1について #jsug
SpringOne 2GX 2014 参加報告 & Spring 4.1について #jsug
Toshiaki Maki
Data Microservices with Spring Cloud Stream, Task, and Data Flow #jsug #spri...
Data Microservices with Spring Cloud Stream, Task, and Data Flow #jsug #spri...
Toshiaki Maki
実例で学ぶ、明日から使えるSpring Boot Tips #jsug
実例で学ぶ、明日から使えるSpring Boot Tips #jsug
Toshiaki Maki
Talend5.4~もう少し深く知る~(技術セッション)
Talend5.4~もう少し深く知る~(技術セッション)
Talend KK
Talend勉強会 20150414
Talend勉強会 20150414
kuroiwa
テスト駆動開発を継続する
テスト駆動開発を継続する
irof N
地方における勉強会事情
地方における勉強会事情
Soudai Sone
Spring I/O 2016 報告 Test / Cloud / Other Popular Sessions
Spring I/O 2016 報告 Test / Cloud / Other Popular Sessions
Takuya Iwatsuka
システム設計の謎 ~べ、別にあんたのために設計してるんじゃないんだからね///~
システム設計の謎 ~べ、別にあんたのために設計してるんじゃないんだからね///~
terahide
The Spring Update
The Spring Update
Gunnar Hillert
Extending Spring for Custom Usage
Extending Spring for Custom Usage
Joshua Long
Designing and building a micro-services architecture. Stairway to heaven or a...
Designing and building a micro-services architecture. Stairway to heaven or a...
Sander Hoogendoorn
R5 3 type annotation
R5 3 type annotation
EIICHI KIMURA
失敗から学ぶAPI設計 #ccc_h4 #jjug #jjug_ccc JJUG CCC 2013 Spring
失敗から学ぶAPI設計 #ccc_h4 #jjug #jjug_ccc JJUG CCC 2013 Spring
Yusuke Yamamoto
TPS Lean and Agile - Brief History and Future
TPS Lean and Agile - Brief History and Future
Kiro Harada
Enterprise Integration and Batch Processing on Cloud Foundry
Enterprise Integration and Batch Processing on Cloud Foundry
Joshua Long
Big Data Hadoop Training by Easylearning Guru
Big Data Hadoop Training by Easylearning Guru
KCC Software Ltd. & Easylearning.guru
Spring Batch Behind the Scenes
Spring Batch Behind the Scenes
Joshua Long
Spring Integration and EIP Introduction
Spring Integration and EIP Introduction
Iwein Fuld
Destaque
(20)
Pattern driven Enterprise Architecture
Pattern driven Enterprise Architecture
SpringOne 2GX 2014 参加報告 & Spring 4.1について #jsug
SpringOne 2GX 2014 参加報告 & Spring 4.1について #jsug
Data Microservices with Spring Cloud Stream, Task, and Data Flow #jsug #spri...
Data Microservices with Spring Cloud Stream, Task, and Data Flow #jsug #spri...
実例で学ぶ、明日から使えるSpring Boot Tips #jsug
実例で学ぶ、明日から使えるSpring Boot Tips #jsug
Talend5.4~もう少し深く知る~(技術セッション)
Talend5.4~もう少し深く知る~(技術セッション)
Talend勉強会 20150414
Talend勉強会 20150414
テスト駆動開発を継続する
テスト駆動開発を継続する
地方における勉強会事情
地方における勉強会事情
Spring I/O 2016 報告 Test / Cloud / Other Popular Sessions
Spring I/O 2016 報告 Test / Cloud / Other Popular Sessions
システム設計の謎 ~べ、別にあんたのために設計してるんじゃないんだからね///~
システム設計の謎 ~べ、別にあんたのために設計してるんじゃないんだからね///~
The Spring Update
The Spring Update
Extending Spring for Custom Usage
Extending Spring for Custom Usage
Designing and building a micro-services architecture. Stairway to heaven or a...
Designing and building a micro-services architecture. Stairway to heaven or a...
R5 3 type annotation
R5 3 type annotation
失敗から学ぶAPI設計 #ccc_h4 #jjug #jjug_ccc JJUG CCC 2013 Spring
失敗から学ぶAPI設計 #ccc_h4 #jjug #jjug_ccc JJUG CCC 2013 Spring
TPS Lean and Agile - Brief History and Future
TPS Lean and Agile - Brief History and Future
Enterprise Integration and Batch Processing on Cloud Foundry
Enterprise Integration and Batch Processing on Cloud Foundry
Big Data Hadoop Training by Easylearning Guru
Big Data Hadoop Training by Easylearning Guru
Spring Batch Behind the Scenes
Spring Batch Behind the Scenes
Spring Integration and EIP Introduction
Spring Integration and EIP Introduction
Semelhante a Spring integration概要
Clrh 110716 wcfwf
Clrh 110716 wcfwf
Tomoyuki Obi
はじめてのCodeIgniter
はじめてのCodeIgniter
Yuya Matsushima
Driverについて
Driverについて
幸雄 村上
AzureDevOpsで作るHoloLensアプリCI環境
AzureDevOpsで作るHoloLensアプリCI環境
Tatsuya Sakai
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...
David Buck
sveltekit-ja.pdf
sveltekit-ja.pdf
ssuser65180a
ochacafe#6 人にもマシンにもやさしいAPIのエコシステム
ochacafe#6 人にもマシンにもやさしいAPIのエコシステム
オラクルエンジニア通信
1st step LogicFlow
1st step LogicFlow
Tomoyuki Obi
ASP.NET 新時代に向けて ~ ASP.NET 5 / Visual Studio 2015 基礎解説
ASP.NET 新時代に向けて ~ ASP.NET 5 / Visual Studio 2015 基礎解説
Akira Inoue
今こそ知りたいSpring Web(Spring Fest 2020講演資料)
今こそ知りたいSpring Web(Spring Fest 2020講演資料)
NTT DATA Technology & Innovation
MySQL57 Update@OSC Fukuoka 20151003
MySQL57 Update@OSC Fukuoka 20151003
Shinya Sugiyama
【改訂版あり】クラウド・ネイティブ時代に最適なJavaベースのマイクロサービス・フレームワーク ~ Helidonの実力を見極めろ!
【改訂版あり】クラウド・ネイティブ時代に最適なJavaベースのマイクロサービス・フレームワーク ~ Helidonの実力を見極めろ!
オラクルエンジニア通信
Automatic api document generation 101
Automatic api document generation 101
LINE Corporation
ASP.NET MVC 1.0
ASP.NET MVC 1.0
Shinpei Ohtani
AnsibleおよびDockerで始めるInfrastructure as a Code
AnsibleおよびDockerで始めるInfrastructure as a Code
Satoru Yoshida
OCHaCafe Season 2 #4 - Cloud Native時代のモダンJavaの世界
OCHaCafe Season 2 #4 - Cloud Native時代のモダンJavaの世界
オラクルエンジニア通信
Eclipse を使った java 開発 111126 杉浦
Eclipse を使った java 開発 111126 杉浦
urasandesu
Scala + Finagleの魅力
Scala + Finagleの魅力
Kota Mizushima
20091030cakephphandson 01
20091030cakephphandson 01
Yusuke Ando
Spring Framework ふりかえりと4.3新機能
Spring Framework ふりかえりと4.3新機能
kimulla
Semelhante a Spring integration概要
(20)
Clrh 110716 wcfwf
Clrh 110716 wcfwf
はじめてのCodeIgniter
はじめてのCodeIgniter
Driverについて
Driverについて
AzureDevOpsで作るHoloLensアプリCI環境
AzureDevOpsで作るHoloLensアプリCI環境
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...
sveltekit-ja.pdf
sveltekit-ja.pdf
ochacafe#6 人にもマシンにもやさしいAPIのエコシステム
ochacafe#6 人にもマシンにもやさしいAPIのエコシステム
1st step LogicFlow
1st step LogicFlow
ASP.NET 新時代に向けて ~ ASP.NET 5 / Visual Studio 2015 基礎解説
ASP.NET 新時代に向けて ~ ASP.NET 5 / Visual Studio 2015 基礎解説
今こそ知りたいSpring Web(Spring Fest 2020講演資料)
今こそ知りたいSpring Web(Spring Fest 2020講演資料)
MySQL57 Update@OSC Fukuoka 20151003
MySQL57 Update@OSC Fukuoka 20151003
【改訂版あり】クラウド・ネイティブ時代に最適なJavaベースのマイクロサービス・フレームワーク ~ Helidonの実力を見極めろ!
【改訂版あり】クラウド・ネイティブ時代に最適なJavaベースのマイクロサービス・フレームワーク ~ Helidonの実力を見極めろ!
Automatic api document generation 101
Automatic api document generation 101
ASP.NET MVC 1.0
ASP.NET MVC 1.0
AnsibleおよびDockerで始めるInfrastructure as a Code
AnsibleおよびDockerで始めるInfrastructure as a Code
OCHaCafe Season 2 #4 - Cloud Native時代のモダンJavaの世界
OCHaCafe Season 2 #4 - Cloud Native時代のモダンJavaの世界
Eclipse を使った java 開発 111126 杉浦
Eclipse を使った java 開発 111126 杉浦
Scala + Finagleの魅力
Scala + Finagleの魅力
20091030cakephphandson 01
20091030cakephphandson 01
Spring Framework ふりかえりと4.3新機能
Spring Framework ふりかえりと4.3新機能
Spring integration概要
1.
Spring Integration 概要 ! @Kuro
2.
本日のアジェンダ 1. Spring Integrationとは 2.
Spring Integrationの基本構成要素 3. サンプル紹介 4. 他製品との比較 2
3.
Spring Integrationとは? • Spring Projectのひとつ • EIP
(Enterprise Integration Patterns) に基 づくアプリケーション開発をサポートするフ レームワーク • 多彩なアダプタで外部サービスとの接続もサ ポート • Spring XD(ビックデータ解析)のベースに もなっている 3
4.
EIPとは? • エンタープライズ統合の 方式をパターン化 • 65パターン • http:// www.eaipatterns.com / 4
5.
EIPとは? Message Router Polling Consumer Publish-Subscribe
Channel 5
6.
本日のアジェンダ 1. Spring Integrationとは 2.
Spring Integrationの基本構成要素 3. サンプル紹介 4. 他製品との比較 6
7.
Spring Integration の 基本構成要素 • Message • Message
Channel • Endpoint Message Endpoint Channel Message Endpoint 7 Channel Endpoint
8.
Message • Spring Integration内でやり取りするデータを示すオブジェクト • HeaderとPayloadで構成 • HeaderはMapString, Object、Payloadは任意のオブジェクト • Headerにはid,
timestamp, priorityなどの予め定義されている項目もある public interface MessageT { MessageHeaders getHeaders(); T getPayload(); } ! public final class MessageHeaders implements MapString, Object, Serializable { …省略… } 8
9.
Message Channel • Messageの伝送路を示す • 2種類の配信モード(P2P, Pub/Sub) • P2Pモードは1つの受信者に届く • Pub/Subは登録している受信者すべてに届く 9
10.
Message Channel • MessageChannel public interface
MessageChannel { boolean send(Message? message); ! boolean send(Message? message, long timeout); } • 送信のみ定義。 PollableChannel public interface PollableChannel extends MessageChannel { Message? receive(); ! Message? receive(long timeout); } • 能動的に受信する。 SubscribableChannel public interface SubscribableChannel extends MessageChannel { boolean subscribe(MessageHandler handler); boolean unsubscribe(MessageHandler handler); } 10 登録したHandler に配信される。
11.
Message Channel • PollableChannel • • PriorityChannel:PRIORITYヘッダの値で並び替え。 • • QueueChannel:FIFOのキュー。 RendezvousChannel:容量0のキュー。 SubscribableChannel • PublishSubscribeChannel:すべてのSubscriberに配布。 • DirectChannel:1つのSubscriberのみに配布。channelのデフォルト • ExecuterChannel:配布先が別スレッドで動作。 11
12.
Endpoint • Service Activator • Transformer • Channel Adapter • Filter • Message
Bridge • Router • Gateway • Splitter • Resequencer • Aggregator 12
13.
本日のアジェンダ 1. Spring Integrationとは 2.
Spring Integrationの基本構成要素 3. サンプル紹介 4. 他製品との比較 13
14.
Hello World Hello, Kuro Kuro String Service Activator String Hello World Service output
= “Hello, ” + input; 凡例: Channel 14 Endpoint POJO
15.
下準備 pom.xml !-- Spring Integration
-- dependency groupIdorg.springframework.integration/groupId artifactIdspring-integration-core/artifactId version2.2.6.RELEASE/version /dependency jarファイル 15
16.
Hello World:実装 bean定義ファイル int:channel id=inputChannel/ int:channel
id=outputChannel int:queue capacity=10/ /int:channel ! ! 1. 入出力Channelを定義。 2. Service Activatorを定義。 !-- inputChannel = HelloService#sayHello = outputChannel -- int:service-activator input-channel=inputChannel output-channel=outputChannel ref=helloService 3. Serviceはbeanとして定義。 method=sayHello/ beans:bean id=helloService class=“net.spring.HelloService/ HelloService.java public class HelloService { ! } public String sayHello(String name) { return “Hello, + name; } 16
17.
Hello World:テスト @Test public void
helloWorldTest() { ApplicationContext applicationContext = new ClassPathXmlApplicationContext(/METAINF/spring/integration/helloWorld.xml); ! // 送信メッセージ MessageString message = MessageBuilder.String withPayload(Kuro).build(); ! // 送信 MessageChannel inputChannel = applicationContext.getBean(“inputChannel, MessageChannel.class); inputChannel.send(message); ! // 受信 PollableChannel outputChannel = applicationContext.getBean(outputChannel, PollableChannel.class); MessageString output = (MessageString) outputChannel.receive(); ! // 確認 logger.debug(output: + output.getPayload()); assertThat(output.getPayload(), is(Hello, Kuro)); } 17
18.
サービス呼出方法をかえる • 同期Gateway • 非同期Gateway • File Adapter(Channel Adapter) 18
19.
Hello World:同期Gateway Kuro String Gateway Hello, Kuro String Service Activator Hello World Service 凡例:
Channel 19 Endpoint POJO
20.
Hello World:同期Gateway HelloWorldServiceGateway.java 1. interfaseを定義。 public
interface HelloWorldServiceGateway { public String sayHello(String name); } 2. request-channelとreply-channelに 入力と出力Channelを設定。 bean定義ファイル !-- HelloWorldService 同期Gateway -- int:gateway id=HelloWorldServiceGateway default-request-channel=inputChannel default-reply-channel=outputChannel service-interface=“net.spring.gateway.HelloWorldServiceGateway / 20
21.
Hello World:同期Gateway HelloWorldTest.java @Test public void
helloWorldServiceGatewayTest() throws Exception { ApplicationContext applicationContext = new ClassPathXmlApplicationContext( /META-INF/spring/integration/helloWorld.xml); ! HelloWorldServiceGateway gateway = applicationContext .getBean(HelloWorldServiceGateway, HelloWorldServiceGateway.class); String message = gateway.sayHello(Kuro); 呼出がシンプルになる。 ! assertThat(message, is(Hello, Kuro)); } 21
22.
Hello World:非同期Gateway Kuro String Gateway Hello, Kuro String Service Activator Hello World Service 凡例:
Channel 22 Endpoint POJO
23.
Hello World:非同期Gateway 1. interfaseを定義。返り HelloWorldServiceGatewayAsync.java 値の方はFuture。 public
interface HelloWorldServiceGatewayAsync { public FutureString sayHello(String name); } 2. request-channelとreply-channelに 入力と出力Channelを設定。 bean定義ファイル !-- HelloWorldService 非同期Gateway -- int:gateway id=HelloWorldServiceGatewayAsync default-request-channel=inputChannel default-reply-channel=outputChannel service-interface=net.spring.gateway.HelloWorldServiceGatewayAsync / 23
24.
Hello World:非同期Gateway HelloWorldTest.java @Test public void
helloWorldServiceGatewayAsyncTest() throws Exception { ApplicationContext applicationContext = new ClassPathXmlApplicationContext(/ META-INF/spring/integration/helloWorld.xml); ! HelloWorldServiceGatewayAsync gateway = applicationContext .getBean(HelloWorldServiceGatewayAsync, HelloWorldServiceGatewayAsync.class); FutureString future = gateway.sayHello(Kuro); ! String message = null; while (true) { 非同期で結果を取得。 if (future.isDone()) { message = future.get(); break; } } assertThat(message, is(Hello, Kuro)); } 24
25.
Hello World:File Adapter File Adapter Kuro File String Transformer Service Activator Hello, Kuro String hello-world-kuro.txt Hello
World Service 凡例: Channel 25 Endpoint POJO
26.
Hello World:File Adapter bean定義ファイル !--
HelloWorldScervice FileAdapter -- int-file:inbound-channel-adapter id=fileAdapter directory=file:${java.io.tmpdir} channel=filesInChannel filename-pattern=hello-world-*.txt int:poller fixed-rate=1000 / /int-file:inbound-channel-adapter ! int-file:file-to-string-transformer delete-files=true charset=UTF-8 input-channel=filesInChannel output-channel=inputChannel / 26
27.
Hello World:File Adapter HelloWorldTest.java @Test public
void helloWorldServiceFileAdapterTest() throws Exception { ApplicationContext applicationContext = new ClassPathXmlApplicationContext(/METAINF/spring/integration/helloWorld.xml); ! // ポーリングされるディレクトリにファイルを出力する。 String tmpdirPath = System.getProperty(java.io.tmpdir); String inputFilePath = tmpdirPath + hello-world-kuro.txt; File nameFile = new File(inputFilePath); OutputStream outputStream = new FileOutputStream(nameFile); outputStream.write(Kuro.getBytes()); outputStream.close(); // 受信 PollableChannel outputChannel = applicationContext .getBean(outputChannel, PollableChannel.class); MessageString output = (MessageString) outputChannel.receive(); assertThat(output.getPayload(), is(Hello, Kuro)); } 27
28.
File以外のAdapter • AMQP • JPA • Stream • Kafka* • Feed • JMS • Syslog • MQTT* • File • Mail • Tail • Print* • FTP/FTPS • MongoDB • Twitter • SMB* • GemFile • Redis • Web Service • SMPP* • HTTP • Resource • XML • Splunk* • TCP/UDP • RMI • XMPP • Voldemort* • JDBC • SFTP • AWS* • XQuery* 28 *extensions (https://github.com/spring-projects/spring-integration-extensions)
29.
STS(Spring Tool Suite) •
STSを使うとフローを可視化できる。 • 使い勝手はあまりよくない? 29
30.
その他のEndpoint • Spritter • Router • Aggregator 30
31.
メッセージの永続化 • キューにMessageStoreを設定することで可能 • サポートしているMessageStore • • Redis • MongoDB • • JDBC Gemfire ただし、キューの永続化にRDBMSは非推奨 int:channel id=outputChannel int:queue capacity=10
message-store=refMessagestore/ /int:channel 31
32.
本日のアジェンダ 1. Spring Integrationとは 2.
Spring Integrationの基本構成要素 3. サンプル紹介 4. 他製品との比較 32
33.
Spring Integrationの特徴 • 既存のSpringアプリケーションとの相性がよい。 • POJOを基本としているためコンポーネントの試験がしやすい。 • 軽量(JUnitやWebアプリから起動可能)。 • インストール不要(It s
a framework, not an application)。 • OSSなのでソースコードを読んで拡張可能! • XML地獄…。 33
34.
他製品との比較 • Apache Camel • Mule ESB 34
35.
Mule ESB • エディタが非常にリッチ。 • 要インストール(but easy)。 • 実績多し。 • 商用版のみの機能もあり。 35
36.
Apache Camel • Spring Integrationと内容はほぼ一緒。 • Springとも連携できる。 • コンポーネントの種類は多い(AWSやFacebookやgmail)。 • フロー記述のDSLはSpring
Integrationより明快。 • 日本Apache Camelユーザ会が存在(国内実績もあり)。 public void configure() { from(“file:src/data?noop=true) .choice() .when(xpath(“/person/city=#39;London#39;)) .to(file:target/messages/uk) .otherwise() .to(file:target/messages/others); } 36 JACUG応援キャラクターのアイシャちゃん
37.
結局使いどころは? • 既存のSpringアプリケーションにフロー制御を追加す る要件が出た場合 • 信頼性(永続化)、運用性(リトライ、リスタート)、 拡張性(クラスタリング)については要処理方式検討 • SpringXDにも期待 37
38.
まとめ Spring Integration • EIPの参照実装 •
Spring Integrationの基本 • Message • MessageChannel • Endpoint • Message • Header • Payload MessageChannel • P2P • Pub/Sub • Endpoint • ServiceActivator • 呼出 • Gateway • Channel Adapter • 他製品 • Mule ESB • Apache Camel • • 38
39.
参考リンク集 • Spring Integration http://projects.spring.io/spring-integration/ • Spring Integration
Samples https://github.com/spring-projects/spring-integration-samples • Spring Integration Extensions https://github.com/spring-projects/spring-integration-extensions • Spring Integration and EIP Introduction http://www.slideshare.net/iweinfuld/spring-integration-and-eip-introduction • Light-weight, Open-source Integration: Apache Camel vs. Spring Integration http://java.dzone.com/articles/light-weight-open-source • Which Integration Framework to use ‒ Spring Integration, Mule ESB or Apache Camel? http://www.kai-waehner.de/blog/2012/01/10/spoilt-for-choice-which-integration-framework-to-use-spring-integration-muleesb-or-apache-camel/ • Apache Camel http://camel.apache.org/ • 日本Apache Camelユーザー会 http://sourceforge.jp/projects/cameluserjp/wiki/FrontPage • Mule ESB http://www.mulesoft.org/ 39
Baixar agora