SlideShare a Scribd company logo
1 of 22
A RESTy-JSON API
with spray.io and maven
sponsored by special appearance
Ignasi Marimon-Clos i Sunyol
@ignasi35
#scalabcn
Sunday, June 16, 13
thanks!
Sunday, June 16, 13
special thank you’s
JPradel (@agile_jordi): review and organization
JCasadellà (@jcasadella): review
JRudolph for simplifying step 4
https://github.com/jrudolph/scala-meetup-spray/commit/
c4991938ec7b26b183d701aac73949e7822cf45e
Sunday, June 16, 13
about me
n. /iŋ'nazi/
1) problem solver, Garbage Collector, mostly
java, learning scala, some agile
2) kayaker
3) under construction
4) wears glasses
Sunday, June 16, 13
what we saw
• BDD (cucumber)
• TDD (scalatest)
• sbt (inifinite run)
• intelliJ
• JAX-RS
• Jetty
https://github.com/funcio/bdd-jaxrs-hands-on
Sunday, June 16, 13
what we’ll see
• BDD (cucumber)
• TDD (scalatest)
• sbt (inifinite run)
• intelliJ
• JAX-RS
• Jetty
• BDD (jbehave?)
• TDD (scalatest)
• mvn (infinite run)
• eclipse (worksheet)
• spray-can/https/...
• spray-json
https://github.com/ignasi35/scala-meetup-spray
Sunday, June 16, 13
why? (1/2)
• I’m comfy with eclipse
• I’m comfy with maven (I know that’s weird)
• (no more)Typesafe delivers a prepacked env
• still there s/where
• eclipse-maven integration is solid
• I needed infinite-test in maven at work
• I like trolling Jordi and Jose
Sunday, June 16, 13
why? (2/2)
• spray.io has akka
• spray 1.x has akka 2.x
• spray.io is modularized (that’s useful)
• I don’t need java API (@see play)
• spray-json is f*&[ing simple (via shapeless)
http://spray.io/project-info/current-versions/
Sunday, June 16, 13
why? (bonus)
• spray.io beats all other JVM stacks/fw (*)
http://www.techempower.com/benchmarks/
Sunday, June 16, 13
spray
modules
provided
provided
There’s more provided dep’s
than those labelled but we don’t
need that level of detail now.
credit: graphic made using yuml.me
http://yuml.me/diagram/scruffy/class/[A]->[B],[A]->[C],[B]->[C]
Sunday, June 16, 13
spray
• One thing done right
• spray-routing => simple entry point.
• @sirthias (Mathias Doenitz) in Akka 2.2
• magnet pattern
• alternate to method overload
• IOBridge, directives, Marshallers, ...???
Sunday, June 16, 13
Sunday, June 16, 13
step 1
• Given an HTTP server
• When I GET /hello
• Then I obtain “hello”
Sunday, June 16, 13
step 1 (tips)
• Edit a web.xml
• Create a mapping
• Provide a BeanConnectionBeanFactory
• Add a servers.xml
• Invoke the Olds Gods and the New
Sunday, June 16, 13
specially dedicated to @ch4lit
Sunday, June 16, 13
step 2
• Given an HTTP server
• When I GET /hello.json
• Then I obtain “{msg:‘world’}”
Sunday, June 16, 13
directives + complete
• path/pathPrefix/pathTest
• authenticate
• get/post/delete/...
• decodeRequest/encodeResponse/...
• cache/alwaysCache/...
• complete
http://spray.io/documentation/spray-routing/predefined-directives-alphabetically/
Sunday, June 16, 13
step 3
• Given an HTTP server
• When I GET /books.json
• Then I obtain the complete books stock
Sunday, June 16, 13
step 4
• Given an HTTP server
• And I POST a book.txt in /books
• When I GET /books.json
• Then I obtain the updated books stock
MEGA-KUDOS to
https://github.com/jrudolph
Sunday, June 16, 13
step 5
• Given an HTTP server
• And a programmatic HTTP client
• When I GET /hello.json
• Then I obtain “{msg:‘world’}”
Sunday, June 16, 13
conclusions
• scala in maven is tough
• mvn plugin lacks infini-run, infini-install,...
• scala worksheet rocks
• spray allows a quick entry point
• docs and examples still to be improved
• because I’m very dumb
• ...
Sunday, June 16, 13
thanks!
Sunday, June 16, 13

More Related Content

Viewers also liked

Pesticide Training Course UC Davis, Safety. Part 5 of 5
Pesticide Training Course UC Davis, Safety. Part 5 of 5Pesticide Training Course UC Davis, Safety. Part 5 of 5
Pesticide Training Course UC Davis, Safety. Part 5 of 5UC Davis
 
Ppt microencapsulation
Ppt microencapsulationPpt microencapsulation
Ppt microencapsulationSANA TABASSUM
 
SPM Paper 2 Esei: FORCE AND PRESSURE
SPM Paper 2 Esei: FORCE AND PRESSURESPM Paper 2 Esei: FORCE AND PRESSURE
SPM Paper 2 Esei: FORCE AND PRESSURESuriyati Yusoff
 
power-plant-basics
power-plant-basicspower-plant-basics
power-plant-basicskulanji Siva
 
Blood Bank Management System (including UML diagrams)
Blood Bank Management System (including UML diagrams)Blood Bank Management System (including UML diagrams)
Blood Bank Management System (including UML diagrams)Harshil Darji
 
Flowchart Diagram Templates by Creately
Flowchart Diagram Templates by CreatelyFlowchart Diagram Templates by Creately
Flowchart Diagram Templates by CreatelyCreately
 

Viewers also liked (12)

Final Presentation
Final PresentationFinal Presentation
Final Presentation
 
Pesticide Training Course UC Davis, Safety. Part 5 of 5
Pesticide Training Course UC Davis, Safety. Part 5 of 5Pesticide Training Course UC Davis, Safety. Part 5 of 5
Pesticide Training Course UC Davis, Safety. Part 5 of 5
 
Ppt microencapsulation
Ppt microencapsulationPpt microencapsulation
Ppt microencapsulation
 
Tuna
Tuna Tuna
Tuna
 
SPM Paper 2 Esei: FORCE AND PRESSURE
SPM Paper 2 Esei: FORCE AND PRESSURESPM Paper 2 Esei: FORCE AND PRESSURE
SPM Paper 2 Esei: FORCE AND PRESSURE
 
Hptlc (rajat)
Hptlc  (rajat)Hptlc  (rajat)
Hptlc (rajat)
 
Chemical Reactors
Chemical ReactorsChemical Reactors
Chemical Reactors
 
power-plant-basics
power-plant-basicspower-plant-basics
power-plant-basics
 
Blood Bank Management System (including UML diagrams)
Blood Bank Management System (including UML diagrams)Blood Bank Management System (including UML diagrams)
Blood Bank Management System (including UML diagrams)
 
Ceramics
CeramicsCeramics
Ceramics
 
Bank Management System
Bank Management SystemBank Management System
Bank Management System
 
Flowchart Diagram Templates by Creately
Flowchart Diagram Templates by CreatelyFlowchart Diagram Templates by Creately
Flowchart Diagram Templates by Creately
 

Similar to Spray & Maven Intro for Scala Barcelona Developers Meetup

Odnoklassniki.ru Architecture
Odnoklassniki.ru ArchitectureOdnoklassniki.ru Architecture
Odnoklassniki.ru ArchitectureDmitry Buzdin
 
The Diabolical Developer's Guide to Surviving Java 9
The Diabolical Developer's Guide to Surviving Java 9The Diabolical Developer's Guide to Surviving Java 9
The Diabolical Developer's Guide to Surviving Java 9jClarity
 
Ab(Using) the MetaCPAN API for Fun and Profit v2013
Ab(Using) the MetaCPAN API for Fun and Profit v2013Ab(Using) the MetaCPAN API for Fun and Profit v2013
Ab(Using) the MetaCPAN API for Fun and Profit v2013Olaf Alders
 
Back to the future with Java 7 (Geekout June/2011)
Back to the future with Java 7 (Geekout June/2011)Back to the future with Java 7 (Geekout June/2011)
Back to the future with Java 7 (Geekout June/2011)Martijn Verburg
 
Red Dirt Ruby Conference
Red Dirt Ruby ConferenceRed Dirt Ruby Conference
Red Dirt Ruby ConferenceJohn Woodell
 
Ljc conf open jdk betterrev bof
Ljc conf open jdk betterrev bofLjc conf open jdk betterrev bof
Ljc conf open jdk betterrev bofMani Sarkar
 
萬國之津梁
萬國之津梁萬國之津梁
萬國之津梁charsbar
 
eSynergy Andy Hawkins - Enabling DevOps through next generation configuration...
eSynergy Andy Hawkins - Enabling DevOps through next generation configuration...eSynergy Andy Hawkins - Enabling DevOps through next generation configuration...
eSynergy Andy Hawkins - Enabling DevOps through next generation configuration...PatrickCrompton
 
Java Advanced Features (TCF 2014)
Java Advanced Features (TCF 2014)Java Advanced Features (TCF 2014)
Java Advanced Features (TCF 2014)Michael Redlich
 
Lessons from 4 years of driver develoment
Lessons from 4 years of driver develomentLessons from 4 years of driver develoment
Lessons from 4 years of driver develomentchristkv
 
“Webmapping Solutions: Technology & Tips” -- November 13, 2013
“Webmapping Solutions: Technology & Tips” -- November 13, 2013“Webmapping Solutions: Technology & Tips” -- November 13, 2013
“Webmapping Solutions: Technology & Tips” -- November 13, 2013Aerial Services
 
How Build Infrastructure Powers the Node.js Foundation
How Build Infrastructure Powers the Node.js FoundationHow Build Infrastructure Powers the Node.js Foundation
How Build Infrastructure Powers the Node.js FoundationGibson Fahnestock
 
Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013
Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013
Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013gwhathistory
 
Apcug 2011 07-17-intro_to_drupal_jeff_schuler
Apcug 2011 07-17-intro_to_drupal_jeff_schulerApcug 2011 07-17-intro_to_drupal_jeff_schuler
Apcug 2011 07-17-intro_to_drupal_jeff_schulerhewie
 
Roll your own web crawler. RubyDay 2013
Roll your own web crawler. RubyDay 2013Roll your own web crawler. RubyDay 2013
Roll your own web crawler. RubyDay 2013Francesco Laurita
 
Laug comet intro july 2010
Laug comet intro july 2010Laug comet intro july 2010
Laug comet intro july 2010Skills Matter
 
London Ajax User Group Meetup: Comet Panel
London Ajax User Group Meetup: Comet PanelLondon Ajax User Group Meetup: Comet Panel
London Ajax User Group Meetup: Comet Paneldylanks
 
Open GeoData, Open GeoTools: An Introduction
Open GeoData, Open GeoTools: An IntroductionOpen GeoData, Open GeoTools: An Introduction
Open GeoData, Open GeoTools: An IntroductionRichard Cantwell
 

Similar to Spray & Maven Intro for Scala Barcelona Developers Meetup (20)

Odnoklassniki.ru Architecture
Odnoklassniki.ru ArchitectureOdnoklassniki.ru Architecture
Odnoklassniki.ru Architecture
 
The Diabolical Developer's Guide to Surviving Java 9
The Diabolical Developer's Guide to Surviving Java 9The Diabolical Developer's Guide to Surviving Java 9
The Diabolical Developer's Guide to Surviving Java 9
 
Ab(Using) the MetaCPAN API for Fun and Profit v2013
Ab(Using) the MetaCPAN API for Fun and Profit v2013Ab(Using) the MetaCPAN API for Fun and Profit v2013
Ab(Using) the MetaCPAN API for Fun and Profit v2013
 
Back to the future with Java 7 (Geekout June/2011)
Back to the future with Java 7 (Geekout June/2011)Back to the future with Java 7 (Geekout June/2011)
Back to the future with Java 7 (Geekout June/2011)
 
sbt 1
sbt 1sbt 1
sbt 1
 
Red Dirt Ruby Conference
Red Dirt Ruby ConferenceRed Dirt Ruby Conference
Red Dirt Ruby Conference
 
Ljc conf open jdk betterrev bof
Ljc conf open jdk betterrev bofLjc conf open jdk betterrev bof
Ljc conf open jdk betterrev bof
 
萬國之津梁
萬國之津梁萬國之津梁
萬國之津梁
 
eSynergy Andy Hawkins - Enabling DevOps through next generation configuration...
eSynergy Andy Hawkins - Enabling DevOps through next generation configuration...eSynergy Andy Hawkins - Enabling DevOps through next generation configuration...
eSynergy Andy Hawkins - Enabling DevOps through next generation configuration...
 
Java Advanced Features (TCF 2014)
Java Advanced Features (TCF 2014)Java Advanced Features (TCF 2014)
Java Advanced Features (TCF 2014)
 
Lessons from 4 years of driver develoment
Lessons from 4 years of driver develomentLessons from 4 years of driver develoment
Lessons from 4 years of driver develoment
 
“Webmapping Solutions: Technology & Tips” -- November 13, 2013
“Webmapping Solutions: Technology & Tips” -- November 13, 2013“Webmapping Solutions: Technology & Tips” -- November 13, 2013
“Webmapping Solutions: Technology & Tips” -- November 13, 2013
 
How Build Infrastructure Powers the Node.js Foundation
How Build Infrastructure Powers the Node.js FoundationHow Build Infrastructure Powers the Node.js Foundation
How Build Infrastructure Powers the Node.js Foundation
 
Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013
Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013
Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013
 
Apcug 2011 07-17-intro_to_drupal_jeff_schuler
Apcug 2011 07-17-intro_to_drupal_jeff_schulerApcug 2011 07-17-intro_to_drupal_jeff_schuler
Apcug 2011 07-17-intro_to_drupal_jeff_schuler
 
Roll your own web crawler. RubyDay 2013
Roll your own web crawler. RubyDay 2013Roll your own web crawler. RubyDay 2013
Roll your own web crawler. RubyDay 2013
 
Laug comet intro july 2010
Laug comet intro july 2010Laug comet intro july 2010
Laug comet intro july 2010
 
London Ajax User Group Meetup: Comet Panel
London Ajax User Group Meetup: Comet PanelLondon Ajax User Group Meetup: Comet Panel
London Ajax User Group Meetup: Comet Panel
 
Open GeoData, Open GeoTools: An Introduction
Open GeoData, Open GeoTools: An IntroductionOpen GeoData, Open GeoTools: An Introduction
Open GeoData, Open GeoTools: An Introduction
 
Javantura v4 - CroDuke Indy and the Kingdom of Java Skills - Branko Mihaljevi...
Javantura v4 - CroDuke Indy and the Kingdom of Java Skills - Branko Mihaljevi...Javantura v4 - CroDuke Indy and the Kingdom of Java Skills - Branko Mihaljevi...
Javantura v4 - CroDuke Indy and the Kingdom of Java Skills - Branko Mihaljevi...
 

More from Ignasi Marimon-Clos i Sunyol (9)

The Emperor Has No Docs (Geecon Oct'23)
The Emperor Has No Docs (Geecon Oct'23)The Emperor Has No Docs (Geecon Oct'23)
The Emperor Has No Docs (Geecon Oct'23)
 
Jeroglificos, Minotauros y la factura de la luz
Jeroglificos, Minotauros y la factura de la luzJeroglificos, Minotauros y la factura de la luz
Jeroglificos, Minotauros y la factura de la luz
 
Contributing to Akka (Hacktoberfest 2020)
Contributing to Akka (Hacktoberfest 2020)Contributing to Akka (Hacktoberfest 2020)
Contributing to Akka (Hacktoberfest 2020)
 
Contributing to OSS (Scalator 2020-01-22)
Contributing to OSS (Scalator 2020-01-22)Contributing to OSS (Scalator 2020-01-22)
Contributing to OSS (Scalator 2020-01-22)
 
Reactive Microsystems (Sw Crafters Barcelona 2018)
Reactive Microsystems (Sw Crafters Barcelona 2018)Reactive Microsystems (Sw Crafters Barcelona 2018)
Reactive Microsystems (Sw Crafters Barcelona 2018)
 
Lagom Workshop BarcelonaJUG 2017-06-08
Lagom Workshop  BarcelonaJUG 2017-06-08Lagom Workshop  BarcelonaJUG 2017-06-08
Lagom Workshop BarcelonaJUG 2017-06-08
 
Functional Programming in JAVA 8
Functional Programming in JAVA 8Functional Programming in JAVA 8
Functional Programming in JAVA 8
 
Scala 101-bcndevcon
Scala 101-bcndevconScala 101-bcndevcon
Scala 101-bcndevcon
 
Scala 101
Scala 101Scala 101
Scala 101
 

Recently uploaded

Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
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
 
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
 
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
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
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...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
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...
 
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...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

Spray & Maven Intro for Scala Barcelona Developers Meetup

  • 1. A RESTy-JSON API with spray.io and maven sponsored by special appearance Ignasi Marimon-Clos i Sunyol @ignasi35 #scalabcn Sunday, June 16, 13
  • 3. special thank you’s JPradel (@agile_jordi): review and organization JCasadellà (@jcasadella): review JRudolph for simplifying step 4 https://github.com/jrudolph/scala-meetup-spray/commit/ c4991938ec7b26b183d701aac73949e7822cf45e Sunday, June 16, 13
  • 4. about me n. /iŋ'nazi/ 1) problem solver, Garbage Collector, mostly java, learning scala, some agile 2) kayaker 3) under construction 4) wears glasses Sunday, June 16, 13
  • 5. what we saw • BDD (cucumber) • TDD (scalatest) • sbt (inifinite run) • intelliJ • JAX-RS • Jetty https://github.com/funcio/bdd-jaxrs-hands-on Sunday, June 16, 13
  • 6. what we’ll see • BDD (cucumber) • TDD (scalatest) • sbt (inifinite run) • intelliJ • JAX-RS • Jetty • BDD (jbehave?) • TDD (scalatest) • mvn (infinite run) • eclipse (worksheet) • spray-can/https/... • spray-json https://github.com/ignasi35/scala-meetup-spray Sunday, June 16, 13
  • 7. why? (1/2) • I’m comfy with eclipse • I’m comfy with maven (I know that’s weird) • (no more)Typesafe delivers a prepacked env • still there s/where • eclipse-maven integration is solid • I needed infinite-test in maven at work • I like trolling Jordi and Jose Sunday, June 16, 13
  • 8. why? (2/2) • spray.io has akka • spray 1.x has akka 2.x • spray.io is modularized (that’s useful) • I don’t need java API (@see play) • spray-json is f*&[ing simple (via shapeless) http://spray.io/project-info/current-versions/ Sunday, June 16, 13
  • 9. why? (bonus) • spray.io beats all other JVM stacks/fw (*) http://www.techempower.com/benchmarks/ Sunday, June 16, 13
  • 10. spray modules provided provided There’s more provided dep’s than those labelled but we don’t need that level of detail now. credit: graphic made using yuml.me http://yuml.me/diagram/scruffy/class/[A]->[B],[A]->[C],[B]->[C] Sunday, June 16, 13
  • 11. spray • One thing done right • spray-routing => simple entry point. • @sirthias (Mathias Doenitz) in Akka 2.2 • magnet pattern • alternate to method overload • IOBridge, directives, Marshallers, ...??? Sunday, June 16, 13
  • 13. step 1 • Given an HTTP server • When I GET /hello • Then I obtain “hello” Sunday, June 16, 13
  • 14. step 1 (tips) • Edit a web.xml • Create a mapping • Provide a BeanConnectionBeanFactory • Add a servers.xml • Invoke the Olds Gods and the New Sunday, June 16, 13
  • 15. specially dedicated to @ch4lit Sunday, June 16, 13
  • 16. step 2 • Given an HTTP server • When I GET /hello.json • Then I obtain “{msg:‘world’}” Sunday, June 16, 13
  • 17. directives + complete • path/pathPrefix/pathTest • authenticate • get/post/delete/... • decodeRequest/encodeResponse/... • cache/alwaysCache/... • complete http://spray.io/documentation/spray-routing/predefined-directives-alphabetically/ Sunday, June 16, 13
  • 18. step 3 • Given an HTTP server • When I GET /books.json • Then I obtain the complete books stock Sunday, June 16, 13
  • 19. step 4 • Given an HTTP server • And I POST a book.txt in /books • When I GET /books.json • Then I obtain the updated books stock MEGA-KUDOS to https://github.com/jrudolph Sunday, June 16, 13
  • 20. step 5 • Given an HTTP server • And a programmatic HTTP client • When I GET /hello.json • Then I obtain “{msg:‘world’}” Sunday, June 16, 13
  • 21. conclusions • scala in maven is tough • mvn plugin lacks infini-run, infini-install,... • scala worksheet rocks • spray allows a quick entry point • docs and examples still to be improved • because I’m very dumb • ... Sunday, June 16, 13