SlideShare a Scribd company logo
Develop	
  modern	
  apps	
  using	
  
Spring	
  ecosystem	
  at	
  BigData	
  era	
  
LEAD	
  SOFTWARE	
  ENGINEER	
  AT	
  EPAM	
  SYSTEMS.	
  
PATIONATE	
  DEVELOPER,	
  SPEAKER,	
  ACTIVE	
  MEMBER	
  OF	
  KIEV	
  
JUG.	
  
PARTICIPATE	
  IN	
  DIFFERENT	
  EDUCATIONAL	
  INITIATIVES,	
  
ENGINEERING	
  EVENTS	
  AND	
  JCP/ADOPTJSR	
  PROGRAMS.	
  
	
  
OLEG TSAL-TSALKO
ABOUT ME
Spring	
  	
  
for	
  a	
  long	
  Mme	
  	
  
no	
  more	
  than	
  	
  
just	
  a	
  Framework	
  
Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData
Spring	
  Boot	
  
‱  General	
  purpose	
  plaRorm	
  for	
  Web	
  app	
  and	
  
client	
  app	
  development	
  which	
  makes	
  complex	
  
apps	
  development	
  look	
  easy	
  	
  
‱  Rapid	
  development	
  of	
  diïŹ€	
  type	
  applicaMons	
  
based	
  on	
  solid	
  Spring	
  foundaMon	
  
‱  No	
  boilerplate	
  code.	
  You	
  write	
  only	
  needfull/
funcMonal	
  code.	
  Spring	
  knows	
  beVer	
  how	
  
make	
  it	
  all	
  work.	
  
‱  Nevertheless	
  easy	
  to	
  customize	
  and	
  extend	
  
‱  Simple	
  and	
  robust	
  dependency	
  management	
  
[DEMO:]	
  Tweets	
  Boot	
  Data	
  REST	
  app	
  
1.  Basic	
  5	
  mins	
  Boot	
  Data	
  Rest	
  app	
  which	
  simply	
  works!	
  
2.  Lets	
  add	
  logging	
  and	
  external	
  properMes	
  support	
  
3.  Lets	
  add	
  integraMon	
  tests	
  
4.  Lets	
  add	
  Tweet	
  lifecycle	
  event	
  listeners	
  
5.  Lets	
  add	
  Actuator	
  monitoring	
  support	
  
6.  Lets	
  add	
  much	
  more	
 Â ïŹelds	
  to	
  Tweet	
  enMty	
  
7.  Lets	
  add	
  Tweet	
  compact	
  projecMon	
  
8.  Lets	
  add	
  validaMon	
  
9.  Lets	
  add	
  addiMonal	
  stuïŹ€	
  to	
  Tweet	
  HATEOUS	
  json	
  view	
  
10. Lets	
  add	
  more	
  custom	
  queries	
  
11. But	
  beVer	
  do	
  not	
  try	
  to	
  make	
  Java	
  8	
  data	
  and	
  Mme	
  
types	
  work))	
  	
  
Develop modern apps using Spring ecosystem at time of BigData
Spring	
  XD	
  
‱  General	
  purpose	
  plaRorm	
  for	
  developing	
  BigData	
  apps	
  
for	
  data	
  ingesMon,	
  data	
  stream	
  and	
  batch	
  processing,	
  
data	
  export	
  and	
  data	
  analyMcs	
  
‱  Scalable	
  and	
  fault	
  tolerant	
  plaRorm	
  in	
  your	
  service	
  
‱  DeclaraMve	
  processing	
  workïŹ‚ow	
  development,	
  
deployment	
  and	
  management	
  
‱  Huge	
  number	
  of	
  predeïŹned	
  available	
  modules	
  that	
  can	
  
be	
  used	
  straight	
  away	
  to	
  bring	
  your	
  processing	
  
pipelines	
  in	
  life	
  in	
  seconds	
  
‱  Easy	
  to	
  extend	
  plaRorm	
  and	
  pluggable	
  custom	
  
