SlideShare uma empresa Scribd logo
1 de 145
Akka:
                            Simpler Concurrency, Scalability &
                               Fault-tolerance through Actors

                                                 Jonas Bonér
                                           Scalable Solutions
                                            jonas@jonasboner.com
                                                  twitter: @jboner



Thursday, October 7, 2010
The problem

                            It is way too hard to build:
                            1. correct highly concurrent systems
                            2. truly scalable systems
                            3. fault-tolerant systems that self-heals
                            ...using “state-of-the-art” tools


Thursday, October 7, 2010
Vision
                            Simpler
                                 Concurrency
                                 Scalability
                                 Fault-tolerance
                            Through one single unified
                                 Programming model
                                 Runtime service
Thursday, October 7, 2010
Manage system overload




Thursday, October 7, 2010
Scale up & Scale out




Thursday, October 7, 2010
Replicate and distribute
                      for fault-tolerance




Thursday, October 7, 2010
Automatic & adaptive
                               load balancing
Thursday, October 7, 2010
Introducing




             Concurrency              Scalability Fault-tolerance

              Actors            STM          Agents        Dataflow

       Distributed          Secure   Persistent   Open Source   Clustered

Thursday, October 7, 2010
Architecture


                                      Core
                                      Modules




Thursday, October 7, 2010
Architecture

                                     Add-on
                                     Modules




                                     Add-on
                                     Modules
Thursday, October 7, 2010
Architecture



                                     Enterprise
                                     Modules




Thursday, October 7, 2010
Actors
        one tool in the toolbox


Thursday, October 7, 2010
Akka Actors


Thursday, October 7, 2010
Actor Model of
                             Concurrency
          • Implements Message-Passing Concurrency
          • Share NOTHING
          • Isolated lightweight processes
          • Communicates through messages
          • Asynchronous and non-blocking
          • Each actor has a mailbox (message queue)

Thursday, October 7, 2010
Actor Model of
                             Concurrency
                            • Easier to reason about
                            • Raised abstraction level
                            • Easier to avoid
                              –Race conditions
                              –Deadlocks
                              –Starvation
                              –Live locks
Thursday, October 7, 2010
Two different models
             • Thread-based
             • Event-based
               – Very lightweight (600 bytes per actor)
               – Can easily create millions on a single
                workstation (13 million on 8 G RAM)
               – Does not consume a thread



Thursday, October 7, 2010
Actors
                            case  object  Tick

                            class  Counter  extends  Actor  {
                                private  var  counter  =  0

                                def  receive  =  {
                                    case  Tick  =>  
                                        counter  +=  1
                                        println(counter)
                                }
                            }

Thursday, October 7, 2010
Create Actors
                   import  Actor._

                   val  counter  =  actorOf[Counter]



                            counter is an ActorRef
Thursday, October 7, 2010
Create Actors

     val  actor  =  actorOf(new  MyActor(..))




                     create actor with constructor arguments

Thursday, October 7, 2010
Start actors

                  val  counter  =  actorOf[Counter]
                  counter.start




Thursday, October 7, 2010
Start actors

    val  counter  =  actorOf[Counter].start




Thursday, October 7, 2010
Stop actors

    val  counter  =  actorOf[Counter].start
    counter.stop




Thursday, October 7, 2010
init & shutdown callbacks
                            class  MyActor  extends  Actor  {

                                override  def  preStart  =  {
                                    ...  //  called  after  ‘start’  
                                }

                                override  def  postStop  =  {
                                    ...  //  called  before  ‘stop’
                                }
                            }



Thursday, October 7, 2010
the self reference
                       class  RecursiveActor  extends  Actor  {
                           private  var  counter  =  0
                           self.id  =  “service:recursive”

                           def  receive  =  {
                               case  Tick  =>  
                                   counter  +=  1
                                   self  !  Tick
                           }
                       }


Thursday, October 7, 2010
Actors
                                 anonymous
                            val  worker  =  actor  {
                                case  Work(fn)  =>  fn()
                            }




Thursday, October 7, 2010
Send: !

                            counter  !  Tick  



                                fire-forget


Thursday, October 7, 2010
Send: !

                            counter.sendOneWay(Tick)



                                    fire-forget


Thursday, October 7, 2010
Send: !!

            val  result  =  (actor  !!  Message).as[String]




               uses Future under the hood (with time-out)


Thursday, October 7, 2010
Send: !!

         val  result  =  counter.sendRequestReply(Tick)




               uses Future under the hood (with time-out)


Thursday, October 7, 2010
Send: !!!
                 //  returns  a  future
                 val  future  =  actor  !!!  Message
                 future.await
                 val  result  =  future.get

                 ...
                 Futures.awaitOne(List(fut1,  fut2,  ...))
                 Futures.awaitAll(List(fut1,  fut2,  ...))


                            returns the Future directly
Thursday, October 7, 2010
Send: !!!

     val  result  =  counter.sendRequestReplyFuture(Tick)




                            returns the Future directly


Thursday, October 7, 2010
Reply
                            class  SomeActor  extends  Actor  {
                                def  receive  =  {
                                    case  User(name)  =>  
                                        //  use  reply
                                        self.reply(“Hi  ”  +  name)
                                }
                            }




Thursday, October 7, 2010
Reply
                            class  SomeActor  extends  Actor  {
                                def  receive  =  {
                                    case  User(name)  =>  
                                        //  store  away  the  sender
                                        //  to  use  later  or  
                                        //  somewhere  else
                                        ...  =  self.sender
                                }
                            }


Thursday, October 7, 2010
Reply
                     class  SomeActor  extends  Actor  {
                         def  receive  =  {
                             case  User(name)  =>  
                                 //  store  away  the  sender  future
                                 //  to  resolve  later  or  
                                 //  somewhere  else
                                 ...  =  self.senderFuture
                         }
                     }


Thursday, October 7, 2010
Immutable messages
                 //  define  the  case  class
                 case  class  Register(user:  User)

                 //  create  and  send  a  new  case  class  message
                 actor  !  Register(user)

                 //  tuples
                 actor  !  (username,  password)

                 //  lists
                 actor  !  List(“bill”,  “bob”,  “alice”)


Thursday, October 7, 2010
ActorRegistry
             val  actors  =  ActorRegistry.actors
             val  actors  =  ActorRegistry.actorsFor[TYPE]
             val  actors  =  ActorRegistry.actorsFor(id)
             val  actor  =  ActorRegistry.actorFor(uuid)
             ActorRegistry.foreach(fn)
             ActorRegistry.shutdownAll




Thursday, October 7, 2010
TypedActor


Thursday, October 7, 2010
Typed Actors
                            class  CounterImpl  
                                extends  TypedActor  with  Counter  {

                                private  var  counter  =  0;

                                def  count  =  {
                                    counter  +=  1
                                    println(counter)
                                }
                            }


Thursday, October 7, 2010
Create Typed Actor

           val  counter  =  TypedActor.newInstance(
                   classOf[Counter],  classof[CounterImpl])




Thursday, October 7, 2010
Send message

                              counter.count




                                 fire-forget

Thursday, October 7, 2010
Request Reply

                            val  hits  =  counter.getNrOfHits




             uses Future under the hood (with time-out)

Thursday, October 7, 2010
the context reference
                  class  PingImpl  extends  TypedActor  
                      with  Ping  {
                      def  hit(count:  Int)  =  {
                          val  pong  =  getContext
                             .getSender.asInstanceOf[Pong]
                          pong.hit(count  +=  1)
                      }
                  }



