Uvod u spring integration

292 views
223 views

Published on

This is presentation I held at first Croatian Java conference (HUJAK) in 2012 in Tuhelj.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
292
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
7
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Mnogo aplikacija, različite tehnologije, različiti protokoliApplication of technology defined as the integration of data and services between applications.Pattersinisuizumljeni, negoproizlazeizponavljanajakorištenja u praksiEAI, SOA, ESB, Messaging, Web service..
  • Spring Building Blocks (jdbc, jms transaction etc.) + EIP = more focused framework for application integrationLightweight – run from Junit test – within webapp, but can be deployed within esb or part of message brokerJednostavanzakorištenje korisnicima Spring (app context configuration)application context is the bus!Not an ESB, rather mediation and routing framework – “mediating” - allows two different systems with different messages and protocols to talk with each otherESB – većina drugih (osim Apache Camela)... Esb je aplikacija ne framework – (poseban server, startanje etc.).. Pogodno za kompleksno rutanje
  • Payload – any objectHeader –Id, expiration date, prority , return address …Channel – point to point / publish-subscribeMessaging – transport, asinkrono, translation, routing, loose coupled, performanse, sklalabilnost, fleksibilnost, robustnost ,filtering, interception …
  • Kada, Zašto i Što još nismo spomenuli...Kada – kada vec koristimo Spring, ne trebamo full ESB, a trebamo integraciju s nekim od FTP, file, jms...JMS/SOA/Rest – sto ako trebamo integraciju s file-ftp ili nesto slicno?Modularna aplikacija, rad s vanjskimŠto još – transakcije, security, logging, error handling...
  • Uvod u spring integration

    1. 1. Uvod u Spring Integration
    2. 2. Agenda• Enterprise Application Integration & Enterprise Integration Patterns• Uvod u Spring Integration• Messaging• Osnovni patterni• Primjeri• Zaključak
    3. 3. Enterprise Application Integration Aplikacije Protokoli Tehnologije
    4. 4. Spring Integration• Spring + EIP• Lightweight• Jednostavan (Spring-like)• Nije ESB• Mediation & Routing framework Spring Integration
    5. 5. Message(ing) Message Header Channel Endpoint Payload
    6. 6. Enterprise Integration Patterns In ChAdap transformer Out ChAdap
    7. 7. Channel Endpoints RMI TCP/UDPJMS WS Stream
    8. 8. Primjer – twitter to gtalk#mentions
    9. 9. Primjer - twitter to gtalk<bean id="twitterTemplate" class="org.springframework.social.twitter.api.impl.TwitterTemplate"> <constructor-arg value="${twitter.oauth.consumerKey}"/> <constructor-arg value="${twitter.oauth.consumerSecret}"/> <constructor-arg value="${twitter.oauth.accessToken}"/> <constructor-arg value="${twitter.oauth.accessTokenSecret}"/></bean><twitter:inbound-channel-adapter twitter-template="twitterTemplate" channel="inboundTwitterChannel"> <int:poller fixed-rate="2000" max-messages-per-poll=“10"/></twitter:inbound-channel-adapter><twitter:search-inbound-channel-adapter query="#springintegration" twitter-template="twitterTemplate" channel=" inboundTwitterChannel"> <int:poller fixed-rate=“5000" max-messages-per-poll=" 10 "/></twitter:search-inbound-channel-adapter>
    10. 10. Primjer - twitter to gtalk<int:transformer input-channel="inboundTwitterChannel" output-channel="outputChannel"expression="[ + payload.getFromUser() + ]: + payload.getText() + "/><int:bridge input-channel="outputChannel" output-channel="toUserChannel"> <int:poller max-messages-per-poll="1" fixed-rate="3000"/></int:bridge><int-xmpp:xmpp-connection id="googleTalkConnection" user="${xmpp.login}" password="${xmpp.password}" host="${xmpp.host}" service-name="${xmpp.service}" port="${xmpp.port}"/><int-xmpp:header-enricher input-channel="toUserChannel" output-channel="imChannel"> <int-xmpp:chat-to value="${send.to.user}"/></int-xmpp:header-enricher><int:channel id="toUserChannel"/><int-xmpp:outbound-channel-adapter channel="imChannel" xmpp-connection="googleTalkConnection"/>
    11. 11. Primjer – database polling<int-jdbc:inbound-channel-adapter query="select * from item where status=1" channel="inDbChannel" data-source="pollingDataSource" update="update item set status=10 where id in (:id)" task-executor="pool" > <int:poller fixed-rate="1000" > <int:transactional/> </int:poller></int-jdbc:inbound-channel-adapter>
    12. 12. Primjer – cafe
    13. 13. Spring Integration – zaključak• Kada, Zašto, Što Još?• Hvala• Pitanja?
    14. 14. Kontakt• Samir Čauš Software Developer gsm +385 91 5720896 mail samir.caus@fiveminutes.eu skype samircaus twitter twitter.com/samircaus http://www.fiveminutes.eu

    ×