Sprintintegration ajip

739 views

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
739
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Whats the Problem we are trying to solve
  • Transport - Waiter Takes Order and Moes to BaristaAsynchronous - Multiple ActiviesTranslation - Menu Item -> Number -> RecipeRouting - Orders Arrive Back at Table
  • Bruice Distributed System there are 3 ConcernsConsistency,Availablity – Every request has a guaranteed response, ParitionTolerence
  • Advantages-- Parallel-- Can Easily Add New Logic
  • Messages carry informationChannel Represents the Locations where Msg is being sent
  • Buffering Message – Variable Load , ability to withstand highloads is an important performance factor
  • - Bridge Supports Connection of Two Channels
  • Sprintintegration ajip

    1. 1. Spring Integration HandsOnMak Bhatamrekarhttp://github.com/makrand-bkarAJCPhttp://meetup.com/my-ajcpAtlanta Java Concept Pros
    2. 2. Agenda• Introduction• Message Channel• End Points• Example• Recap
    3. 3. • Applications Need to Talk• Strategies– File Sharing– Single Database– Messaging• Most common Approach forEAI and Basis of SI• Messages can be Enriched,Transformed, Routed, Filtered
    4. 4. SI History• Nov 2007 – First Commit• Nov 2008 – 1.0• Nov 2010 – 2.0• Jun 2013 – 2.2.4
    5. 5. Why Spring SI• Spring has a good footprint• Large Range of EndPoint Adapters– File systems, FTP, REST, Sockets etc• Light Weight• POJO Based• Non Intrusive• Zero Configuration
    6. 6. Before
    7. 7. After
    8. 8. Building Blocks
    9. 9. SI Building Blocks• Messages• Channels• EndPoints
    10. 10. Message• public org.springframework.integration;public interface Message<T>{MessageHeaders getHeaders();T getPayload();}• MessageBuilder – Spring Impl
    11. 11. Message Channel• Decouples Consumers and Producers• Point to Point or Pub/Sub• Enforces Data Type ConsistencySpring Integration Has Pipes And Filters as Core Integration Pattern
    12. 12. <beans>…<int:channel id=“newAccounts”/></beans>
    13. 13. Message Channel• P2P– PollableChannel• receive()• receive(long timeout)– Queue/Priority/Rendezvous• Pub / Sub– Subscribable Channel• Subscribe()• UnSubscribe– MessageHandler• handleMessage(msg)• Message Buffering• Message Channel Intfboolean send(long timeout)
    14. 14. Channel Selection• Sharing Context -– ThreadLocal / ThreadContext / Stack• Atomic Boundaries• Buffering
    15. 15. Enterprise Integration Patterns• Pipes And Filter• Bridge
    16. 16. EndPoints• Produces /Consumes Messages For Channel• Out of the box endpoints– Adapters, Transformers– Filters, Routing , Splitter, Aggregation– Message Enricher, Delayer• UniDirectional / BiDirectional– Adapters – UniDirection– Gateways - BiDirectional
    17. 17. Transformer
    18. 18. Message Adapter
    19. 19. Service Activator<int:service-activator input-channel="positions-channel"ref="newPositionProcessor"method="processNewPosition"></int:service-activator>
    20. 20. Message Translator/ Transformer<int:object-to-map-transformerinput-channel="in-channel"output-channel="stdout"></int:object-to-map-transformer>• E.G Map, Object To String, XML, JSON• Custom Transformers Can be added by Annotations too like @Transformer
    21. 21. Rube Goldberg Scenario
    22. 22. Performance
    23. 23. Performance – MS Value• Amazon – 100ms == 1% of lost sales• Yahoo – 400 ms == drops traffic 5-9%
    24. 24. Typical Requirements• Latency Requirements– Few ms +• Throughtput Requirements– Message type dependant– 10s of hundreds of thousandsSource : AndrewElmorehttp://www.springsource.org/node/22599
    25. 25. Simple Test Stats• Results– Throughtput – 350K messages/ sec– Latency - < 4us
    26. 26. References• Spring Integration Homepage http://www.springsource.org/spring-integration• Spring Expressionhttp://static.springsource.org/spring/docs/3.0.x/reference/expressions.html• http://www.javacodegeeks.com/2012/06/rube-goldberg-spring-integration_22.html
    27. 27. Spring Integration Hands OnMak Bhatamrekargithub :http://github.com/makrand-bkartwitter : mak-bkarurl : www.careerinjava.comhttp://meetup.com/my-ajcpAtlanta Java Concept Pros

    ×