Thursday, October 7, 2010
Actors: config
                             akka  {
                                 version  =  "0.10"
                                 time-­‐unit  =  "seconds"
                                 actor  {
                                     timeout  =  5
                                     throughput  =  5
                                 }
                             }


Thursday, October 7, 2010
Scalability
       Benchmark
       Simple Trading system

       • Synchronous Scala version
       • Scala Library Actors 2.8.0
         •Fire-forget
         •Request-reply (Futures)
       • Akka
         • Fire-forget (Hawt dispatcher)
         • Fire-forget (default dispatcher)
         • Request-reply
       Run it yourself:
        http://github.com/patriknw/akka-sample-trading


Thursday, October 7, 2010
Agents
        yet another tool in the toolbox



Thursday, October 7, 2010
Agents
                            val  agent  =  Agent(5)

                            //  send  function  asynchronously
                            agent  send  (_  +  1)  

                            val  result  =  agent()  //  deref
                            ...  //  use  result

                            agent.close

                                  Cooperates with STM
Thursday, October 7, 2010
Akka Dispatchers


Thursday, October 7, 2010
Dispatchers
 •              Executor-based Dispatcher
 • Executor-based Work-stealing Dispatcher
 •                       Hawt Dispatcher
 •                Thread-based Dispatcher



Thursday, October 7, 2010
Dispatchers
   object  Dispatchers  {
       object  globalHawtDispatcher  extends  HawtDispatcher
       ...
     
       def  newExecutorBasedEventDrivenDispatcher(name:  String)

       def  newExecutorBasedEventDrivenWorkStealingDispatcher(name:  String)

       def  newHawtDispatcher(aggregate:  Boolean)

       ...
   }




Thursday, October 7, 2010
Set dispatcher
           class  MyActor  extends  Actor  {
               self.dispatcher  =  Dispatchers
                   .newThreadBasedDispatcher(self)
               
               ...
           }

           actor.dispatcher  =  dispatcher  //  before  started




Thursday, October 7, 2010
Let it crash
                            fault-tolerance


Thursday, October 7, 2010
Influenced by

                            Erlang
Thursday, October 7, 2010
9   nines
Thursday, October 7, 2010
OneForOne
                            fault handling strategy




Thursday, October 7, 2010
OneForOne
                            fault handling strategy




Thursday, October 7, 2010
OneForOne
                            fault handling strategy




Thursday, October 7, 2010
OneForOne
                            fault handling strategy




Thursday, October 7, 2010
OneForOne
                            fault handling strategy




Thursday, October 7, 2010
OneForOne
                            fault handling strategy




Thursday, October 7, 2010
OneForOne
                            fault handling strategy




Thursday, October 7, 2010
OneForOne
                            fault handling strategy




Thursday, October 7, 2010
AllForOne
                            fault handling strategy




Thursday, October 7, 2010
AllForOne
                            fault handling strategy




Thursday, October 7, 2010
AllForOne
                            fault handling strategy




Thursday, October 7, 2010
AllForOne
                            fault handling strategy




Thursday, October 7, 2010
AllForOne
                            fault handling strategy




Thursday, October 7, 2010
Supervisor hierarchies




Thursday, October 7, 2010
Supervisor hierarchies




Thursday, October 7, 2010
Supervisor hierarchies




Thursday, October 7, 2010
Supervisor hierarchies




Thursday, October 7, 2010
Supervisor hierarchies




Thursday, October 7, 2010
Supervisor hierarchies




Thursday, October 7, 2010
Fault handlers
                             AllForOneStrategy(
                                 maxNrOfRetries,  
                                 withinTimeRange)

                             OneForOneStrategy(
                                 maxNrOfRetries,  
                                 withinTimeRange)


Thursday, October 7, 2010
Linking
                            link(actor)  
                            unlink(actor)  

                            startLink(actor)
                            spawnLink[MyActor]



Thursday, October 7, 2010
trapExit
            trapExit  =  List(
              classOf[ServiceException],  
              classOf[PersistenceException])




Thursday, October 7, 2010
Supervision
                    class  Supervisor  extends  Actor  {
                        trapExit  =  List(classOf[Throwable])
                        faultHandler  =  
                            Some(OneForOneStrategy(5,  5000))

                        def  receive  =  {
                            case  Register(actor)  =>  
                                link(actor)
                        }
                    }

Thursday, October 7, 2010
Manage failure
         class  FaultTolerantService  extends  Actor  {
             ...
             override  def  preRestart(reason:  Throwable)  =  {
                 ...  //  clean  up  before  restart
             }
             override  def  postRestart(reason:  Throwable)  =  {
                 ...  //  init  after  restart
             }
         }




Thursday, October 7, 2010
Remote Actors


Thursday, October 7, 2010
Remote Server
                            //  use  host  &  port  in  config
                            RemoteNode.start

                            RemoteNode.start("localhost",  9999)




                             Scalable implementation based on
                                  NIO (Netty) & Protobuf

Thursday, October 7, 2010
Two types of
                        remote actors
                             Client managed
                             Server managed

Thursday, October 7, 2010
Client-managed
               supervision works across nodes

           //  methods  in  Actor  class

           spawnRemote[MyActor](host,  port)  

           spawnLinkRemote[MyActor](host,  port)

           startLinkRemote(actor,  host,  port)

Thursday, October 7, 2010
Client-managed
                            moves actor to server
                        client manages through proxy

                val  actorProxy  =  spawnLinkRemote[MyActor](
                    “darkstar”,  
                    9999)

                actorProxy  !  message




Thursday, October 7, 2010
Server-managed
         register and manage actor on server
           client gets “dumb” proxy handle

      RemoteNode.register(“service:id”,  actorOf[MyService])




                            server part

Thursday, October 7, 2010
Server-managed
                            val  handle  =  RemoteClient.actorFor(
                                “service:id”,  
                                “darkstar”,  
                                9999)

                            handle  !  message



                                       client part
Thursday, October 7, 2010
Cluster Membership
                        Cluster.relayMessage(
                            classOf[TypeOfActor],  message)

                        for  (endpoint  <-­‐  Cluster)  
                            spawnRemote[TypeOfActor](    
                                                    endpoint.host,  
                                                    endpoint.port)


Thursday, October 7, 2010
STM
        yet another tool in the toolbox



Thursday, October 7, 2010
What is STM?

                            71
Thursday, October 7, 2010
STM: overview
                 • See the memory (heap and stack) as a
                  transactional dataset
                 • Similar to a database
                  • begin
                  • commit
                  • abort/rollback
                 • Transactions are retried automatically
                  upon collision
                 • Rolls back the memory on abort
Thursday, October 7, 2010
Managed References
                       • Separates Identity from Value
                          - Values are immutable
                          - Identity (Ref) holds Values
                       • Change is a function
                       • Compare-and-swap (CAS)
                       • Abstraction of time
                       • Must be used within a transaction

Thursday, October 7, 2010
atomic
           import  se.scalablesolutions.akka.stm.local._
             
           atomic  {
               ...

               atomic  {
                   ...  //  transactions  compose!!!
               }
           }




Thursday, October 7, 2010
Managed References
     Typical OO - Direct
    Typical OO: direct Mutable Objects objects
        references to access to mutable
                                                       foo

                                                  :a           ?
                                                  :b           ?
                                                  :c          42
                                                  :d           ?
                                                  :e           6



        Clojure - and value
        • Unifies identity Indirect references
    Managed Reference: separates Identity & Value
        • Anything can change at any time
        • Consistency is a user problem Objects
             to Immutable
                        •   Encapsulation doesn’t solve concurrency:a
                                          foo                                "fred"
                            problems                               :b       "ethel"
                                                       @foo            :c      42
                                                                       :d      17
                                                                       :e       6



                                          Copyright Rich Hickey 2009