modules	
  
‱  Build	
  on	
  top	
  of	
  rich	
  and	
  robust	
  Spring	
  foundaMon	
  
Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData
Real	
  world	
  example	
  for	
  XD	
  
Raw	
  data	
  is	
  captured	
  from	
  mobile	
  phones	
  in	
  JSON	
  format	
  by	
  a	
  Spring	
  XD	
  cluster	
  	
  
where	
  several	
  processes	
  are	
  performed.	
  	
  
The	
  data	
  is	
  then	
  stored	
  in	
  an	
  HDFS	
  cluster	
  where	
  Spring	
  XD	
  batch	
  jobs	
  use	
  SQL	
  via	
  the	
  HAWQ	
  	
  
interface	
  to	
  HDFS	
  and	
  store	
  the	
  calculated	
  reports	
  in	
  Redis.	
  	
  
Spring	
  Boot	
  is	
  then	
  used	
  with	
  Angular.js	
  and	
  D3.js	
  to	
  show	
  analyMcs	
  to	
  end	
  users.	
  
[DEMO:]	
  Spring	
  XD	
  toy.	
  Play	
  with	
  me!	
  
1.  Show	
  XD	
  bootstrap	
  in	
  singlenode	
  mode	
  and	
  deploy	
  simple	
  
streams.	
  Show	
  XD	
  shell	
  and	
  XD	
  UI	
  usages.	
  
2.  Show	
  XD	
  distributed	
  mode	
  conïŹguraMon	
  with	
  external	
  
Zookeeper,	
  DB	
  and	
  Redis.	
  Show	
  XD	
  meta	
  data	
  in	
  
Zookeeper.	
  Deploy	
  same	
  simple	
  streams	
  on	
  cluster	
  and	
  
show	
  XD	
  cluster	
  fault	
  tolerance	
  and	
  recovery.	
  
3.  Show	
  example	
  of	
  predeïŹned	
  XD	
  module	
  conïŹguraMon	
  
(e.g.	
  hdfs)	
  
4.  Create	
  custom	
  module	
  and	
  upload	
  it	
  into	
  XD	
  
5.  Show	
  DEMO	
  for	
  stream	
  reading	
  tweets	
  from	
  TwiVer	
  and	
  
posMng	
  them	
  into	
  REST	
  client	
  app	
  developed	
  before	
  via	
  
HTTP	
  and	
  wriMng	
  them	
  into	
  HDFS	
  in	
  parallel	
  
Develop modern apps using Spring ecosystem at time of BigData
Spring	
  XD	
  (out	
  of	
  scope
)	
  
‱  Show	
  XD	
  job	
  running	
  over	
  Hadoop	
  
‱  Show	
  RabbitMQ	
  integraMon	
  
‱  Show	
  DEMO	
  on	
  running	
  either	
  MapReduce	
  
job	
  using	
  Cascading	
  or	
  Pig	
  over	
  HDFS	
  tweets	
  
data	
  OR	
  running	
  Spark	
  app	
  over	
  HDFS	
  tweets	
  
data	
  
Spring	
  Boot/XD	
  enable	
  twelve	
  factor	
  apps	
  
I.	
  Codebase	
  
One	
  codebase	
  tracked	
  in	
  revision	
  control,	
  many	
  deploys	
  
II.	
  Dependencies	
  
Explicitly	
  declare	
  and	
  isolate	
  dependencies	
  
III.	
  ConïŹg	
  
Store	
  conïŹg	
  in	
  the	
  environment	
  
IV.	
  Backing	
  Services	
  
Treat	
  backing	
  services	
  as	
  aVached	
  resources	
  
V.	
  Build,	
  release,	
  run	
  
Strictly	
  separate	
  build	
  and	
  run	
  stages	
  
VI.	
  Processes	
  
Execute	
  the	
  app	
  as	
  one	
  or	
  more	
  stateless	
  processes	
  
VII.	
  Port	
  binding	
  
Export	
  services	
  via	
  port	
  binding	
  
