• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Ibeans Dead Simple Integration
 

Ibeans Dead Simple Integration

on

  • 3,225 views

Many web applications need integration capabilities but don't want to build an ESB solution. Typically, they want a simple solution for performing common integration tasks such as receiving and ...

Many web applications need integration capabilities but don't want to build an ESB solution. Typically, they want a simple solution for performing common integration tasks such as receiving and sending messages over Email, JMS or calling a Web Service. This talk will cover some options available that greatly reduce the amount of code and effort for performing these tasks without introducing new complexities or architecture considerations using new framework - iBeans.

Statistics

Views

Total Views
3,225
Views on SlideShare
3,104
Embed Views
121

Actions

Likes
2
Downloads
21
Comments
0

3 Embeds 121

http://blogs.mulesoft.org 110
http://www.slideshare.net 7
http://www.techgig.com 4

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Dramatically simplified integration for Tomcat applications Simple API using annotations – no concepts or architecture Works in conjunction with other open source frameworks (e.g., JSP, JSF, Struts, Spring) Task-based integration, e.g.: Send/receive email Subscribe to JMS queue Poll RSS or Twitter feed Publish REST service Built with the cloud in mind Ideal for open source community model – “App Store for iBeans”
  • Where does the data go?

Ibeans Dead Simple Integration Ibeans Dead Simple Integration Presentation Transcript

  • iBeans dead-simple integration for the web
  • about me
    • Creator of the Mule ESB Project 2003
    • Founder, MuleSoft
    • Creator of iBeans
    • 15 years of hooking s#!t together
    • Lazy
  • agenda
    • Introduction to iBeans
    • The API
    • Code dive
    • Demo
    • The future of iBeans
  • overview
  • goals
    • Integration for the Web
    • No SOA
    • Minimal concepts, no TLAs
    • Reuse
    • Task-focused
    • Cross-platform; Java, JS, Scala, JRuby
  • server ‘api’
    • Application annotations
      • receive and send data
      • schedule tasks
      • create request / response services
      • HTTP, JMS, DB, FTP, etc
  • client ‘api’
    • iBeans - simple objects that talk to stuff
  • Application Annotations
  • annotations: schedule public class MyObject { @Schedule( interval=“ 60000 ” ) String shoutOut( ) { return “ Hey what’s up? ”; } } }
  • annotations: schedule with cron public class MyObject { @Schedule( cron=“ 0 * * * * ? ” ) String shoutOut( ) { return “ Hey what’s up? ”; } } }
  • annotations: scheduled send public class MyObject { @Schedule( cron=“ 0 * * * * ? ” ) @Send( uri=“ xmpp://${jabber.creds}@jabber.org:6666/myGroup?groupChat=true ” ) String shoutOut( ) { return “ Hey what’s up? ”; } }
  • annotations: receive public class MyObject { @Receive( uri=“ jms://my.queue ” ) void onMessage(Object msg ) { log(msg); } } }
  • annotations: polling receive public class MyObject { @Schedule( cron=“ 0 0 12 * * ? ” ) @Receive( uri=“ jms://my.queue ” ) void onMessage(Object msg ) { log(msg); } } }
  • Architecture
  • architecture Runtime Container: Tomcat, Tcat, (Mule) iBeans Channels: HTTP, SMTP, IMAP, WS, REST, JDBC, JMS, XMPP, FTP, ATOM Annotations (API) Transform and bindings Scheduler Web apps apps web your console
  • ibeans central Runtime Container: Tomcat, Tcat, (Mule) iBeans Channels: HTTP, SMTP, IMAP, WS, REST, JDBC, JMS, XMPP, FTP, ATOM Annotations (API) Transforms and bindings Scheduler Web apps apps web your console iBeans Central repository
  • iBean Objects
  • what are ibeans?
    • A way to access services
      • Facebook, AWS, eBay, Twitter
    • A well-defined interface to a service
      • ‘ service’ - public or internal
      • HTTP, JMS, FTP, JDBC, etc.
  • what are ibeans?
    • Encapsulate a service in a way that users don’t need to read the manual
    • Use in Java and JavaScript
      • more languages to follow
    • Re-usable, publish to iBeans Central
      • Or a private repository
  • ibeans in java public class MyObject { @IntegrationBean private TwitterIBean twitter; public void logTimeline() { twitter.setCredentials(“ user ”, “ shhhh ”); log(twitter.getFriendTimeline()); } }
  • ibeans in javascript
    • <script type = &quot; text/javascript ”>
    • var ibeans = new IBeansClient();
    • creds = ibeans.config.get(“ twitter.user ”, “ twitter.pass ”);
    • ibeans.twitter.setCredentials(creds[0], creds[1]);
    • ibeans.twitter.getFriendTimeline(readTweets);
    • function readTweets(tweets, error) {
    • //do stuff
    • }
    • </script>
  • create an ibean
    • A Java interface with annotated methods
    • A definition of how to talk to a service
      • Not the code to actually do it
  • create an ibean
    • public interface MyTwitterIBean
    • {
    • @Call( uri=&quot; http://twitter.com/statuses/show/{id}.json &quot; )
    • String statusesShow( @UriParam( &quot; id &quot; ) String id)
    • throws CallException;
    • }
  • ibeans can have state
    • public interface MyTwitterIBean
    • {
    • @State
    • void init( @UriParam( “ format ” ) String format);
    • @Call( uri=&quot; http://twitter.com/statuses/show/{id}.{format} &quot; )
    • String statusesShow( @UriParam( &quot; id &quot; ) String id) throws … ;
    • }
  • ibeans can have defaults
    • public interface MyTwitterIBean
    • {
    • @UriParam( “ format ” )
    • static String DEFAULT_FORMAT = “ json ”;
    • @State
    • void init( @UriParam( “ format ” ) String format);
    • @Call( uri=&quot; http://twitter.com/statuses/show/{id}.{format} &quot; )
    • String statusesShow( @UriParam( &quot; id &quot; ) String id) throws … ;
    • }
  • Transforms & Bindings
  • transforms
    • Transformers convert one object to another
      • String to a URL
      • Transform XML; Xquery, XSLT
      • Enrich data
  • transforms
    • Transformers are discovered not configured
      • Based on the current object received and the object type required by a method parameter.
    • Annotations for injecting meta data
      • Message headers*
      • Attachments*
    • * not shown today
  • transforms public class SimpleTransformers { @Transformer URL toUrl(String string ) throws MalformedURLException { return new URL(string); } }
  • bindings
    • Marshal and Unmarshal Objects
      • XML (JAXB)
        • XML document to an Order object
      • JSON (Jackson)
        • JSON String to a TwitterUser object
    • Supports automatic handling
  • bindings: jaxb public class JaxbTransformers { @Transformer Order toOrder(Document doc, JAXBContext jaxb ) throws … { Unmarshaller u = jaxb.createUnmarshaller(); return (Order) u.unmarshal(selectOne(“ /env/order ”, doc); } }
  • bindings: jaxb public class MyObject { @Receive( uri=“ jms://my.queue ” ) void onMessage( @MessagePayload Order order ) { log(order); } } Tells iBeans to transform the JMS Payload to an Order object
  • … but wait
    • How do we go from a Jms Message to an Xml Document?
    • Jms Message is normalized
      • TextMessage – String
      • BytesMessage – byte[ ]
      • ObjectMessage – Deserialized Object
      • etc
  • … and we need to add… public class JaxbTransformers { @Transformer( sourceTypes={String. class } ) Order toOrder(Document doc, JAXBContext jaxb) throws … { Unmarshaller u = jaxb.createUnmarshaller(); return (Order) u.unmarshal(selectOne(“/env/order”, doc); } }
  • transform flow
  • ibeans can use transformers
    • public interface MyTwitterIBean
    • {
    • @State
    • void init( @UriParam( “ format ” ) String format,
    • @ReturnType Class retType );
    • @Call( uri=&quot; http://twitter.com/statuses/show/{id}.{format} &quot; )
    • <T> T statusesShow( @UriParam( &quot; id &quot; ) String id) throws … ;
    • }
  • coding with ibeans
    • Eclipse IDE plugin
    • Maven Archetypes, Run targets
    • Template projects
    • No Support for IntelliJ yet…
  • Framework Support
  • guice
    • public class MyModule extends AbstractGuiceIBeansModule
    • {
    • protected void doConfigure() throws Exception
    • {
    • bind(EchoService. class ).asEagerSingleton();
    • }
    • }
  • spring
    • <beans …>
    • <bean name =&quot; ibeansContext ”
    • class =&quot; org.mule.ibeans.spring.
    • IBeansContextFactoryBean &quot;/>
    • </beans>
  • coming soon
    • GWT / GXT
    • Grails
    • Play Framework
    • JSF
    • Struts 2 (may already work)
  • other things
    • Support for JavaScript and AJAX
    • iBeans has a Groovy shell
      • Execute scripts interactively or command-line
    • iBeans Console
      • Configure your iBeans instance
      • Browser and Download from iBeans Central
  • possibilities
    • Great for embedding
      • Cloud containers
      • Wikis: Confluence, Xwiki
    • DSLs
    • Mobile apps
    • Widgets
  • Whats next for ibeans
    • Web Services support (JAX-RS/WS)
    • Support for scripting in the console
    • Centralized configuration
    • Mule 3.0 will be able to host iBeans
    • Combine with Tcat for cloud development
  • … and after that
    • Support for other languages: Scala, Ruby, Clojure, etc
    • Become the WCF for the JVM?
  • thanks
    • web: http://mulesoft.org/ibeans
    • blog: http://blog.rossmason.com
    • twitter: @rossmason