Thursday, October 7, 2010
                             •   Separates identity and value
Managed References
                       • Separates Identity from Value
                          - Values are immutable
                          - Identity (Ref) holds Values
                       • Change is a function
                       • Compare-and-swap (CAS)
                       • Abstraction of time
                       • Must be used within a transaction

Thursday, October 7, 2010
Managed References
          import  se.scalablesolutions.akka.stm.local._
            
          //  giving  an  initial  value
          val  ref  =  Ref(0)
            
          //  specifying  a  type  but  no  initial  value
          val  ref  =  Ref[Int]




Thursday, October 7, 2010
Managed References
                            val  ref  =  Ref(0)
                              
                            atomic  {
                                ref.set(5)
                            }
                            //  -­‐>  0
                              
                            atomic  {
                                ref.get
                            }
                            //  -­‐>  5

Thursday, October 7, 2010
Managed References
                            val  ref  =  Ref(0)
                              
                            atomic  {
                                ref  alter  (_  +  5)
                            }
                            //  -­‐>  5
                              
                            val  inc  =  (i:  Int)  =>  i  +  1
                              
                            atomic  {
                                ref  alter  inc
                            }
                            //  -­‐>  6
Thursday, October 7, 2010
Managed References
                            val  ref  =  Ref(1)  
                            val  anotherRef  =  Ref(3)
                              
                            atomic  {
                                for  {
                                    value1  <-­‐  ref
                                    value2  <-­‐  anotherRef
                                }  yield  (value1  +  value2)
                            }
                            //  -­‐>  Ref(4)
                              
                            val  emptyRef  =  Ref[Int]
                              
                            atomic  {
                                for  {
                                    value1  <-­‐  ref
                                    value2  <-­‐  emptyRef
                                }  yield  (value1  +  value2)
                            }
                            //  -­‐>  Ref[Int]

Thursday, October 7, 2010
Transactional
                                   datastructures
                            //  using  initial  values
                            val  map        =  TransactionalMap("bill"  -­‐>  User("bill"))
                            val  vector  =  TransactionalVector(Address("somewhere"))
                              
                            //  specifying  types
                            val  map        =  TransactionalMap[String,  User]
                            val  vector  =  TransactionalVector[Address]




Thursday, October 7, 2010
life-cycle listeners
                   atomic  {
                       deferred  {
                           //  executes  when  transaction  commits
                       }
                       compensating  {
                           //  executes  when  transaction  aborts
                       }
                   }




Thursday, October 7, 2010
Actors + STM =
                              Transactors


Thursday, October 7, 2010
Transactors
                        class  UserRegistry  extends  Transactor  {
                            
                            private  lazy  val  storage  =  
                                TransactionalMap[String,  User]()

                            def  receive  =  {
                                case  NewUser(user)  =>
                                    storage  +  (user.name  -­‐>  user)
                                ...  
                            }
                        }



Thursday, October 7, 2010
Transactors




Thursday, October 7, 2010
Transactors
                            Start transaction




Thursday, October 7, 2010
Transactors
                            Start transaction


                                                Send message




Thursday, October 7, 2010
Transactors
                            Start transaction


                                                Send message




Thursday, October 7, 2010
Transactors
                            Start transaction


                                                Send message




                                    Update state
                                  within transaction




Thursday, October 7, 2010
Transactors
                            Start transaction


                                                Send message




                                    Update state
                                  within transaction




Thursday, October 7, 2010
Transactors
                            Start transaction


                                                Send message




                                    Update state
                                  within transaction




Thursday, October 7, 2010
Transactors
                            Start transaction


                                                Send message




                                    Update state
                                  within transaction




Thursday, October 7, 2010
Transactors
                            Start transaction


                                                Send message




                                    Update state
                                  within transaction




Thursday, October 7, 2010
Transactors
                            Start transaction


                                                Send message




                                    Update state
                                  within transaction




Thursday, October 7, 2010
Transactors
                            Start transaction


                                                Send message




                                    Update state
                                  within transaction




                                                               Transaction
                                                                  fails




Thursday, October 7, 2010
Transactors
                            Start transaction


                                                Send message




                                    Update state
                                  within transaction




                                                               Transaction
                                                                  fails




Thursday, October 7, 2010
Transactors




Thursday, October 7, 2010
Transactors




Thursday, October 7, 2010
Transactors




Thursday, October 7, 2010
Transactors




Thursday, October 7, 2010
Transactors




Thursday, October 7, 2010
Transactors




Thursday, October 7, 2010
Transactors
                              Transaction
                             automatically
                                retried




Thursday, October 7, 2010
blocking transactions
      class  Transferer  extends  Actor  {
          implicit  val  txFactory  =  TransactionFactory(
              blockingAllowed  =  true,  trackReads  =  true,  timeout  =  60  seconds)
        
          def  receive  =  {
              case  Transfer(from,  to,  amount)  =>
                  atomic  {
                      if  (from.get  <  amount)  {
                          log.info("not  enough  money  -­‐  retrying")
                          retry
                      }
                      log.info("transferring")
                      from  alter  (_  -­‐  amount)
                      to  alter  (_  +  amount)
                  }
          }
      }




Thursday, October 7, 2010
either-orElse
                                atomic  {
                                    either  {
                                        if  (left.get  <  amount)  {
                                            log.info("not  enough  on  left  -­‐  retrying")
                                            retry
                                        }
                                        log.info("going  left")
                                    }  orElse  {
                                        if  (right.get  <  amount)  {
                                            log.info("not  enough  on  right  -­‐  retrying")
                                            retry
                                        }
                                        log.info("going  right")
                                    }
                                }




Thursday, October 7, 2010
STM: config
                                akka  {
                                    stm  {
                                        max-­‐retries  =  1000
                                        timeout  =  10
                                        write-­‐skew  =  true
                                        blocking-­‐allowed  =  false
                                        interruptible  =  false
                                        speculative  =  true
                                        quick-­‐release  =  true
                                        propagation  =  requires
                                        trace-­‐level  =  none
                                        hooks  =  true
                                        jta-­‐aware  =  off
                                    }
                                }
Thursday, October 7, 2010
Modules


Thursday, October 7, 2010
Akka Persistence


Thursday, October 7, 2010
STM gives us
               Atomic
               Consistent
               Isolated
Thursday, October 7, 2010
Persistence module turns
          STM into
               Atomic
               Consistent
               Isolated
               Durable
Thursday, October 7, 2010
Akka Persistence API
                            //  transactional  Cassandra-­‐backed  Map  
                            val  map  =  CassandraStorage.newMap

                            //  transactional  Redis-­‐backed  Vector  
                            val  vector  =  RedisStorage.newVector

                            //  transactional  Mongo-­‐backed  Ref
                            val  ref  =  MongoStorage.newRef




Thursday, October 7, 2010
For Redis only (so far)

             val  queue:  PersistentQueue[ElementType]  =      
                 RedisStorage.newQueue

             val  set:  PersistentSortedSet[ElementType]  =
                 RedisStorage.newSortedSet




Thursday, October 7, 2010
Akka Spring


Thursday, October 7, 2010
Spring integration
                            <beans>
                                <akka:typed-­‐actor  
                                    id="myActiveObject"  
                                    interface="com.biz.MyPOJO"  
                                    implementation="com.biz.MyPOJO"  
                                    transactional="true"  
                                    timeout="1000"  />
                                ...
                            </beans>