VIII.	
  Concurrency	
  
Scale	
  out	
  via	
  the	
  process	
  model	
  
IX.	
  Disposability	
  
Maximize	
  robustness	
  with	
  fast	
  startup	
  and	
  graceful	
  shutdown	
  
X.	
  Dev/prod	
  parity	
  
Keep	
  development,	
  staging,	
  and	
  producMon	
  as	
  similar	
  as	
  possible	
  
XI.	
  Logs	
  
Treat	
  logs	
  as	
  event	
  streams	
  
XII.	
  Admin	
  processes	
  
Run	
  admin/management	
  tasks	
  as	
  one-­‐oïŹ€	
  processes	
  
Everything	
  wasn’t	
  so	
  smooth	
  though
	
  
‱  SPEL	
  doesn’t	
  work	
  on	
 Â ïŹlter	
  with	
  JSON	
  elements	
  access	
  implicitly	
  as	
  it	
  works	
  with	
  transformer	
  
module.	
  To	
  make	
 Â ïŹlter	
  work	
  you	
  need	
  either	
  to	
  convert	
  JSON	
  to	
  Tuple	
  or	
  to	
  use	
  JSON	
  Xpath	
  SPEL	
  
syntax	
  
‱  When	
  transform	
  JSON	
  into	
  Tuple	
  and	
  back	
  WARNings	
  are	
  thrown	
  on	
  Jackson	
  transformaMon???	
  
‱  In	
  order	
  implicit	
  converMon	
  to	
  Tuple	
  works,	
  you	
  need	
  to	
  specify	
  contentType	
  MIME	
  header	
  in	
  HTTP	
  
request	
  otherwise	
  it	
  can’t	
  automaMcally	
  cast	
  text/plain	
  MIME	
  message	
  to	
  Tuple	
  
‱  	
  If	
  you	
  deploy	
  hVp	
  module	
  on	
  port	
  which	
  is	
  occupied	
  it	
  won’t	
  fail	
  on	
  deploy	
  but	
  your	
  stream	
  will	
  
simply	
  silently	
  not	
  work	
  
‱  SomeMmes	
  container	
  gets	
  broken	
  and	
  smth	
  stops	
  to	
  work	
  like	
  Taps	
  in	
  my	
  case	
  for	
  example	
  and	
  no	
  
errors	
  in	
  logs.	
  Only	
  container	
  restart	
  helps.	
  
‱  Spring	
  data	
  rest	
  doesn’t	
  expose	
  enMty	
  IDs	
  in	
  JSON	
  body	
  by	
  default	
  
‱  When	
  Mongo	
  enMty	
  save	
  operaMon	
  failing	
  	
  as	
  a	
  result	
  of	
  HTTP	
  call	
  no	
  excepMons	
  visible	
  in	
  logs,	
  just	
  
500	
  ERROR	
  response	
  to	
  client	
  without	
  proper	
  stack	
  trace,	
  however	
  if	
  you	
  call	
  MongoTemplate	
  
directly	
  you’ll	
  get	
  proper	
  stack	
  trace.	
  
‱  If	
  HTTP	
  GET	
  request	
  contentType=applicaMon/json	
  then	
  response	
  will	
  be	
  rendered	
  as	
  applicaMon/x-­‐
spring-­‐data-­‐compact+json,	
  when	
  by	
  default	
  it	
  will	
  be	
  HAL	
  document	
  
‱  By	
  default	
  HVp	
  POST	
  request	
  set	
  contentType=text/plain	
  which	
  failed	
  to	
  be	
  transformed	
  into	
  enMty	
  
‱  hVp://wiki.fasterxml.com/JacksonFAQDateHandling	
  
‱  hVps://github.com/FasterXML/jackson-­‐datatype-­‐jsr310	
  
‱  Mongo	
  doesn’t	
  support	
  Java	
  8	
  Date	
  and	
  Time	
  types	
  naMvely	
  
‱  hVps://jira.spring.io/browse/DATAREST-­‐524	
  
