SlideShare una empresa de Scribd logo
1 de 36
Real World Scala hAkking


  Raymond Roestenburg
About me

•   Java since 1997
•   Scala since 2010
•   Mostly backend systems
•   Lead architect Traffic Management at CSC
•   Akka committer

code: http://github.com/RayRoestenburg
blog: http://roestenburg.agilesquad.com
twtr: @RayRoestenburg
Company I work for




             Traffic Management
             • Section Control
             • Weigh in Motion
             • Traffic Information
             • Traffic Enforcement
Agenda

•   @MIGO-BORAS sensordomain
•   Sensor networks
•   Typesafe stack
•   Akka Actors
•   Apache Camel Integration
•   Remote Actors
•   Monitoring
•   Testing
•   Deployment
@MIGO-BORAS

•   Koninklijke Marechaussee
•   MTV (Mobiel Toezicht Vreemdelingen)
•   Prevent illegal border crossing
•   Sensor domain
•   Fixed locations
•   Mobile vehicles
•   Cameras, Radars
•   Vehicle properties
•   January 2012
Sensor networks

• Usable for many applications in our field
     •   Distributed along highways and provincial roads
     •   Traffic Enforcement
     •   Traffic Information
     •   Other applications
     •   Roadside systems
     •   Range of sensor types
          – Camera’s, Infrared, Laser, Piezoelectric, Loops, Mobile
            units, …
     • Remotely Configure & Control
Why Scala & Akka