Thursday, October 7, 2010
Spring integration
                    <akka:supervision  id="my-­‐supervisor">

                        <akka:restart-­‐strategy  failover="AllForOne"  
                                                                      retries="3"  
                                                                      timerange="1000">
                            <akka:trap-­‐exits>
                                <akka:trap-­‐exit>java.io.IOException</akka:trap-­‐exit>
                            </akka:trap-­‐exits>
                        </akka:restart-­‐strategy>

                        <akka:typed-­‐actors>
                            <akka:typed-­‐actor  interface="com.biz.MyPOJO"  
                                                                implementation="com.biz.MyPOJOImpl"  
                                                                lifecycle="permanent"  
                                                                timeout="1000">
                            </akka:typed-­‐actor>
                        </akka:typed-­‐actors>
                    </akka:supervision>


Thursday, October 7, 2010
Akka Camel


Thursday, October 7, 2010
Camel: consumer
          class  MyConsumer  extends  Actor  with  Consumer  {
              def  endpointUri  =  "file:data/input"
            
              def  receive  =  {
                  case  msg:  Message  =>  
                      log.info("received  %s"  format
                      msg.bodyAs(classOf[String]))
              }
          }



Thursday, October 7, 2010
Camel: consumer
          class  MyConsumer  extends  Actor  with  Consumer  {
              def  endpointUri  =  
                  "jetty:http://0.0.0.0:8877/camel/test"
            
              def  receive  =  {
                  case  msg:  Message  =>  
                      reply("Hello  %s"  format  
                                  msg.bodyAs(classOf[String]))
              }
          }


Thursday, October 7, 2010
Camel: producer
                class  CometProducer  
                    extends  Actor  with  Producer  {
                    
                    def  endpointUri  =  
                        "cometd://localhost:8111/test"
                  
                    def  receive  =  produce  //  use  default  impl
                }



Thursday, October 7, 2010
Camel: producer

              val  producer  =  actorOf[CometProducer].start

              val  time  =  "Current  time:  "  +  new  Date
              producer  !  time




Thursday, October 7, 2010
Akka HotSwap


Thursday, October 7, 2010
HotSwap
                            actor  !  HotSwap({
                                //  new  body
                                case  Ping  =>  
                                    ...  
                                case  Pong  =>  
                                    ...    
                            })


Thursday, October 7, 2010
HotSwap
                            self.become({
                                //  new  body
                                case  Ping  =>  
                                    ...  
                                case  Pong  =>  
                                    ...    
                            })

Thursday, October 7, 2010
How to run it?
                    Deploy as dependency JAR in
                  WEB-INF/lib etc.
                    Run as stand-alone microkernel
                    OSGi-enabled; drop in any
                  OSGi container (Spring DM
                  server, Karaf etc.)

Thursday, October 7, 2010
Akka Kernel


Thursday, October 7, 2010
Start Kernel

                            java  -­‐jar  akka-­‐1.0-­‐SNAPSHOT.jar  
                                -­‐Dakka.config=<path>/akka.conf




Thursday, October 7, 2010
...and much much more
           PubSub
     REST
                 Security
           FSM
     Comet         Web
         OSGi   Guice
Thursday, October 7, 2010
Learn more
                            http://akkasource.org



Thursday, October 7, 2010
EOF
Thursday, October 7, 2010

Mais conteúdo relacionado

Destaque

第一课词语
第一课词语第一课词语
第一课词语javertian
 
The modern manises grupo 3
The modern manises grupo 3The modern manises grupo 3
The modern manises grupo 3M.Amparo
 
Mariage Angeli Senza Paradiso
Mariage Angeli Senza ParadisoMariage Angeli Senza Paradiso
Mariage Angeli Senza Paradisoarji vesela
 
UBC Sauder Social Entrepreneurship 101 Degree In A Day Presentation
UBC Sauder Social Entrepreneurship 101 Degree In A Day PresentationUBC Sauder Social Entrepreneurship 101 Degree In A Day Presentation
UBC Sauder Social Entrepreneurship 101 Degree In A Day PresentationLes Robertson
 
Journey To Systemic Improvement Lean Exchange Dec 2009 David J
Journey To Systemic Improvement Lean Exchange Dec 2009  David  JJourney To Systemic Improvement Lean Exchange Dec 2009  David  J
Journey To Systemic Improvement Lean Exchange Dec 2009 David JSkills Matter
 
Michael Adobe Flex Java 1 London
Michael Adobe Flex Java 1 LondonMichael Adobe Flex Java 1 London
Michael Adobe Flex Java 1 LondonSkills Matter
 
London F-Sharp User Group : Don Syme on F# - 09/09/2010
London F-Sharp User Group : Don Syme on F# - 09/09/2010London F-Sharp User Group : Don Syme on F# - 09/09/2010
London F-Sharp User Group : Don Syme on F# - 09/09/2010Skills Matter
 
Bolivar Santana
Bolivar SantanaBolivar Santana
Bolivar Santanadivaferlin
 
Managed Communication & Collaboration von All for One Steeb
Managed Communication & Collaboration von All for One SteebManaged Communication & Collaboration von All for One Steeb
Managed Communication & Collaboration von All for One SteebAll for One Steeb AG
 
Dr. Lisa Chu on How Teaching Violin to Toddlers Taught Her More than Harvard ...
Dr. Lisa Chu on How Teaching Violin to Toddlers Taught Her More than Harvard ...Dr. Lisa Chu on How Teaching Violin to Toddlers Taught Her More than Harvard ...
Dr. Lisa Chu on How Teaching Violin to Toddlers Taught Her More than Harvard ...Ignite Bay Area
 
Correios em portugal situações problemáticas
Correios em portugal   situações problemáticasCorreios em portugal   situações problemáticas
Correios em portugal situações problemáticasnostromo1
 
The housework
The houseworkThe housework
The houseworkM.Amparo
 
Big. Small. Open. Making open innovation between big and small companies work...
Big. Small. Open. Making open innovation between big and small companies work...Big. Small. Open. Making open innovation between big and small companies work...
Big. Small. Open. Making open innovation between big and small companies work...Stefan Lindegaard
 

Destaque (20)

第一课词语
第一课词语第一课词语
第一课词语
 
The modern manises grupo 3
The modern manises grupo 3The modern manises grupo 3
The modern manises grupo 3
 
Mariage Angeli Senza Paradiso
Mariage Angeli Senza ParadisoMariage Angeli Senza Paradiso
Mariage Angeli Senza Paradiso
 
Mes Creations
Mes CreationsMes Creations
Mes Creations
 
Richard sbt
Richard sbtRichard sbt
Richard sbt
 
UBC Sauder Social Entrepreneurship 101 Degree In A Day Presentation
UBC Sauder Social Entrepreneurship 101 Degree In A Day PresentationUBC Sauder Social Entrepreneurship 101 Degree In A Day Presentation
UBC Sauder Social Entrepreneurship 101 Degree In A Day Presentation
 
Journey To Systemic Improvement Lean Exchange Dec 2009 David J
Journey To Systemic Improvement Lean Exchange Dec 2009  David  JJourney To Systemic Improvement Lean Exchange Dec 2009  David  J
Journey To Systemic Improvement Lean Exchange Dec 2009 David J
 
Michael Adobe Flex Java 1 London
Michael Adobe Flex Java 1 LondonMichael Adobe Flex Java 1 London
Michael Adobe Flex Java 1 London
 
London F-Sharp User Group : Don Syme on F# - 09/09/2010
London F-Sharp User Group : Don Syme on F# - 09/09/2010London F-Sharp User Group : Don Syme on F# - 09/09/2010
London F-Sharp User Group : Don Syme on F# - 09/09/2010
 