‱  hVp://stackoverïŹ‚ow.com/quesMons/25072967/spring-­‐xd-­‐redis-­‐message-­‐bus-­‐removing-­‐headers-­‐
from-­‐the-­‐message	
  issue	
  with	
  headers	
  passing	
  in	
  Redis	
  
‱  SpringXD	
  doesn’t	
  support	
  packages	
  starMng	
  with	
  ‘java’))!!!	
  
Links	
  
‱  Spring	
  -­‐	
  hVp://spring.io	
  
‱  Zookeeper	
  -­‐	
  
hVp://zookeeper.apache.org/doc/trunk/zookeeperStarted.html	
  
‱  Hadoop	
  -­‐	
  
hVp://hadoop.apache.org/docs/r2.7.1/hadoop-­‐project-­‐dist/hadoop-­‐
common/SingleCluster.html	
  
‱  XD	
  -­‐	
  
hVp://docs.spring.io/spring-­‐xd/docs/current-­‐SNAPSHOT/reference/html	
  
‱  Boot	
  -­‐	
  
hVp://docs.spring.io/autorepo/docs/spring-­‐boot/1.2.0.M2/reference/
htmlsingle/	
  
‱  DataRest	
  -­‐	
  
hVp://docs.spring.io/spring-­‐data/rest/docs/2.3.2.RELEASE/reference/
html/	
  
‱  Redis	
  -­‐	
  hVp://redis.io/documentaMon	
  
‱  RestTemplate	
  -­‐	
  
hVps://spring.io/blog/2009/03/27/rest-­‐in-­‐spring-­‐3-­‐resVemplate	
  	
  
Thank	
  you!	
  
TwiVer:	
  @tsaltsol	
  
Skype:	
  oleg.tsalko	
  
GitHub:	
  olegts	
  
	
  
Code	
  shown:	
  
hVps://github.com/olegts/
SpringXDCustomTweetsTransformer	
  
hVps://github.com/olegts/TweetsBootDataRestApp	
  
	
  

More Related Content