• Less code, less bugs
• Less code, same VM power
• Experienced team (Java, C#, C)
     • 3 experienced Java devs
     • 1 experienced C# dev with no Java experience
• Need to interoperate with existing Java and
  C (JNA)
• Simplify development (C->Java->Scala)
• Ubuntu
Scala 2.9.x

•   Learning curve (Start with simple features)
•   Traits, Tupels, Stackable Traits
•   First Class Functions
•   Scala Collections
       • map, flatMap, partition, foreach, filter, groupBy..
• Option type
       • map.. orElse, foreach,..
• Case classes
• REPL, DSLs, Extension methods
Typesafe Stack

• Current Stack
     • Open Source
     • SBT 0.7.7
     • Scala 2.9.0-1
     • Akka 1.1.3
     • Camel & Camel Components 2.7.0
       (FTP,Mina,Jetty,…)
     • Jboss Netty 3.2.4
• When we started early 2010
     • Akka 0.7, Scala 2.8.0Beta1
Akka Usage

Core
  Actors, Remote, TestKit, Serialization,
 STM, Agents, Dataflow, Async HTTP (Mist),
 FSM, Transactors

Modules
 MicroKernel, Camel, AMQP, Scalaz,
 Spring, OSGi, DataFlow, Persistence,
Akka Actors


      ActorRef    Mailbox      Actor



Message to send



  Dispatcher



                     Threads
Akka Actors


    ActorRef   Mailbox      Actor




Dispatcher



                  Threads
Akka Actors


    ActorRef   Mailbox      Actor




Dispatcher



                  Threads
Akka Actors


    ActorRef   Mailbox      Actor




Dispatcher



                  Threads
Akka Actors


    ActorRef   Mailbox      Actor




Dispatcher



                  Threads
Akka Actors


    ActorRef   Mailbox      Actor




Dispatcher



                  Threads
One-way messaging




                    Shared
                    Dispatcher
Two-way
Two-way with Futures
Camel Actors

• Camel Component integration
• Consumers and Producers
Camel Consumers
Camel Producers
Camel Producers

• Use CamelContext
Dispatchers




ThreadBasedDispatcher
ExecutorBasedEventDrivenDispatcher
ExecutorBasedWorkStealingDispatcher
PriorityExecutorBasedEventDrivenDispatcher
RollYourOwn
Dispatchers

Camel Producers        Local Processing   Camel Consumers




     Heartbeat,                                 Remote Actors
     Cleanup,
     Schedule,
     Long Running,
     Redelivery,
     Remote Error Handling
Messages

• Case classes
     • Simple data containers
     • toProtobuf and fromProtobuf on case class
       and companion object for remoting
• Every msg has a
     • correlation Id to the event
     • Timestamp
• Logging, Tracing, Performance
Event Process Chains




Load Balancer      EndPoint (Consumer/Producer)

Forwarding Actor
Remote Actors

• Client
     • Actor.remote.actorFor(name, host,port)
• Server
     • Actor.remote.register(name, actorRef)


• remoteActorFor: (String, String, Int) =>
  ActorRef = remote.actorFor
Remote Actors Internals

   •   RemoteActorRef                    • RemoteServer
   •   RemoteClient                      • Netty Server
   •   Netty Channels                    • Lifecycle Event
   •   Serialization (Scala,               listeners
       Java, (S)JSON, ProtoBuf           • RemoteProtocol



RemoteActorRef RemoteProtocol ActorRef       Mailbox    Actor




          RemoteClient    RemoteServer
Remote Actors (Akka 1.1.3)

•   JBoss Netty (Channels)
•   Not as transparent as you would like
•   Remote Lifecycle Listeners
•   Closing sockets, reconnect
•   Own Guaranteed Delivery implementation
     – Specific requirements
     – Bases on Idempotent Receiver and Repeating
       messages after reconnect
     – Non-Trivial
     – Heartbeats
     – Exp Backoff
Remote configuration

•   #compression-scheme = "zlib“ #leave out
•   zlib-compression-level = 0
•   client: reconnection-time-window = 2000000
•   client: read-timeout (we use 60)
•   backlog = 4096 # Netty backlog for
    connections, should suffice, increase if
    failures happen
Monitoring

• Application level monitoring
• Listener Actors contain Custom JMX MBeans
• Direct passthrough of msg or translation
Testing with TestKit
Testing one-way Actor Output
Microkernel deployment

• sbt dist (akka-sbt-plugin)
• Creates dist directory
• init.d scripts
Questions?

Más contenido relacionado

La actualidad más candente

Event Driven Architectures with Camel
Event Driven Architectures with CamelEvent Driven Architectures with Camel
Event Driven Architectures with Camelgnanagurus
 
Rails 5 subjective overview
Rails 5 subjective overviewRails 5 subjective overview
Rails 5 subjective overviewJan Berdajs
 
Sbt, idea and eclipse
Sbt, idea and eclipseSbt, idea and eclipse
Sbt, idea and eclipseMike Slinn
 
Reactive Streams - László van den Hoek
Reactive Streams - László van den HoekReactive Streams - László van den Hoek
Reactive Streams - László van den HoekRubiX BV
 
Multi-threading in the modern era: Vertx Akka and Quasar
Multi-threading in the modern era: Vertx Akka and QuasarMulti-threading in the modern era: Vertx Akka and Quasar
Multi-threading in the modern era: Vertx Akka and QuasarGal Marder
 
Zeppelin meetup 2016 madrid
Zeppelin meetup 2016 madridZeppelin meetup 2016 madrid
Zeppelin meetup 2016 madridJongyoul Lee
 
Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"Paolo Negri
 
Samza portable runner for beam
Samza portable runner for beamSamza portable runner for beam
Samza portable runner for beamHai Lu
 
Scaling software with akka
Scaling software with akkaScaling software with akka
Scaling software with akkascalaconfjp
 
Ruby on Rails All Hands Meeting
Ruby on Rails All Hands MeetingRuby on Rails All Hands Meeting
Ruby on Rails All Hands MeetingDan Davis
 
Getting Deep on Orchestration - Nickoloff - DockerCon16
Getting Deep on Orchestration - Nickoloff - DockerCon16Getting Deep on Orchestration - Nickoloff - DockerCon16
Getting Deep on Orchestration - Nickoloff - DockerCon16allingeek
 
Java 8 in Anger (JavaOne)
Java 8 in Anger (JavaOne)Java 8 in Anger (JavaOne)
Java 8 in Anger (JavaOne)Trisha Gee
 
Introduction to Akka
Introduction to AkkaIntroduction to Akka
Introduction to AkkaKnoldus Inc.
 
Deploying microservices on AWS
Deploying microservices on AWSDeploying microservices on AWS
Deploying microservices on AWSMichael Haberman
 
FunctionalConf '16 Robert Virding Erlang Ecosystem
FunctionalConf '16 Robert Virding Erlang EcosystemFunctionalConf '16 Robert Virding Erlang Ecosystem
FunctionalConf '16 Robert Virding Erlang EcosystemRobert Virding
 
Lessons learned migrating 100+ services to Kubernetes
Lessons learned migrating 100+ services to KubernetesLessons learned migrating 100+ services to Kubernetes
Lessons learned migrating 100+ services to KubernetesJose Galarza
 
Erlang as a cloud citizen, a fractal approach to throughput
Erlang as a cloud citizen, a fractal approach to throughputErlang as a cloud citizen, a fractal approach to throughput
Erlang as a cloud citizen, a fractal approach to throughputPaolo Negri
 
Erlang factory 2011 london
Erlang factory 2011 londonErlang factory 2011 london
Erlang factory 2011 londonPaolo Negri
 
High performance network programming on the jvm oscon 2012
High performance network programming on the jvm   oscon 2012 High performance network programming on the jvm   oscon 2012
High performance network programming on the jvm oscon 2012 Erik Onnen
 

La actualidad más candente (20)

Event Driven Architectures with Camel
Event Driven Architectures with CamelEvent Driven Architectures with Camel
Event Driven Architectures with Camel
 
Rails 5 subjective overview
Rails 5 subjective overviewRails 5 subjective overview
Rails 5 subjective overview
 
Sbt, idea and eclipse
Sbt, idea and eclipseSbt, idea and eclipse
Sbt, idea and eclipse
 
Akka Fundamentals
Akka FundamentalsAkka Fundamentals
Akka Fundamentals
 
Reactive Streams - László van den Hoek
Reactive Streams - László van den HoekReactive Streams - László van den Hoek
Reactive Streams - László van den Hoek
 
Multi-threading in the modern era: Vertx Akka and Quasar
Multi-threading in the modern era: Vertx Akka and QuasarMulti-threading in the modern era: Vertx Akka and Quasar
Multi-threading in the modern era: Vertx Akka and Quasar
 
Zeppelin meetup 2016 madrid
Zeppelin meetup 2016 madridZeppelin meetup 2016 madrid
Zeppelin meetup 2016 madrid
 
Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"
 
Samza portable runner for beam
Samza portable runner for beamSamza portable runner for beam
Samza portable runner for beam
 
Scaling software with akka
Scaling software with akkaScaling software with akka
Scaling software with akka
 
Ruby on Rails All Hands Meeting
Ruby on Rails All Hands MeetingRuby on Rails All Hands Meeting
Ruby on Rails All Hands Meeting
 
Getting Deep on Orchestration - Nickoloff - DockerCon16
Getting Deep on Orchestration - Nickoloff - DockerCon16Getting Deep on Orchestration - Nickoloff - DockerCon16
Getting Deep on Orchestration - Nickoloff - DockerCon16
 
Java 8 in Anger (JavaOne)
Java 8 in Anger (JavaOne)Java 8 in Anger (JavaOne)
Java 8 in Anger (JavaOne)
 
Introduction to Akka
Introduction to AkkaIntroduction to Akka
Introduction to Akka
 
Deploying microservices on AWS
Deploying microservices on AWSDeploying microservices on AWS
Deploying microservices on AWS
 
FunctionalConf '16 Robert Virding Erlang Ecosystem
FunctionalConf '16 Robert Virding Erlang EcosystemFunctionalConf '16 Robert Virding Erlang Ecosystem
FunctionalConf '16 Robert Virding Erlang Ecosystem
 
Lessons learned migrating 100+ services to Kubernetes
Lessons learned migrating 100+ services to KubernetesLessons learned migrating 100+ services to Kubernetes
Lessons learned migrating 100+ services to Kubernetes
 
Erlang as a cloud citizen, a fractal approach to throughput
Erlang as a cloud citizen, a fractal approach to throughputErlang as a cloud citizen, a fractal approach to throughput
Erlang as a cloud citizen, a fractal approach to throughput
 
Erlang factory 2011 london
Erlang factory 2011 londonErlang factory 2011 london
Erlang factory 2011 london
 
High performance network programming on the jvm oscon 2012
High performance network programming on the jvm   oscon 2012 High performance network programming on the jvm   oscon 2012
High performance network programming on the jvm oscon 2012
 

Destacado (14)

Working with groups 2
Working with groups 2Working with groups 2
Working with groups 2
 
Computadora precios
Computadora preciosComputadora precios
Computadora precios
 
Inleefreis Zambia
Inleefreis ZambiaInleefreis Zambia
Inleefreis Zambia
 
Akka tips
Akka tipsAkka tips
Akka tips
 
Sound cloud
Sound cloudSound cloud
Sound cloud
 
Bootstrapping a Scala Mindset (Scala eXchange 2014)
Bootstrapping a Scala Mindset (Scala eXchange 2014)Bootstrapping a Scala Mindset (Scala eXchange 2014)
Bootstrapping a Scala Mindset (Scala eXchange 2014)
 
Manual camara panasonic
Manual camara panasonicManual camara panasonic
Manual camara panasonic
 
The Trouble with Naming
The Trouble with NamingThe Trouble with Naming
The Trouble with Naming
 
Turning a Crisis into a Drama
Turning a Crisis into a DramaTurning a Crisis into a Drama
Turning a Crisis into a Drama
 
Five Whys - Devoxx UK 2014
Five Whys - Devoxx UK 2014Five Whys - Devoxx UK 2014
Five Whys - Devoxx UK 2014
 
Akka in-action
Akka in-actionAkka in-action
Akka in-action
 
Get Going with Green - Closing the Sustainability Gap
Get Going with Green - Closing the Sustainability GapGet Going with Green - Closing the Sustainability Gap
Get Going with Green - Closing the Sustainability Gap
 
Functions, Types, Programs and Effects
Functions, Types, Programs and EffectsFunctions, Types, Programs and Effects
Functions, Types, Programs and Effects
 
Framework for Clean Technologies in China
Framework for Clean Technologies in ChinaFramework for Clean Technologies in China
Framework for Clean Technologies in China
 

Similar a Real world Scala hAkking NLJUG JFall 2011

Akka in Production - ScalaDays 2015
Akka in Production - ScalaDays 2015Akka in Production - ScalaDays 2015
Akka in Production - ScalaDays 2015Evan Chan
 
Typesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and PlayTypesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and PlayLuka Zakrajšek
 
Developing distributed applications with Akka and Akka Cluster
Developing distributed applications with Akka and Akka ClusterDeveloping distributed applications with Akka and Akka Cluster
Developing distributed applications with Akka and Akka ClusterKonstantin Tsykulenko
 
DotNext 2020 - When and How to Use the Actor Model and Akka.NET
DotNext 2020 - When and How to Use the Actor Model and Akka.NETDotNext 2020 - When and How to Use the Actor Model and Akka.NET
DotNext 2020 - When and How to Use the Actor Model and Akka.NETpetabridge
 
Monitoring Akka with Kamon 1.0
Monitoring Akka with Kamon 1.0Monitoring Akka with Kamon 1.0
Monitoring Akka with Kamon 1.0Steffen Gebert
 
Spark Kernel Talk - Apache Spark Meetup San Francisco (July 2015)
Spark Kernel Talk - Apache Spark Meetup San Francisco (July 2015)Spark Kernel Talk - Apache Spark Meetup San Francisco (July 2015)
Spark Kernel Talk - Apache Spark Meetup San Francisco (July 2015)Robert "Chip" Senkbeil
 
Introduction to Actor Model and Akka
Introduction to Actor Model and AkkaIntroduction to Actor Model and Akka
Introduction to Actor Model and AkkaYung-Lin Ho
 
Andy Parsons Pivotal June 2011
Andy Parsons Pivotal June 2011Andy Parsons Pivotal June 2011
Andy Parsons Pivotal June 2011Andy Parsons
 
Actor model in .NET - Akka.NET
Actor model in .NET - Akka.NETActor model in .NET - Akka.NET
Actor model in .NET - Akka.NETKonrad Dusza
 
A tour of Java and the JVM
A tour of Java and the JVMA tour of Java and the JVM
A tour of Java and the JVMAlex Birch
 
Indic threads pune12-typesafe stack software development on the jvm
Indic threads pune12-typesafe stack software development on the jvmIndic threads pune12-typesafe stack software development on the jvm
Indic threads pune12-typesafe stack software development on the jvmIndicThreads
 
Agile Lab_BigData_Meetup_AKKA
Agile Lab_BigData_Meetup_AKKAAgile Lab_BigData_Meetup_AKKA
Agile Lab_BigData_Meetup_AKKAPaolo Platter
 
Kotlin @ Coupang Backed - JetBrains Day seoul 2018
Kotlin @ Coupang Backed - JetBrains Day seoul 2018Kotlin @ Coupang Backed - JetBrains Day seoul 2018
Kotlin @ Coupang Backed - JetBrains Day seoul 2018Sunghyouk Bae
 
Messaging for IoT
Messaging for IoTMessaging for IoT
Messaging for IoTdejanb
 
Building a multi-tenanted Cloud-native AppServer
Building a multi-tenanted Cloud-native AppServerBuilding a multi-tenanted Cloud-native AppServer
Building a multi-tenanted Cloud-native AppServerAfkham Azeez
 
System Integration with Akka and Apache Camel
System Integration with Akka and Apache CamelSystem Integration with Akka and Apache Camel
System Integration with Akka and Apache Camelkrasserm
 
Implementing End-To-End Tracing With Roman Kolesnev and Antony Stubbs | Curre...
Implementing End-To-End Tracing With Roman Kolesnev and Antony Stubbs | Curre...Implementing End-To-End Tracing With Roman Kolesnev and Antony Stubbs | Curre...
Implementing End-To-End Tracing With Roman Kolesnev and Antony Stubbs | Curre...HostedbyConfluent
 
Reasonable RPC with Remotely
Reasonable RPC with RemotelyReasonable RPC with Remotely
Reasonable RPC with RemotelyTimothy Perrett
 

Similar a Real world Scala hAkking NLJUG JFall 2011 (20)

Akka in Production - ScalaDays 2015
Akka in Production - ScalaDays 2015Akka in Production - ScalaDays 2015
Akka in Production - ScalaDays 2015
 
Typesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and PlayTypesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and Play
 
Developing distributed applications with Akka and Akka Cluster
Developing distributed applications with Akka and Akka ClusterDeveloping distributed applications with Akka and Akka Cluster
Developing distributed applications with Akka and Akka Cluster
 
DotNext 2020 - When and How to Use the Actor Model and Akka.NET
DotNext 2020 - When and How to Use the Actor Model and Akka.NETDotNext 2020 - When and How to Use the Actor Model and Akka.NET
DotNext 2020 - When and How to Use the Actor Model and Akka.NET
 
Monitoring Akka with Kamon 1.0
Monitoring Akka with Kamon 1.0Monitoring Akka with Kamon 1.0
Monitoring Akka with Kamon 1.0
 
Spark Kernel Talk - Apache Spark Meetup San Francisco (July 2015)
Spark Kernel Talk - Apache Spark Meetup San Francisco (July 2015)Spark Kernel Talk - Apache Spark Meetup San Francisco (July 2015)
Spark Kernel Talk - Apache Spark Meetup San Francisco (July 2015)
 
Introduction to Actor Model and Akka
Introduction to Actor Model and AkkaIntroduction to Actor Model and Akka
Introduction to Actor Model and Akka
 
Andy Parsons Pivotal June 2011
Andy Parsons Pivotal June 2011Andy Parsons Pivotal June 2011
Andy Parsons Pivotal June 2011
 
Clustersoftware
ClustersoftwareClustersoftware
Clustersoftware
 
Actor model in .NET - Akka.NET
Actor model in .NET - Akka.NETActor model in .NET - Akka.NET
Actor model in .NET - Akka.NET
 
A tour of Java and the JVM
A tour of Java and the JVMA tour of Java and the JVM
A tour of Java and the JVM
 
Indic threads pune12-typesafe stack software development on the jvm
Indic threads pune12-typesafe stack software development on the jvmIndic threads pune12-typesafe stack software development on the jvm
Indic threads pune12-typesafe stack software development on the jvm
 
Java withrealworldtechnology
Java withrealworldtechnologyJava withrealworldtechnology
Java withrealworldtechnology
 
Agile Lab_BigData_Meetup_AKKA
Agile Lab_BigData_Meetup_AKKAAgile Lab_BigData_Meetup_AKKA
Agile Lab_BigData_Meetup_AKKA
 
Kotlin @ Coupang Backed - JetBrains Day seoul 2018
Kotlin @ Coupang Backed - JetBrains Day seoul 2018Kotlin @ Coupang Backed - JetBrains Day seoul 2018
Kotlin @ Coupang Backed - JetBrains Day seoul 2018
 
Messaging for IoT
Messaging for IoTMessaging for IoT
Messaging for IoT
 
Building a multi-tenanted Cloud-native AppServer
Building a multi-tenanted Cloud-native AppServerBuilding a multi-tenanted Cloud-native AppServer
Building a multi-tenanted Cloud-native AppServer
 
System Integration with Akka and Apache Camel
System Integration with Akka and Apache CamelSystem Integration with Akka and Apache Camel
System Integration with Akka and Apache Camel
 
Implementing End-To-End Tracing With Roman Kolesnev and Antony Stubbs | Curre...
Implementing End-To-End Tracing With Roman Kolesnev and Antony Stubbs | Curre...Implementing End-To-End Tracing With Roman Kolesnev and Antony Stubbs | Curre...
Implementing End-To-End Tracing With Roman Kolesnev and Antony Stubbs | Curre...
 
Reasonable RPC with Remotely
Reasonable RPC with RemotelyReasonable RPC with Remotely
Reasonable RPC with Remotely
 

Último

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
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
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Último (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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
 
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...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
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
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Real world Scala hAkking NLJUG JFall 2011

  • 1. Real World Scala hAkking Raymond Roestenburg
  • 2. About me • Java since 1997 • Scala since 2010 • Mostly backend systems • Lead architect Traffic Management at CSC • Akka committer code: http://github.com/RayRoestenburg blog: http://roestenburg.agilesquad.com twtr: @RayRoestenburg
  • 3. Company I work for Traffic Management • Section Control • Weigh in Motion • Traffic Information • Traffic Enforcement
  • 4. Agenda • @MIGO-BORAS sensordomain • Sensor networks • Typesafe stack • Akka Actors • Apache Camel Integration • Remote Actors • Monitoring • Testing • Deployment
  • 5. @MIGO-BORAS • Koninklijke Marechaussee • MTV (Mobiel Toezicht Vreemdelingen) • Prevent illegal border crossing • Sensor domain • Fixed locations • Mobile vehicles • Cameras, Radars • Vehicle properties • January 2012
  • 6. Sensor networks • Usable for many applications in our field • Distributed along highways and provincial roads • Traffic Enforcement • Traffic Information • Other applications • Roadside systems • Range of sensor types – Camera’s, Infrared, Laser, Piezoelectric, Loops, Mobile units, … • Remotely Configure & Control
  • 7. Why Scala & Akka • Less code, less bugs • Less code, same VM power • Experienced team (Java, C#, C) • 3 experienced Java devs • 1 experienced C# dev with no Java experience • Need to interoperate with existing Java and C (JNA) • Simplify development (C->Java->Scala) • Ubuntu
  • 8. Scala 2.9.x • Learning curve (Start with simple features) • Traits, Tupels, Stackable Traits • First Class Functions • Scala Collections • map, flatMap, partition, foreach, filter, groupBy.. • Option type • map.. orElse, foreach,.. • Case classes • REPL, DSLs, Extension methods
  • 9. Typesafe Stack • Current Stack • Open Source • SBT 0.7.7 • Scala 2.9.0-1 • Akka 1.1.3 • Camel & Camel Components 2.7.0 (FTP,Mina,Jetty,…) • Jboss Netty 3.2.4 • When we started early 2010 • Akka 0.7, Scala 2.8.0Beta1
  • 10. Akka Usage Core Actors, Remote, TestKit, Serialization, STM, Agents, Dataflow, Async HTTP (Mist), FSM, Transactors Modules MicroKernel, Camel, AMQP, Scalaz, Spring, OSGi, DataFlow, Persistence,
  • 11. Akka Actors ActorRef Mailbox Actor Message to send Dispatcher Threads
  • 12. Akka Actors ActorRef Mailbox Actor Dispatcher Threads
  • 13. Akka Actors ActorRef Mailbox Actor Dispatcher Threads
  • 14. Akka Actors ActorRef Mailbox Actor Dispatcher Threads
  • 15. Akka Actors ActorRef Mailbox Actor Dispatcher Threads
  • 16. Akka Actors ActorRef Mailbox Actor Dispatcher Threads
  • 17. One-way messaging Shared Dispatcher
  • 20. Camel Actors • Camel Component integration • Consumers and Producers
  • 23. Camel Producers • Use CamelContext
  • 25. Dispatchers Camel Producers Local Processing Camel Consumers Heartbeat, Remote Actors Cleanup, Schedule, Long Running, Redelivery, Remote Error Handling
  • 26. Messages • Case classes • Simple data containers • toProtobuf and fromProtobuf on case class and companion object for remoting • Every msg has a • correlation Id to the event • Timestamp • Logging, Tracing, Performance
  • 27. Event Process Chains Load Balancer EndPoint (Consumer/Producer) Forwarding Actor
  • 28. Remote Actors • Client • Actor.remote.actorFor(name, host,port) • Server • Actor.remote.register(name, actorRef) • remoteActorFor: (String, String, Int) => ActorRef = remote.actorFor
  • 29. Remote Actors Internals • RemoteActorRef • RemoteServer • RemoteClient • Netty Server • Netty Channels • Lifecycle Event • Serialization (Scala, listeners Java, (S)JSON, ProtoBuf • RemoteProtocol RemoteActorRef RemoteProtocol ActorRef Mailbox Actor RemoteClient RemoteServer
  • 30. Remote Actors (Akka 1.1.3) • JBoss Netty (Channels) • Not as transparent as you would like • Remote Lifecycle Listeners • Closing sockets, reconnect • Own Guaranteed Delivery implementation – Specific requirements – Bases on Idempotent Receiver and Repeating messages after reconnect – Non-Trivial – Heartbeats – Exp Backoff
  • 31. Remote configuration • #compression-scheme = "zlib“ #leave out • zlib-compression-level = 0 • client: reconnection-time-window = 2000000 • client: read-timeout (we use 60) • backlog = 4096 # Netty backlog for connections, should suffice, increase if failures happen
  • 32. Monitoring • Application level monitoring • Listener Actors contain Custom JMX MBeans • Direct passthrough of msg or translation
  • 35. Microkernel deployment • sbt dist (akka-sbt-plugin) • Creates dist directory • init.d scripts

Notas del editor

  1. ActorRef is an immutable reference which exclusively gives access to the Actor.Actors run on Dispatchers. A Dispatcher runs a mailbox to process messages.Amount of messages per mailbox run is configurable. (actor.throughput, default 5)
  2. One way messaging between two ActorsActors can process messages in parallel
  3. One way messaging between two ActorsActors can process messages in parallel
  4. !!! Is preferred over !!Futuresalso run onDispatchers.FutureTimeoutException happens onfuture.get. IfonlyonComplete and failure are registered, yougetnoFutureTimeoutException