Bolivar Santana
Bolivar SantanaBolivar Santana
Bolivar Santana
 
Switch tokanban2
Switch tokanban2Switch tokanban2
Switch tokanban2
 
Managed Communication & Collaboration von All for One Steeb
Managed Communication & Collaboration von All for One SteebManaged Communication & Collaboration von All for One Steeb
Managed Communication & Collaboration von All for One Steeb
 
Dr. Lisa Chu on How Teaching Violin to Toddlers Taught Her More than Harvard ...
Dr. Lisa Chu on How Teaching Violin to Toddlers Taught Her More than Harvard ...Dr. Lisa Chu on How Teaching Violin to Toddlers Taught Her More than Harvard ...
Dr. Lisa Chu on How Teaching Violin to Toddlers Taught Her More than Harvard ...
 
Correios em portugal situações problemáticas
Correios em portugal   situações problemáticasCorreios em portugal   situações problemáticas
Correios em portugal situações problemáticas
 
Nl Media
Nl MediaNl Media
Nl Media
 
The housework
The houseworkThe housework
The housework
 
World Report On Violence &amp; Health
World Report On Violence &amp; HealthWorld Report On Violence &amp; Health
World Report On Violence &amp; Health
 
Big. Small. Open. Making open innovation between big and small companies work...
Big. Small. Open. Making open innovation between big and small companies work...Big. Small. Open. Making open innovation between big and small companies work...
Big. Small. Open. Making open innovation between big and small companies work...
 
Gridgain scalar
Gridgain scalarGridgain scalar
Gridgain scalar
 
Flamenco 1
Flamenco 1Flamenco 1
Flamenco 1
 

Semelhante a Akka scalaliftoff london_2010

Live featureanalysis
Live featureanalysisLive featureanalysis
Live featureanalysisJorge Ressia
 
Riak Core: Building Distributed Applications Without Shared State
Riak Core: Building Distributed Applications Without Shared StateRiak Core: Building Distributed Applications Without Shared State
Riak Core: Building Distributed Applications Without Shared StateRusty Klophaus
 
Idiots guide to jquery
Idiots guide to jqueryIdiots guide to jquery
Idiots guide to jqueryMark Casias
 
Pony Pwning Djangocon 2010
Pony Pwning Djangocon 2010Pony Pwning Djangocon 2010
Pony Pwning Djangocon 2010Adam Baldwin
 
Aegir one drupal to rule them all
Aegir one drupal to rule them allAegir one drupal to rule them all
Aegir one drupal to rule them allDevelopment Seed
 
node.js for front-end developers
node.js for front-end developersnode.js for front-end developers
node.js for front-end developersGarann Means
 
State of Cassandra, August 2010
State of Cassandra, August 2010State of Cassandra, August 2010
State of Cassandra, August 2010jbellis
 
GoLightly: Building VM-based language runtimes in Go
GoLightly: Building VM-based language runtimes in GoGoLightly: Building VM-based language runtimes in Go
GoLightly: Building VM-based language runtimes in GoEleanor McHugh
 
Agile Enterprise Devops and Cloud - Interop 2010 NYC
Agile Enterprise Devops and Cloud - Interop 2010 NYCAgile Enterprise Devops and Cloud - Interop 2010 NYC
Agile Enterprise Devops and Cloud - Interop 2010 NYCChef Software, Inc.
 
Mirah & Dubious Talk Ruby|Web 2010
Mirah & Dubious Talk Ruby|Web 2010Mirah & Dubious Talk Ruby|Web 2010
Mirah & Dubious Talk Ruby|Web 2010baroquebobcat
 
Large problems, Mostly Solved
Large problems, Mostly SolvedLarge problems, Mostly Solved
Large problems, Mostly Solvedericholscher
 
Ignite: Devops - Why Should You Care
Ignite: Devops - Why Should You CareIgnite: Devops - Why Should You Care
Ignite: Devops - Why Should You CareJoshua L. Davis
 

Semelhante a Akka scalaliftoff london_2010 (20)

Noboxing plugin
Noboxing pluginNoboxing plugin
Noboxing plugin
 
Reef - ESUG 2010
Reef - ESUG 2010Reef - ESUG 2010
Reef - ESUG 2010
 
Live featureanalysis
Live featureanalysisLive featureanalysis
Live featureanalysis
 
XQuery Design Patterns
XQuery Design PatternsXQuery Design Patterns
XQuery Design Patterns
 
Riak Core: Building Distributed Applications Without Shared State
Riak Core: Building Distributed Applications Without Shared StateRiak Core: Building Distributed Applications Without Shared State
Riak Core: Building Distributed Applications Without Shared State
 
Idiots guide to jquery
Idiots guide to jqueryIdiots guide to jquery
Idiots guide to jquery
 
Vagrant at LA Ruby
Vagrant at LA RubyVagrant at LA Ruby
Vagrant at LA Ruby
 
Railsconf 2010
Railsconf 2010Railsconf 2010
Railsconf 2010
 
Pony Pwning Djangocon 2010
Pony Pwning Djangocon 2010Pony Pwning Djangocon 2010
Pony Pwning Djangocon 2010
 
Aegir one drupal to rule them all
Aegir one drupal to rule them allAegir one drupal to rule them all
Aegir one drupal to rule them all
 
node.js for front-end developers
node.js for front-end developersnode.js for front-end developers
node.js for front-end developers
 
Runtime evolution
Runtime evolutionRuntime evolution
Runtime evolution
 
State of Cassandra, August 2010
State of Cassandra, August 2010State of Cassandra, August 2010
State of Cassandra, August 2010
 
GoLightly: Building VM-based language runtimes in Go
GoLightly: Building VM-based language runtimes in GoGoLightly: Building VM-based language runtimes in Go
GoLightly: Building VM-based language runtimes in Go
 
Agile Enterprise Devops and Cloud - Interop 2010 NYC
Agile Enterprise Devops and Cloud - Interop 2010 NYCAgile Enterprise Devops and Cloud - Interop 2010 NYC
Agile Enterprise Devops and Cloud - Interop 2010 NYC
 
Mirah & Dubious Talk Ruby|Web 2010
Mirah & Dubious Talk Ruby|Web 2010Mirah & Dubious Talk Ruby|Web 2010
Mirah & Dubious Talk Ruby|Web 2010
 
Large problems, Mostly Solved
Large problems, Mostly SolvedLarge problems, Mostly Solved
Large problems, Mostly Solved
 
Tdd patterns1
Tdd patterns1Tdd patterns1
Tdd patterns1
 
Is these a bug
Is these a bugIs these a bug
Is these a bug
 
Ignite: Devops - Why Should You Care
Ignite: Devops - Why Should You CareIgnite: Devops - Why Should You Care
Ignite: Devops - Why Should You Care
 

Mais de Skills Matter

5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard Lawrence5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard LawrenceSkills Matter
 
Patterns for slick database applications
Patterns for slick database applicationsPatterns for slick database applications
Patterns for slick database applicationsSkills Matter
 
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmScala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmSkills Matter
 
Oscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheimOscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheimSkills Matter
 
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Skills Matter
 
Cukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberlCukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberlSkills Matter
 
Cukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.jsCukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.jsSkills Matter
 
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...Skills Matter
 
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...Skills Matter
 
Progressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldProgressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldSkills Matter
 
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...Skills Matter
 
Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#Skills Matter
 
A poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testingA poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testingSkills Matter
 