PPTX
Phalcon 2 - PHP Brazil Conference
PDF
10 Typical Java Problems in the Wild
PDF
Php Conference Brazil - Phalcon Giant Killer
PDF
Future of Java
PPTX
PHP Conference - Phalcon hands-on
PDF
PaaS with Java
PDF
Social Connections 2015 CrossWorlds and Domino
PDF
NCUG 2019: Spring forward: an introduction to Spring boot and Thymeleaf for (...
Phalcon 2 - PHP Brazil Conference
10 Typical Java Problems in the Wild
Php Conference Brazil - Phalcon Giant Killer
Future of Java
PHP Conference - Phalcon hands-on
PaaS with Java
Social Connections 2015 CrossWorlds and Domino
NCUG 2019: Spring forward: an introduction to Spring boot and Thymeleaf for (...

What's hot (20)

PDF
IguazĂș: A Long-Running Job Scheduler using Docker and Mesos
PPTX
Amazon ECS at Coursera: A unified execution framework while defending against...
PDF
Securing Legacy CFML Code
PPTX
PPTX
Introducing ASP.NET vNext - A tour of the new ASP.NET platform
PPTX
Cloud Foundry a Developer's Perspective
PPTX
Load Balancing, Failover and Scalability with ColdFusion
PPT
QEWD.js: Have your Node.js Cake and Eat It Too
PPTX
Debugging IE Performance Issues with xperf, ETW and NavigationTiming
PDF
Instant ColdFusion with Vagrant
PDF
A look at FastCgi & Mod_PHP architecture
PPTX
Developing in the Cloud
PPT
ewd-qoper8-vistarpc: Exposing VistA's RPCs as REST Services
PDF
Serverless and Kubernetes Workshop on IBM Cloud
PPTX
#JavaOne What's in an object?
PDF
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
PDF
Raffaele Rialdi
PPTX
Js engine performance
PDF
Php Performance On Windows
PPS
Filesystems
 
IguazĂș: A Long-Running Job Scheduler using Docker and Mesos
Amazon ECS at Coursera: A unified execution framework while defending against...
Securing Legacy CFML Code
Introducing ASP.NET vNext - A tour of the new ASP.NET platform
Cloud Foundry a Developer's Perspective
Load Balancing, Failover and Scalability with ColdFusion
QEWD.js: Have your Node.js Cake and Eat It Too
Debugging IE Performance Issues with xperf, ETW and NavigationTiming
Instant ColdFusion with Vagrant
A look at FastCgi & Mod_PHP architecture
Developing in the Cloud
ewd-qoper8-vistarpc: Exposing VistA's RPCs as REST Services
Serverless and Kubernetes Workshop on IBM Cloud
#JavaOne What's in an object?
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Raffaele Rialdi
Js engine performance
Php Performance On Windows
Filesystems
 
Ad

Viewers also liked (9)

DOCX
Adil_Abdulla CV
DOC
Vassallo_CV_26Jan2016
PDF
El ideal gallego cada español debe 23332 euros por la deuda pĂșblica, casi un...
PPTX
àžàžČàžŁàžšàž¶àžàž©àžČàž§àžŽàž˜àž”àžàžČàžŁàžˆàž±àž”àžàžČàžŁàč€àžŁàž”àžąàž™àžàžČàžŁàžȘàž­àž™
PPTX
Muslim Jobs (English Presentation)
PDF
PDF
JUG UA AdoptJSR participation
PDF
àžĄàžŁàž”àžàž àžčàžĄàžŽàž›àž±àžàžàžČàž—àžČàž‡àž§àž±àž’àž™àž˜àžŁàžŁàžĄàž‚àž­àž‡àžŠàžČàž•àžŽ àč’àč•àč•àč•
PPTX
Business Case and Costing for RDM
Adil_Abdulla CV
Vassallo_CV_26Jan2016
El ideal gallego cada español debe 23332 euros por la deuda pĂșblica, casi un...
àžàžČàžŁàžšàž¶àžàž©àžČàž§àžŽàž˜àž”àžàžČàžŁàžˆàž±àž”àžàžČàžŁàč€àžŁàž”àžąàž™àžàžČàžŁàžȘàž­àž™
Muslim Jobs (English Presentation)
JUG UA AdoptJSR participation
àžĄàžŁàž”àžàž àžčàžĄàžŽàž›àž±àžàžàžČàž—àžČàž‡àž§àž±àž’àž™àž˜àžŁàžŁàžĄàž‚àž­àž‡àžŠàžČàž•àžŽ àč’àč•àč•àč•
Business Case and Costing for RDM
Ad

Similar to Develop modern apps using Spring ecosystem at time of BigData (20)

PDF
Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)
PPTX
Beginners Node.js
PDF
.NET Cloud-Native Bootcamp- Los Angeles
ODP
A Happy Cloud Friendly Java Developer with OpenShift
PDF
.NET Cloud-Native Bootcamp
PPTX
Serverless - DevOps Lessons Learned From Production
PPTX
Normalizing x pages web development
PPTX
PPT
Succeding with the Apache SOA stack
PDF
Simplified DevOps Bliss -with OpenAI API
PPTX
Meanstack overview
PDF
SpringOne 2016 in a nutshell
PPTX
Free Mongo on OpenShift
PPTX
Modern application development with oracle cloud sangam17
PDF
Intro to SpringBatch NoSQL 2021
PPTX
Kalp Corporate Node JS Perfect Guide
PDF
NodeJS
PDF
Beginning MEAN Stack
PDF
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, Smile
PDF
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017
Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)
Beginners Node.js
.NET Cloud-Native Bootcamp- Los Angeles
A Happy Cloud Friendly Java Developer with OpenShift
.NET Cloud-Native Bootcamp
Serverless - DevOps Lessons Learned From Production
Normalizing x pages web development
Succeding with the Apache SOA stack
Simplified DevOps Bliss -with OpenAI API
Meanstack overview
SpringOne 2016 in a nutshell
Free Mongo on OpenShift
Modern application development with oracle cloud sangam17
Intro to SpringBatch NoSQL 2021
Kalp Corporate Node JS Perfect Guide
NodeJS
Beginning MEAN Stack
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, Smile
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017

