Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Spring Integration by Thibault Weintraub

Michael Isvy
December 04, 2014

Spring Integration by Thibault Weintraub

Michael Isvy

December 04, 2014
Tweet

More Decks by Michael Isvy

Other Decks in Technology

Transcript

  1. or

  2. Spring Projects Grails Batch Data Commons Data JDBC Extensions Data

    Neo4J Data Solr for Apache Hadoop Integration Mobile Security Oauth Social Facebook Web Services Reactor Project Boot Data Gemfire Data JPA Data Redis Flex Framework IO Platform Roo Shell Social Twitter XD AMQP Cloud Connectors DATA JDBC Extensions Data MongoDB Data REST for Android HATEOAS Security Social Web Flow
  3. Spring Integration Promote loose-coupling between components. The Message Channel plays

    an important role in that producers and consumers do not have to know about each other
  4. Development public class Generator { public Alert generate(Context context) {

    return new Alert(context); } } public class Filestore { public void store(Alert alert) { FileUtils.save(alert); } } <int:service-activator input-channel="…" output-channel="channel"> <bean class="Generator"/> </int:service-activator> <int:channel id="channel"/> <int:service-activator input-channel="channel" output-channel="…"> <bean class="Filestore"/> </int:service-activator>
  5. Customer 1 Generate an alert and send it using a

    push API <int:service-activator input-channel="…" output-channel="channel"> <bean class="Generator"/> </int:service-activator> <int:channel id="channel"/> <int:service-activator input-channel="channel" output-channel="…"> <bean class="PushAPI"/> </int:service-activator>
  6. Direct channel (FIFO), generator and pushapi run in the same

    thread Publish Subscribe channel, generator and pushapi run in separate threads asynchronous made easy
  7. public class MyUnitOfWork { private MyService service; public String generate(String

    message) { return service.render(message); } } public interface MyService { String render(String message); } channel as a Java method Spring to provide the implementation <bean  id="myendpoint"  class="MyUnitOfWork"  p:service-­‐ref="myservice"/>   <int:gateway  id="myservice"  service-­‐interface="MyService">    <int:method  name="render"  request-­‐channel="channel"/>   </int:gateway>      
  8. Rich set of endpoints AMQP, File, FTP, Gemfire, HTTP, Mail,

    JDBC, JPA, JMS, MongoDB, REDIS, RMI, TCP, UDP, Websocket and more Pay attention to Transactions' scope when using asynchronous channels Summary
  9. Configuration can be verbose Spring Integration Java DSL released Refrain

    from over engineering channels and endpoints Balance flexibility and readibility Summary