Russ miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-diveRuss miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-diveSkills Matter
 
Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSkills Matter
 
I went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_tI went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_tSkills Matter
 

Mais de Skills Matter (20)

5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard Lawrence5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard Lawrence
 
Patterns for slick database applications
Patterns for slick database applicationsPatterns for slick database applications
Patterns for slick database applications
 
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmScala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
 
Oscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheimOscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheim
 
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
 
Cukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberlCukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberl
 
Cukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.jsCukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.js
 
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
 
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
 
Progressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldProgressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source world
 
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
 
Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#
 
A poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testingA poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testing
 
Russ miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-diveRuss miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-dive
 
Serendipity-neo4j
Serendipity-neo4jSerendipity-neo4j
Serendipity-neo4j
 
Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelism
 
Plug 20110217
Plug   20110217Plug   20110217
Plug 20110217
 
Lug presentation
Lug presentationLug presentation
Lug presentation
 
I went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_tI went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_t
 
Plug saiku
Plug   saikuPlug   saiku
Plug saiku
 

Último

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 

Último (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

Akka scalaliftoff london_2010

  • 1. Akka: Simpler Concurrency, Scalability & Fault-tolerance through Actors Jonas Bonér Scalable Solutions jonas@jonasboner.com twitter: @jboner Thursday, October 7, 2010
  • 2. The problem It is way too hard to build: 1. correct highly concurrent systems 2. truly scalable systems 3. fault-tolerant systems that self-heals ...using “state-of-the-art” tools Thursday, October 7, 2010
  • 3. Vision Simpler Concurrency Scalability Fault-tolerance Through one single unified Programming model Runtime service Thursday, October 7, 2010
  • 5. Scale up & Scale out Thursday, October 7, 2010
  • 6. Replicate and distribute for fault-tolerance Thursday, October 7, 2010
  • 7. Automatic & adaptive load balancing Thursday, October 7, 2010
  • 8. Introducing Concurrency Scalability Fault-tolerance Actors STM Agents Dataflow Distributed Secure Persistent Open Source Clustered Thursday, October 7, 2010
  • 9. Architecture Core Modules Thursday, October 7, 2010
  • 10. Architecture Add-on Modules Add-on Modules Thursday, October 7, 2010
  • 11. Architecture Enterprise Modules Thursday, October 7, 2010
  • 12. Actors one tool in the toolbox Thursday, October 7, 2010
  • 14. Actor Model of Concurrency • Implements Message-Passing Concurrency • Share NOTHING • Isolated lightweight processes • Communicates through messages • Asynchronous and non-blocking • Each actor has a mailbox (message queue) Thursday, October 7, 2010
  • 15. Actor Model of Concurrency • Easier to reason about • Raised abstraction level • Easier to avoid –Race conditions –Deadlocks –Starvation –Live locks Thursday, October 7, 2010
  • 16. Two different models • Thread-based • Event-based – Very lightweight (600 bytes per actor) – Can easily create millions on a single workstation (13 million on 8 G RAM) – Does not consume a thread Thursday, October 7, 2010
  • 17. Actors case  object  Tick class  Counter  extends  Actor  {    private  var  counter  =  0    def  receive  =  {        case  Tick  =>              counter  +=  1            println(counter)    } } Thursday, October 7, 2010
  • 18. Create Actors import  Actor._ val  counter  =  actorOf[Counter] counter is an ActorRef Thursday, October 7, 2010
  • 19. Create Actors val  actor  =  actorOf(new  MyActor(..)) create actor with constructor arguments Thursday, October 7, 2010
  • 20. Start actors val  counter  =  actorOf[Counter] counter.start Thursday, October 7, 2010
  • 21. Start actors val  counter  =  actorOf[Counter].start Thursday, October 7, 2010
  • 22. Stop actors val  counter  =  actorOf[Counter].start counter.stop Thursday, October 7, 2010
  • 23. init & shutdown callbacks class  MyActor  extends  Actor  {    override  def  preStart  =  {        ...  //  called  after  ‘start’      }    override  def  postStop  =  {        ...  //  called  before  ‘stop’    } } Thursday, October 7, 2010
  • 24. the self reference class  RecursiveActor  extends  Actor  {    private  var  counter  =  0    self.id  =  “service:recursive”    def  receive  =  {        case  Tick  =>              counter  +=  1            self  !  Tick    } } Thursday, October 7, 2010
  • 25. Actors anonymous val  worker  =  actor  {    case  Work(fn)  =>  fn() } Thursday, October 7, 2010
  • 26. Send: ! counter  !  Tick   fire-forget Thursday, October 7, 2010
  • 27. Send: ! counter.sendOneWay(Tick) fire-forget Thursday, October 7, 2010
  • 28. Send: !! val  result  =  (actor  !!  Message).as[String] uses Future under the hood (with time-out) Thursday, October 7, 2010
  • 29. Send: !! val  result  =  counter.sendRequestReply(Tick) uses Future under the hood (with time-out) Thursday, October 7, 2010
  • 30. Send: !!! //  returns  a  future val  future  =  actor  !!!  Message future.await val  result  =  future.get ... Futures.awaitOne(List(fut1,  fut2,  ...)) Futures.awaitAll(List(fut1,  fut2,  ...)) returns the Future directly Thursday, October 7, 2010
  • 31. Send: !!! val  result  =  counter.sendRequestReplyFuture(Tick) returns the Future directly Thursday, October 7, 2010
  • 32. Reply class  SomeActor  extends  Actor  {    def  receive  =  {        case  User(name)  =>              //  use  reply            self.reply(“Hi  ”  +  name)    } } Thursday, October 7, 2010
  • 33. Reply class  SomeActor  extends  Actor  {    def  receive  =  {        case  User(name)  =>              //  store  away  the  sender            //  to  use  later  or              //  somewhere  else            ...  =  self.sender    } } Thursday, October 7, 2010
  • 34. Reply class  SomeActor  extends  Actor  {    def  receive  =  {        case  User(name)  =>              //  store  away  the  sender  future            //  to  resolve  later  or              //  somewhere  else            ...  =  self.senderFuture    } } Thursday, October 7, 2010
  • 35. Immutable messages //  define  the  case  class case  class  Register(user:  User) //  create  and  send  a  new  case  class  message actor  !  Register(user) //  tuples actor  !  (username,  password) //  lists actor  !  List(“bill”,  “bob”,  “alice”) Thursday, October 7, 2010
  • 36. ActorRegistry val  actors  =  ActorRegistry.actors val  actors  =  ActorRegistry.actorsFor[TYPE] val  actors  =  ActorRegistry.actorsFor(id) val  actor  =  ActorRegistry.actorFor(uuid) ActorRegistry.foreach(fn) ActorRegistry.shutdownAll Thursday, October 7, 2010
  • 38. Typed Actors class  CounterImpl      extends  TypedActor  with  Counter  {    private  var  counter  =  0;    def  count  =  {        counter  +=  1        println(counter)    } } Thursday, October 7, 2010
  • 39. Create Typed Actor val  counter  =  TypedActor.newInstance(        classOf[Counter],  classof[CounterImpl]) Thursday, October 7, 2010
  • 40. Send message counter.count fire-forget Thursday, October 7, 2010
  • 41. Request Reply val  hits  =  counter.getNrOfHits uses Future under the hood (with time-out) Thursday, October 7, 2010
  • 42. the context reference class  PingImpl  extends  TypedActor      with  Ping  {    def  hit(count:  Int)  =  {        val  pong  =  getContext    .getSender.asInstanceOf[Pong]        pong.hit(count  +=  1)    } } Thursday, October 7, 2010
  • 43. Actors: config akka  {    version  =  "0.10"    time-­‐unit  =  "seconds"    actor  {        timeout  =  5        throughput  =  5    } } Thursday, October 7, 2010
  • 44. Scalability Benchmark Simple Trading system • Synchronous Scala version • Scala Library Actors 2.8.0 •Fire-forget •Request-reply (Futures) • Akka • Fire-forget (Hawt dispatcher) • Fire-forget (default dispatcher) • Request-reply Run it yourself: http://github.com/patriknw/akka-sample-trading Thursday, October 7, 2010
  • 45. Agents yet another tool in the toolbox Thursday, October 7, 2010
  • 46. Agents val  agent  =  Agent(5) //  send  function  asynchronously agent  send  (_  +  1)   val  result  =  agent()  //  deref ...  //  use  result agent.close Cooperates with STM Thursday, October 7, 2010
  • 48. Dispatchers • Executor-based Dispatcher • Executor-based Work-stealing Dispatcher • Hawt Dispatcher • Thread-based Dispatcher Thursday, October 7, 2010
  • 49. Dispatchers object  Dispatchers  {    object  globalHawtDispatcher  extends  HawtDispatcher    ...      def  newExecutorBasedEventDrivenDispatcher(name:  String)    def  newExecutorBasedEventDrivenWorkStealingDispatcher(name:  String)    def  newHawtDispatcher(aggregate:  Boolean)    ... } Thursday, October 7, 2010
  • 50. Set dispatcher class  MyActor  extends  Actor  {    self.dispatcher  =  Dispatchers        .newThreadBasedDispatcher(self)        ... } actor.dispatcher  =  dispatcher  //  before  started Thursday, October 7, 2010
  • 51. Let it crash fault-tolerance Thursday, October 7, 2010
  • 52. Influenced by Erlang Thursday, October 7, 2010
  • 53. 9 nines Thursday, October 7, 2010
  • 54. OneForOne fault handling strategy Thursday, October 7, 2010
  • 55. OneForOne fault handling strategy Thursday, October 7, 2010
  • 56. OneForOne fault handling strategy Thursday, October 7, 2010
  • 57. OneForOne fault handling strategy Thursday, October 7, 2010
  • 58. OneForOne fault handling strategy Thursday, October 7, 2010
  • 59. OneForOne fault handling strategy Thursday, October 7, 2010
  • 60. OneForOne fault handling strategy Thursday, October 7, 2010
  • 61. OneForOne fault handling strategy Thursday, October 7, 2010
  • 62. AllForOne fault handling strategy Thursday, October 7, 2010
  • 63. AllForOne fault handling strategy Thursday, October 7, 2010
  • 64. AllForOne fault handling strategy Thursday, October 7, 2010
  • 65. AllForOne fault handling strategy Thursday, October 7, 2010
  • 66. AllForOne fault handling strategy Thursday, October 7, 2010
  • 73. Fault handlers AllForOneStrategy(    maxNrOfRetries,      withinTimeRange) OneForOneStrategy(    maxNrOfRetries,      withinTimeRange) Thursday, October 7, 2010
  • 74. Linking link(actor)   unlink(actor)   startLink(actor) spawnLink[MyActor] Thursday, October 7, 2010
  • 75. trapExit trapExit  =  List(  classOf[ServiceException],    classOf[PersistenceException]) Thursday, October 7, 2010
  • 76. Supervision class  Supervisor  extends  Actor  {    trapExit  =  List(classOf[Throwable])    faultHandler  =          Some(OneForOneStrategy(5,  5000))    def  receive  =  {        case  Register(actor)  =>              link(actor)    } } Thursday, October 7, 2010
  • 77. Manage failure class  FaultTolerantService  extends  Actor  {    ...    override  def  preRestart(reason:  Throwable)  =  {        ...  //  clean  up  before  restart    }    override  def  postRestart(reason:  Throwable)  =  {        ...  //  init  after  restart    } } Thursday, October 7, 2010
  • 79. Remote Server //  use  host  &  port  in  config RemoteNode.start RemoteNode.start("localhost",  9999) Scalable implementation based on NIO (Netty) & Protobuf Thursday, October 7, 2010
  • 80. Two types of remote actors Client managed Server managed Thursday, October 7, 2010
  • 81. Client-managed supervision works across nodes //  methods  in  Actor  class spawnRemote[MyActor](host,  port)   spawnLinkRemote[MyActor](host,  port) startLinkRemote(actor,  host,  port) Thursday, October 7, 2010
  • 82. Client-managed moves actor to server client manages through proxy val  actorProxy  =  spawnLinkRemote[MyActor](    “darkstar”,      9999) actorProxy  !  message Thursday, October 7, 2010
  • 83. Server-managed register and manage actor on server client gets “dumb” proxy handle RemoteNode.register(“service:id”,  actorOf[MyService]) server part Thursday, October 7, 2010
  • 84. Server-managed val  handle  =  RemoteClient.actorFor(    “service:id”,      “darkstar”,      9999) handle  !  message client part Thursday, October 7, 2010
  • 85. Cluster Membership Cluster.relayMessage(    classOf[TypeOfActor],  message) for  (endpoint  <-­‐  Cluster)      spawnRemote[TypeOfActor](                                endpoint.host,                              endpoint.port) Thursday, October 7, 2010
  • 86. STM yet another tool in the toolbox Thursday, October 7, 2010
  • 87. What is STM? 71 Thursday, October 7, 2010
  • 88. STM: overview • See the memory (heap and stack) as a transactional dataset • Similar to a database • begin • commit • abort/rollback • Transactions are retried automatically upon collision • Rolls back the memory on abort Thursday, October 7, 2010
  • 89. Managed References • Separates Identity from Value - Values are immutable - Identity (Ref) holds Values • Change is a function • Compare-and-swap (CAS) • Abstraction of time • Must be used within a transaction Thursday, October 7, 2010
  • 90. atomic import  se.scalablesolutions.akka.stm.local._   atomic  {    ...    atomic  {        ...  //  transactions  compose!!!    } } Thursday, October 7, 2010
  • 91. Managed References Typical OO - Direct Typical OO: direct Mutable Objects objects references to access to mutable foo :a ? :b ? :c 42 :d ? :e 6 Clojure - and value • Unifies identity Indirect references Managed Reference: separates Identity & Value • Anything can change at any time • Consistency is a user problem Objects to Immutable • Encapsulation doesn’t solve concurrency:a foo "fred" problems :b "ethel" @foo :c 42 :d 17 :e 6 Copyright Rich Hickey 2009 Thursday, October 7, 2010 • Separates identity and value
  • 92. Managed References • Separates Identity from Value - Values are immutable - Identity (Ref) holds Values • Change is a function • Compare-and-swap (CAS) • Abstraction of time • Must be used within a transaction Thursday, October 7, 2010
  • 93. Managed References import  se.scalablesolutions.akka.stm.local._   //  giving  an  initial  value val  ref  =  Ref(0)   //  specifying  a  type  but  no  initial  value val  ref  =  Ref[Int] Thursday, October 7, 2010
  • 94. Managed References val  ref  =  Ref(0)   atomic  {    ref.set(5) } //  -­‐>  0   atomic  {    ref.get } //  -­‐>  5 Thursday, October 7, 2010
  • 95. Managed References val  ref  =  Ref(0)   atomic  {    ref  alter  (_  +  5) } //  -­‐>  5   val  inc  =  (i:  Int)  =>  i  +  1   atomic  {    ref  alter  inc } //  -­‐>  6 Thursday, October 7, 2010
  • 96. Managed References val  ref  =  Ref(1)   val  anotherRef  =  Ref(3)   atomic  {    for  {        value1  <-­‐  ref        value2  <-­‐  anotherRef    }  yield  (value1  +  value2) } //  -­‐>  Ref(4)   val  emptyRef  =  Ref[Int]   atomic  {    for  {        value1  <-­‐  ref        value2  <-­‐  emptyRef    }  yield  (value1  +  value2) } //  -­‐>  Ref[Int] Thursday, October 7, 2010
  • 97. Transactional datastructures //  using  initial  values val  map        =  TransactionalMap("bill"  -­‐>  User("bill")) val  vector  =  TransactionalVector(Address("somewhere"))   //  specifying  types val  map        =  TransactionalMap[String,  User] val  vector  =  TransactionalVector[Address] Thursday, October 7, 2010
  • 98. life-cycle listeners atomic  {    deferred  {        //  executes  when  transaction  commits    }    compensating  {        //  executes  when  transaction  aborts    } } Thursday, October 7, 2010
  • 99. Actors + STM = Transactors Thursday, October 7, 2010
  • 100. Transactors class  UserRegistry  extends  Transactor  {        private  lazy  val  storage  =          TransactionalMap[String,  User]()    def  receive  =  {        case  NewUser(user)  =>            storage  +  (user.name  -­‐>  user)        ...      } } Thursday, October 7, 2010
  • 102. Transactors Start transaction Thursday, October 7, 2010
  • 103. Transactors Start transaction Send message Thursday, October 7, 2010
  • 104. Transactors Start transaction Send message Thursday, October 7, 2010
  • 105. Transactors Start transaction Send message Update state within transaction Thursday, October 7, 2010
  • 106. Transactors Start transaction Send message Update state within transaction Thursday, October 7, 2010
  • 107. Transactors Start transaction Send message Update state within transaction Thursday, October 7, 2010
  • 108. Transactors Start transaction Send message Update state within transaction Thursday, October 7, 2010
  • 109. Transactors Start transaction Send message Update state within transaction Thursday, October 7, 2010
  • 110. Transactors Start transaction Send message Update state within transaction Thursday, October 7, 2010
  • 111. Transactors Start transaction Send message Update state within transaction Transaction fails Thursday, October 7, 2010
  • 112. Transactors Start transaction Send message Update state within transaction Transaction fails Thursday, October 7, 2010
  • 119. Transactors Transaction automatically retried Thursday, October 7, 2010
  • 120. blocking transactions class  Transferer  extends  Actor  {    implicit  val  txFactory  =  TransactionFactory(        blockingAllowed  =  true,  trackReads  =  true,  timeout  =  60  seconds)      def  receive  =  {        case  Transfer(from,  to,  amount)  =>            atomic  {                if  (from.get  <  amount)  {                    log.info("not  enough  money  -­‐  retrying")                    retry                }                log.info("transferring")                from  alter  (_  -­‐  amount)                to  alter  (_  +  amount)            }    } } Thursday, October 7, 2010
  • 121. either-orElse    atomic  {        either  {            if  (left.get  <  amount)  {                log.info("not  enough  on  left  -­‐  retrying")                retry            }            log.info("going  left")        }  orElse  {            if  (right.get  <  amount)  {                log.info("not  enough  on  right  -­‐  retrying")                retry            }            log.info("going  right")        }    } Thursday, October 7, 2010
  • 122. STM: config akka  {    stm  {            max-­‐retries  =  1000            timeout  =  10            write-­‐skew  =  true            blocking-­‐allowed  =  false            interruptible  =  false            speculative  =  true            quick-­‐release  =  true            propagation  =  requires            trace-­‐level  =  none            hooks  =  true            jta-­‐aware  =  off    } } Thursday, October 7, 2010
  • 125. STM gives us Atomic Consistent Isolated Thursday, October 7, 2010
  • 126. Persistence module turns STM into Atomic Consistent Isolated Durable Thursday, October 7, 2010
  • 127. Akka Persistence API //  transactional  Cassandra-­‐backed  Map   val  map  =  CassandraStorage.newMap //  transactional  Redis-­‐backed  Vector   val  vector  =  RedisStorage.newVector //  transactional  Mongo-­‐backed  Ref val  ref  =  MongoStorage.newRef Thursday, October 7, 2010
  • 128. For Redis only (so far) val  queue:  PersistentQueue[ElementType]  =          RedisStorage.newQueue val  set:  PersistentSortedSet[ElementType]  =    RedisStorage.newSortedSet Thursday, October 7, 2010
  • 130. Spring integration <beans>    <akka:typed-­‐actor          id="myActiveObject"          interface="com.biz.MyPOJO"          implementation="com.biz.MyPOJO"          transactional="true"          timeout="1000"  />    ... </beans> Thursday, October 7, 2010
  • 131. Spring integration <akka:supervision  id="my-­‐supervisor">    <akka:restart-­‐strategy  failover="AllForOne"                                                    retries="3"                                                    timerange="1000">        <akka:trap-­‐exits>      <akka:trap-­‐exit>java.io.IOException</akka:trap-­‐exit>        </akka:trap-­‐exits>    </akka:restart-­‐strategy>    <akka:typed-­‐actors>        <akka:typed-­‐actor  interface="com.biz.MyPOJO"                                              implementation="com.biz.MyPOJOImpl"                                              lifecycle="permanent"                                              timeout="1000">        </akka:typed-­‐actor>    </akka:typed-­‐actors> </akka:supervision> Thursday, October 7, 2010
  • 133. Camel: consumer class  MyConsumer  extends  Actor  with  Consumer  {    def  endpointUri  =  "file:data/input"      def  receive  =  {        case  msg:  Message  =>              log.info("received  %s"  format            msg.bodyAs(classOf[String]))    } } Thursday, October 7, 2010
  • 134. Camel: consumer class  MyConsumer  extends  Actor  with  Consumer  {    def  endpointUri  =          "jetty:http://0.0.0.0:8877/camel/test"      def  receive  =  {        case  msg:  Message  =>              reply("Hello  %s"  format                          msg.bodyAs(classOf[String]))    } } Thursday, October 7, 2010
  • 135. Camel: producer class  CometProducer      extends  Actor  with  Producer  {        def  endpointUri  =          "cometd://localhost:8111/test"      def  receive  =  produce  //  use  default  impl } Thursday, October 7, 2010
  • 136. Camel: producer val  producer  =  actorOf[CometProducer].start val  time  =  "Current  time:  "  +  new  Date producer  !  time Thursday, October 7, 2010
  • 138. HotSwap actor  !  HotSwap({    //  new  body    case  Ping  =>          ...      case  Pong  =>          ...     }) Thursday, October 7, 2010
  • 139. HotSwap self.become({    //  new  body    case  Ping  =>          ...      case  Pong  =>          ...     }) Thursday, October 7, 2010
  • 140. How to run it? Deploy as dependency JAR in WEB-INF/lib etc. Run as stand-alone microkernel OSGi-enabled; drop in any OSGi container (Spring DM server, Karaf etc.) Thursday, October 7, 2010
  • 142. Start Kernel java  -­‐jar  akka-­‐1.0-­‐SNAPSHOT.jar      -­‐Dakka.config=<path>/akka.conf Thursday, October 7, 2010
  • 143. ...and much much more PubSub REST Security FSM Comet Web OSGi Guice Thursday, October 7, 2010
  • 144. Learn more http://akkasource.org Thursday, October 7, 2010