More from Oleg Tsal-Tsalko (13)

PPTX
Developer on a mission (Devoxx UA 2021)
PPTX
Developer on a mission
PPTX
From Streams to Reactive Streams
PDF
Java 9 Jigsaw HackDay
PDF
Java 8 features
PDF
Lambdas HOL
PDF
Java 8 date & time javaday2014
PDF
Java 8 date & time
PDF
Get ready for spring 4
PDF
Enterprise Integration Patterns
PPTX
Distributed systems and scalability rules
PPTX
Next stop: Spring 4
PPTX
JUG involvment in JCP and AdopJSR program
Developer on a mission (Devoxx UA 2021)
Developer on a mission
From Streams to Reactive Streams
Java 9 Jigsaw HackDay
Java 8 features
Lambdas HOL
Java 8 date & time javaday2014
Java 8 date & time
Get ready for spring 4
Enterprise Integration Patterns
Distributed systems and scalability rules
Next stop: Spring 4
JUG involvment in JCP and AdopJSR program

Recently uploaded (20)

PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Digital Strategies for Manufacturing Companies
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
Essential Infomation Tech presentation.pptx
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
System and Network Administraation Chapter 3
PPTX
ai tools demonstartion for schools and inter college
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
 
PDF
Nekopoi APK 2025 free lastest update
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
history of c programming in notes for students .pptx
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
AI in Product Development-omnex systems
PTS Company Brochure 2025 (1).pdf.......
Wondershare Filmora 15 Crack With Activation Key [2025
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Digital Strategies for Manufacturing Companies
Design an Analysis of Algorithms I-SECS-1021-03
Internet Downloader Manager (IDM) Crack 6.42 Build 41
wealthsignaloriginal-com-DS-text-... (1).pdf
Essential Infomation Tech presentation.pptx
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Upgrade and Innovation Strategies for SAP ERP Customers
System and Network Administraation Chapter 3
ai tools demonstartion for schools and inter college
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
 
Nekopoi APK 2025 free lastest update
How to Choose the Right IT Partner for Your Business in Malaysia
Which alternative to Crystal Reports is best for small or large businesses.pdf
history of c programming in notes for students .pptx
Operating system designcfffgfgggggggvggggggggg
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
AI in Product Development-omnex systems

Develop modern apps using Spring ecosystem at time of BigData

  • 1. Develop  modern  apps  using   Spring  ecosystem  at  BigData  era  
  • 2. LEAD  SOFTWARE  ENGINEER  AT  EPAM  SYSTEMS.   PATIONATE  DEVELOPER,  SPEAKER,  ACTIVE  MEMBER  OF  KIEV   JUG.   PARTICIPATE  IN  DIFFERENT  EDUCATIONAL  INITIATIVES,   ENGINEERING  EVENTS  AND  JCP/ADOPTJSR  PROGRAMS.     OLEG TSAL-TSALKO ABOUT ME
  • 3. Spring     for  a  long  Mme     no  more  than     just  a  Framework  
  • 6. Spring  Boot   ‱  General  purpose  plaRorm  for  Web  app  and   client  app  development  which  makes  complex   apps  development  look  easy     ‱  Rapid  development  of  diïŹ€  type  applicaMons   based  on  solid  Spring  foundaMon   ‱  No  boilerplate  code.  You  write  only  needfull/ funcMonal  code.  Spring  knows  beVer  how   make  it  all  work.   ‱  Nevertheless  easy  to  customize  and  extend   ‱  Simple  and  robust  dependency  management  
  • 7. [DEMO:]  Tweets  Boot  Data  REST  app   1.  Basic  5  mins  Boot  Data  Rest  app  which  simply  works!   2.  Lets  add  logging  and  external  properMes  support   3.  Lets  add  integraMon  tests   4.  Lets  add  Tweet  lifecycle  event  listeners   5.  Lets  add  Actuator  monitoring  support   6.  Lets  add  much  more Â ïŹelds  to  Tweet  enMty   7.  Lets  add  Tweet  compact  projecMon   8.  Lets  add  validaMon   9.  Lets  add  addiMonal  stuïŹ€  to  Tweet  HATEOUS  json  view   10. Lets  add  more  custom  queries   11. But  beVer  do  not  try  to  make  Java  8  data  and  Mme   types  work))    
  • 9. Spring  XD   ‱  General  purpose  plaRorm  for  developing  BigData  apps   for  data  ingesMon,  data  stream  and  batch  processing,   data  export  and  data  analyMcs   ‱  Scalable  and  fault  tolerant  plaRorm  in  your  service   ‱  DeclaraMve  processing  workïŹ‚ow  development,   deployment  and  management   ‱  Huge  number  of  predeïŹned  available  modules  that  can   be  used  straight  away  to  bring  your  processing   pipelines  in  life  in  seconds   ‱  Easy  to  extend  plaRorm  and  pluggable  custom   modules   ‱  Build  on  top  of  rich  and  robust  Spring  foundaMon  
  • 15. Real  world  example  for  XD   Raw  data  is  captured  from  mobile  phones  in  JSON  format  by  a  Spring  XD  cluster     where  several  processes  are  performed.     The  data  is  then  stored  in  an  HDFS  cluster  where  Spring  XD  batch  jobs  use  SQL  via  the  HAWQ     interface  to  HDFS  and  store  the  calculated  reports  in  Redis.     Spring  Boot  is  then  used  with  Angular.js  and  D3.js  to  show  analyMcs  to  end  users.  
  • 16. [DEMO:]  Spring  XD  toy.  Play  with  me!   1.  Show  XD  bootstrap  in  singlenode  mode  and  deploy  simple   streams.  Show  XD  shell  and  XD  UI  usages.   2.  Show  XD  distributed  mode  conïŹguraMon  with  external   Zookeeper,  DB  and  Redis.  Show  XD  meta  data  in   Zookeeper.  Deploy  same  simple  streams  on  cluster  and   show  XD  cluster  fault  tolerance  and  recovery.   3.  Show  example  of  predeïŹned  XD  module  conïŹguraMon   (e.g.  hdfs)   4.  Create  custom  module  and  upload  it  into  XD   5.  Show  DEMO  for  stream  reading  tweets  from  TwiVer  and   posMng  them  into  REST  client  app  developed  before  via   HTTP  and  wriMng  them  into  HDFS  in  parallel  
  • 18. Spring  XD  (out  of  scope
)   ‱  Show  XD  job  running  over  Hadoop   ‱  Show  RabbitMQ  integraMon   ‱  Show  DEMO  on  running  either  MapReduce   job  using  Cascading  or  Pig  over  HDFS  tweets   data  OR  running  Spark  app  over  HDFS  tweets   data  
  • 19. Spring  Boot/XD  enable  twelve  factor  apps   I.  Codebase   One  codebase  tracked  in  revision  control,  many  deploys   II.  Dependencies   Explicitly  declare  and  isolate  dependencies   III.  ConïŹg   Store  conïŹg  in  the  environment   IV.  Backing  Services   Treat  backing  services  as  aVached  resources   V.  Build,  release,  run   Strictly  separate  build  and  run  stages   VI.  Processes   Execute  the  app  as  one  or  more  stateless  processes   VII.  Port  binding   Export  services  via  port  binding   VIII.  Concurrency   Scale  out  via  the  process  model   IX.  Disposability   Maximize  robustness  with  fast  startup  and  graceful  shutdown   X.  Dev/prod  parity   Keep  development,  staging,  and  producMon  as  similar  as  possible   XI.  Logs   Treat  logs  as  event  streams   XII.  Admin  processes   Run  admin/management  tasks  as  one-­‐oïŹ€  processes  
  • 20. Everything  wasn’t  so  smooth  though
   ‱  SPEL  doesn’t  work  on Â ïŹlter  with  JSON  elements  access  implicitly  as  it  works  with  transformer   module.  To  make Â ïŹlter  work  you  need  either  to  convert  JSON  to  Tuple  or  to  use  JSON  Xpath  SPEL   syntax   ‱  When  transform  JSON  into  Tuple  and  back  WARNings  are  thrown  on  Jackson  transformaMon???   ‱  In  order  implicit  converMon  to  Tuple  works,  you  need  to  specify  contentType  MIME  header  in  HTTP   request  otherwise  it  can’t  automaMcally  cast  text/plain  MIME  message  to  Tuple   ‱   If  you  deploy  hVp  module  on  port  which  is  occupied  it  won’t  fail  on  deploy  but  your  stream  will   simply  silently  not  work   ‱  SomeMmes  container  gets  broken  and  smth  stops  to  work  like  Taps  in  my  case  for  example  and  no   errors  in  logs.  Only  container  restart  helps.   ‱  Spring  data  rest  doesn’t  expose  enMty  IDs  in  JSON  body  by  default   ‱  When  Mongo  enMty  save  operaMon  failing    as  a  result  of  HTTP  call  no  excepMons  visible  in  logs,  just   500  ERROR  response  to  client  without  proper  stack  trace,  however  if  you  call  MongoTemplate   directly  you’ll  get  proper  stack  trace.   ‱  If  HTTP  GET  request  contentType=applicaMon/json  then  response  will  be  rendered  as  applicaMon/x-­‐ spring-­‐data-­‐compact+json,  when  by  default  it  will  be  HAL  document   ‱  By  default  HVp  POST  request  set  contentType=text/plain  which  failed  to  be  transformed  into  enMty   ‱  hVp://wiki.fasterxml.com/JacksonFAQDateHandling   ‱  hVps://github.com/FasterXML/jackson-­‐datatype-­‐jsr310   ‱  Mongo  doesn’t  support  Java  8  Date  and  Time  types  naMvely   ‱  hVps://jira.spring.io/browse/DATAREST-­‐524   ‱  hVp://stackoverïŹ‚ow.com/quesMons/25072967/spring-­‐xd-­‐redis-­‐message-­‐bus-­‐removing-­‐headers-­‐ from-­‐the-­‐message  issue  with  headers  passing  in  Redis   ‱  SpringXD  doesn’t  support  packages  starMng  with  ‘java’))!!!  
  • 21. Links   ‱  Spring  -­‐  hVp://spring.io   ‱  Zookeeper  -­‐   hVp://zookeeper.apache.org/doc/trunk/zookeeperStarted.html   ‱  Hadoop  -­‐   hVp://hadoop.apache.org/docs/r2.7.1/hadoop-­‐project-­‐dist/hadoop-­‐ common/SingleCluster.html   ‱  XD  -­‐   hVp://docs.spring.io/spring-­‐xd/docs/current-­‐SNAPSHOT/reference/html   ‱  Boot  -­‐   hVp://docs.spring.io/autorepo/docs/spring-­‐boot/1.2.0.M2/reference/ htmlsingle/   ‱  DataRest  -­‐   hVp://docs.spring.io/spring-­‐data/rest/docs/2.3.2.RELEASE/reference/ html/   ‱  Redis  -­‐  hVp://redis.io/documentaMon   ‱  RestTemplate  -­‐   hVps://spring.io/blog/2009/03/27/rest-­‐in-­‐spring-­‐3-­‐resVemplate    
  • 22. Thank  you!   TwiVer:  @tsaltsol   Skype:  oleg.tsalko   GitHub:  olegts     Code  shown:   hVps://github.com/olegts/ SpringXDCustomTweetsTransformer   hVps://github.com/olegts/TweetsBootDataRestApp   Â