SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Спикер:
Тема презентации:
Stanislav Sidorenko
DeviceHive Java Server and Spring Boot
What is DeviceHive?
DeviceHive is an Open Source Machine-to-Machine
(M2M) framework. It contains a set of services and
components that allow establishing a two-way
communication with remote devices using cloud as a
middleware. The devices can be anything connected: sensor
networks, smart meters, security systems, telemetry, or
smart home devices.
What is inside?
• JavaEE or .NET-based server
• REST и Websocket APIs for devices and Clients
• Data storage: Postgresql and NoSQL (MongoDB).
• Device: Linux C/C++, .NET, .NET Micro Framework, Java,
Python, MicroChip and AVR native C.
• Client: Windows 8, iOS, Android, Windows Phone 7 and
8,.NET, HTML5/JavaScript.
What is inside?
REST, Websockets
REST, Websockets
REST, Websockets
binary
Client: something that manages DevicesDevice: almost everything. 
Gateway: fake Device that quite smart to connect to
DH and to manage other Devices.
Future: merge everything to one entity.
How does it work?
Client
Device
commandsnotifications
commands
notifications
Access control system: Networks
Client DeviceNetwork
1n n n
AccessKey: allows authenticated client to act on behalf of Device
• Network list
• Device list
• IP/Domain
• Actions
Basic access control. User has access to Device if and only if he has access to network
Access control system: AccessKeys
AccessKey: more smart security system similar to MAC
Privilege contains
• Network list
• Device list
• IP/Domain
• Actions
Client PrivilegeAccessKey
11 n n
Java server implementation
• Java EE 7 platform:
• JAX-RS 2.0
• Websocket API 1.0
• JPA 2.1
• EJB 3.2
• CDI 1.1
• PostgreSQL 9.x
• Glassfish 4, 4.1 as reference JEE7 implementation
• Wildfly 8, 8.1 was preliminary tested. There were some issues with
websockets, but now the application works generally fine.
Feedback
• “We’d like to be able to deploy it to Tomcat”
Existing code is built to .war application.
• “Do I need JEE application server? Oh.”
• “Deployment procedure is quite hard.”
OK, let’s try to simplify it. Spring?
• Again not so new technology stack, but quite rich.
• Application can be deployed almost everywhere. Only servlet container is needed (Tomcat, Jetty,..)
• Migration would not be so hard.
• JAX-RS -> Spring MVC or using Jersey (no code migration in fact)
• EJB -> Spring @Service + spring-tx
• Bean Validation API -> the same, just configuration changes.
• JPA -> no changes again
• CDI -> Spring DI (CDI events may be an issue).
• Spring Boot.
Spring Boot.
• Easy deployment
There are many “default” configurations that could be applied
automatically.
• Standalone Spring-based applications
• “fat” executable jar
• archive with two directories: /lib with jars and /bin with unix
shell and windows batch scripts.
• .war packaging is still possible
Maven integration
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Goals:
• boot:repackage
• boot:run
Gradle integration
buildscript {
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-
plugin:1.2.2")
}
}
apply plugin: 'spring-boot‘
Tasks:
bootRepackage
bootRun
Sample application
@RestController
@EnableAutoConfiguration
public class Sample {
@RequestMapping("/")
String home() {
return "Hello World!";
}
public static void main(String[] args) throws Exception {
SpringApplication.run(Sample.class, args);
}
}
Starter POMs
• dependency descriptors, cover all required dependencies.
• named spring-boot-starter-*
Web applications: Use spring-boot-starter-web – attaches default servlet container and spring web dependencies.
spring-boot-starter-tomcat (default one)
spring-boot-starter-jetty
spring-boot-starter-undertow
• Versions
• sprint-boot-starters parent pom
• your own one.
Customizing the application
• Main configuration file: application.properties
• Read from classpath or location can be overridden:
java -jar myproject.jar --spring.config.location=...
• Spring Profiles
--spring.profiles.active=dev,qa,etc…
application-{profile}.properties is used
DataSources deployment
• Embedded datasources:
• embedded H2, HSQL and Derby databases
• just specify spring-jdbc and add runtime DB dependency
• useful for testing
• Production datasource
• add ‘spring-boot-starter-jdbc’ started pom
• specify spring.datasource.* properties (url, user, pw, driver)
• JNDI is also supported
Databases initialization
• JPA - spring.jpa.generate-ddl (good for testing only)
• Spring JDBC
Two files: schema.sql, data.sql or schema-${db}.sql and data-{db}.sql
Again looks file for testing purposes only.
• Embedded Database migration tools
• Flyway
SQL files in classpath:db/migration
• Luqibase
Looks fine for production deployments.
Creating deployable .war file
@SpringBootApplication
public class Application extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder
application) {
return application.sources(Application.class);
}
public static void main(String[] args) throws Exception {
SpringApplication.run(Application.class, args);
}
}
@SpringBootApplication == @Configuration @EnableAutoConfiguration
@ComponentScan
Servlet container customization and other features
• Since container is embedded, it can be customized by the application
• Basic options, e.g.
server.port
server.address
server.sessionTimeout
• Container-specific customizations:
TomcatEmbeddedServletContainerFactory
JettyEmbeddedServletContainerFactory
UndertowEmbeddedServletContainerFactory
Migration
Still in progress…
But we hope it will be done in nearby future.
TODO: comparison, tests, final decision…
Questions
?

Weitere ähnliche Inhalte

Was ist angesagt?

Node.js Development with Apache NetBeans
Node.js Development with Apache NetBeansNode.js Development with Apache NetBeans
Node.js Development with Apache NetBeansRyan Cuprak
 
Building a REST Service in minutes with Spring Boot
Building a REST Service in minutes with Spring BootBuilding a REST Service in minutes with Spring Boot
Building a REST Service in minutes with Spring BootOmri Spector
 
Getting Reactive with Spring Framework 5.0’s GA release
Getting Reactive with Spring Framework 5.0’s GA releaseGetting Reactive with Spring Framework 5.0’s GA release
Getting Reactive with Spring Framework 5.0’s GA releaseVMware Tanzu
 
Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Ryan Cuprak
 
Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules uploadRyan Cuprak
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Matthew Groves
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootJosué Neis
 
Spring boot introduction
Spring boot introductionSpring boot introduction
Spring boot introductionRasheed Waraich
 
Play framework productivity formula
Play framework   productivity formula Play framework   productivity formula
Play framework productivity formula Sorin Chiprian
 
Asp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework CoreAsp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework Coremohamed elshafey
 
Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0Steven Smith
 
Rediscovering Spring with Spring Boot(1)
Rediscovering Spring with Spring Boot(1)Rediscovering Spring with Spring Boot(1)
Rediscovering Spring with Spring Boot(1)Gunith Devasurendra
 
Blazor, lo sapevi che...
Blazor, lo sapevi che...Blazor, lo sapevi che...
Blazor, lo sapevi che...Andrea Dottor
 
SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe
SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe
SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe Sencha
 
Owin from spec to application
Owin from spec to applicationOwin from spec to application
Owin from spec to applicationdamian-h
 
Spring Framework 4.0 - The Next Generation - Soft-Shake 2013
Spring Framework 4.0 - The Next Generation - Soft-Shake 2013Spring Framework 4.0 - The Next Generation - Soft-Shake 2013
Spring Framework 4.0 - The Next Generation - Soft-Shake 2013Sam Brannen
 
Spring boot
Spring bootSpring boot
Spring bootsdeeg
 
Workshop Framework(J2EE/OSGi/RCP)
Workshop Framework(J2EE/OSGi/RCP)Workshop Framework(J2EE/OSGi/RCP)
Workshop Framework(J2EE/OSGi/RCP)Summer Lu
 

Was ist angesagt? (20)

Node.js Development with Apache NetBeans
Node.js Development with Apache NetBeansNode.js Development with Apache NetBeans
Node.js Development with Apache NetBeans
 
Building a REST Service in minutes with Spring Boot
Building a REST Service in minutes with Spring BootBuilding a REST Service in minutes with Spring Boot
Building a REST Service in minutes with Spring Boot
 
Getting Reactive with Spring Framework 5.0’s GA release
Getting Reactive with Spring Framework 5.0’s GA releaseGetting Reactive with Spring Framework 5.0’s GA release
Getting Reactive with Spring Framework 5.0’s GA release
 
Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)
 
Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules upload
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
 
Spring boot introduction
Spring boot introductionSpring boot introduction
Spring boot introduction
 
JavaCro'14 - Securing web applications with Spring Security 3 – Fernando Redo...
JavaCro'14 - Securing web applications with Spring Security 3 – Fernando Redo...JavaCro'14 - Securing web applications with Spring Security 3 – Fernando Redo...
JavaCro'14 - Securing web applications with Spring Security 3 – Fernando Redo...
 
Play framework productivity formula
Play framework   productivity formula Play framework   productivity formula
Play framework productivity formula
 
Asp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework CoreAsp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework Core
 
Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0
 
Rediscovering Spring with Spring Boot(1)
Rediscovering Spring with Spring Boot(1)Rediscovering Spring with Spring Boot(1)
Rediscovering Spring with Spring Boot(1)
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Blazor, lo sapevi che...
Blazor, lo sapevi che...Blazor, lo sapevi che...
Blazor, lo sapevi che...
 
SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe
SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe
SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe
 
Owin from spec to application
Owin from spec to applicationOwin from spec to application
Owin from spec to application
 
Spring Framework 4.0 - The Next Generation - Soft-Shake 2013
Spring Framework 4.0 - The Next Generation - Soft-Shake 2013Spring Framework 4.0 - The Next Generation - Soft-Shake 2013
Spring Framework 4.0 - The Next Generation - Soft-Shake 2013
 
Spring boot
Spring bootSpring boot
Spring boot
 
Workshop Framework(J2EE/OSGi/RCP)
Workshop Framework(J2EE/OSGi/RCP)Workshop Framework(J2EE/OSGi/RCP)
Workshop Framework(J2EE/OSGi/RCP)
 

Andere mochten auch

Zed innovation intro
Zed innovation introZed innovation intro
Zed innovation introZiv Kohav
 
«DeviceHive: IoT в Android». Николай Хабаров
«DeviceHive: IoT в Android». Николай Хабаров«DeviceHive: IoT в Android». Николай Хабаров
«DeviceHive: IoT в Android». Николай ХабаровDataArt
 
Testing in projects
Testing in projectsTesting in projects
Testing in projectsDataArt
 
5penpctechnology 130402085735-phpapp01
5penpctechnology 130402085735-phpapp015penpctechnology 130402085735-phpapp01
5penpctechnology 130402085735-phpapp01Rajeshwar Reddy
 
Артур Чеканов «Microframeworks» (Python Meetup)
Артур Чеканов  «Microframeworks» (Python Meetup)Артур Чеканов  «Microframeworks» (Python Meetup)
Артур Чеканов «Microframeworks» (Python Meetup)DataArt
 
Visiting unpleasent places
Visiting unpleasent placesVisiting unpleasent places
Visiting unpleasent placesArpanasa
 
Estrategika nuevos productos proteccion
Estrategika nuevos productos proteccionEstrategika nuevos productos proteccion
Estrategika nuevos productos proteccionJUAN CARLOS CALDERON
 
The Rental Policies You Need to Know About
The Rental Policies You Need to Know AboutThe Rental Policies You Need to Know About
The Rental Policies You Need to Know AboutUrbanBound
 
Uses and gratification theory
Uses and gratification theoryUses and gratification theory
Uses and gratification theoryAbbey Cotterill
 
Андраш Густи «Интерфейсы, которые вызывают привыкание, или Как перепрошить по...
Андраш Густи «Интерфейсы, которые вызывают привыкание, или Как перепрошить по...Андраш Густи «Интерфейсы, которые вызывают привыкание, или Как перепрошить по...
Андраш Густи «Интерфейсы, которые вызывают привыкание, или Как перепрошить по...DataArt
 
Thriller powerpoint finished
Thriller powerpoint finishedThriller powerpoint finished
Thriller powerpoint finishedAbbey Cotterill
 
นิทาน
นิทานนิทาน
นิทานExitOfLove
 
sistema de gestión de contenidos
sistema de gestión de contenidossistema de gestión de contenidos
sistema de gestión de contenidosDiego Rojas
 

Andere mochten auch (20)

Grids
GridsGrids
Grids
 
Transistores
TransistoresTransistores
Transistores
 
Zed innovation intro
Zed innovation introZed innovation intro
Zed innovation intro
 
«DeviceHive: IoT в Android». Николай Хабаров
«DeviceHive: IoT в Android». Николай Хабаров«DeviceHive: IoT в Android». Николай Хабаров
«DeviceHive: IoT в Android». Николай Хабаров
 
Testing in projects
Testing in projectsTesting in projects
Testing in projects
 
Loe
LoeLoe
Loe
 
Pen pc tecn
Pen pc tecnPen pc tecn
Pen pc tecn
 
5penpctechnology 130402085735-phpapp01
5penpctechnology 130402085735-phpapp015penpctechnology 130402085735-phpapp01
5penpctechnology 130402085735-phpapp01
 
Артур Чеканов «Microframeworks» (Python Meetup)
Артур Чеканов  «Microframeworks» (Python Meetup)Артур Чеканов  «Microframeworks» (Python Meetup)
Артур Чеканов «Microframeworks» (Python Meetup)
 
Visiting unpleasent places
Visiting unpleasent placesVisiting unpleasent places
Visiting unpleasent places
 
Estrategika nuevos productos proteccion
Estrategika nuevos productos proteccionEstrategika nuevos productos proteccion
Estrategika nuevos productos proteccion
 
The Rental Policies You Need to Know About
The Rental Policies You Need to Know AboutThe Rental Policies You Need to Know About
The Rental Policies You Need to Know About
 
Uses and gratification theory
Uses and gratification theoryUses and gratification theory
Uses and gratification theory
 
Андраш Густи «Интерфейсы, которые вызывают привыкание, или Как перепрошить по...
Андраш Густи «Интерфейсы, которые вызывают привыкание, или Как перепрошить по...Андраш Густи «Интерфейсы, которые вызывают привыкание, или Как перепрошить по...
Андраш Густи «Интерфейсы, которые вызывают привыкание, или Как перепрошить по...
 
Media: Ancillary photos
Media: Ancillary photosMedia: Ancillary photos
Media: Ancillary photos
 
Thriller powerpoint finished
Thriller powerpoint finishedThriller powerpoint finished
Thriller powerpoint finished
 
Biblioterapia
BiblioterapiaBiblioterapia
Biblioterapia
 
นิทาน
นิทานนิทาน
นิทาน
 
sistema de gestión de contenidos
sistema de gestión de contenidossistema de gestión de contenidos
sistema de gestión de contenidos
 
Music video regulations
Music video regulationsMusic video regulations
Music video regulations
 

Ähnlich wie Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»

Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)slire
 
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.Otávio Santana
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot IntroductionJeevesh Pandey
 
ASP.NET Core 1.0
ASP.NET Core 1.0ASP.NET Core 1.0
ASP.NET Core 1.0Ido Flatow
 
Java Training at Gateway Software Solutions,Coimbatore
Java Training at Gateway Software Solutions,CoimbatoreJava Training at Gateway Software Solutions,Coimbatore
Java Training at Gateway Software Solutions,CoimbatoreGateway Software Solutions
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.jsorkaplan
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC vipin kumar
 
DevOps &lt;3 node.js
DevOps &lt;3 node.jsDevOps &lt;3 node.js
DevOps &lt;3 node.jsJeff Miccolis
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationStuart (Pid) Williams
 
Advance java prasentation
Advance java prasentationAdvance java prasentation
Advance java prasentationdhananajay95
 
Ankit Chohan - Java
Ankit Chohan - JavaAnkit Chohan - Java
Ankit Chohan - JavaAnkit Chohan
 
A Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEA Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEQAware GmbH
 
A Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEA Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEMario-Leander Reimer
 
AAI-1304 Technical Deep-Dive into IBM WebSphere Liberty
AAI-1304 Technical Deep-Dive into IBM WebSphere LibertyAAI-1304 Technical Deep-Dive into IBM WebSphere Liberty
AAI-1304 Technical Deep-Dive into IBM WebSphere LibertyWASdev Community
 
Automating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAutomating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAkshaya Mahapatra
 
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.pptLecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.pptKalsoomTahir2
 

Ähnlich wie Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot» (20)

Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)
 
01 java intro
01 java intro01 java intro
01 java intro
 
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
 
AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot Introduction
 
ASP.NET Core 1.0
ASP.NET Core 1.0ASP.NET Core 1.0
ASP.NET Core 1.0
 
Java Training at Gateway Software Solutions,Coimbatore
Java Training at Gateway Software Solutions,CoimbatoreJava Training at Gateway Software Solutions,Coimbatore
Java Training at Gateway Software Solutions,Coimbatore
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC
 
DevOps &lt;3 node.js
DevOps &lt;3 node.jsDevOps &lt;3 node.js
DevOps &lt;3 node.js
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentation
 
Intro to Sails.js
Intro to Sails.jsIntro to Sails.js
Intro to Sails.js
 
Advance java prasentation
Advance java prasentationAdvance java prasentation
Advance java prasentation
 
Ankit Chohan - Java
Ankit Chohan - JavaAnkit Chohan - Java
Ankit Chohan - Java
 
A Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEA Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EE
 
A Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEA Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EE
 
AAI-1304 Technical Deep-Dive into IBM WebSphere Liberty
AAI-1304 Technical Deep-Dive into IBM WebSphere LibertyAAI-1304 Technical Deep-Dive into IBM WebSphere Liberty
AAI-1304 Technical Deep-Dive into IBM WebSphere Liberty
 
Automating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAutomating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps Approach
 
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.pptLecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
 
Chap3 3 12
Chap3 3 12Chap3 3 12
Chap3 3 12
 

Mehr von DataArt

DataArt Custom Software Engineering with a Human Approach
DataArt Custom Software Engineering with a Human ApproachDataArt Custom Software Engineering with a Human Approach
DataArt Custom Software Engineering with a Human ApproachDataArt
 
DataArt Healthcare & Life Sciences
DataArt Healthcare & Life SciencesDataArt Healthcare & Life Sciences
DataArt Healthcare & Life SciencesDataArt
 
DataArt Financial Services and Capital Markets
DataArt Financial Services and Capital MarketsDataArt Financial Services and Capital Markets
DataArt Financial Services and Capital MarketsDataArt
 
About DataArt HR Partners
About DataArt HR PartnersAbout DataArt HR Partners
About DataArt HR PartnersDataArt
 
Event management в IT
Event management в ITEvent management в IT
Event management в ITDataArt
 
Digital Marketing from inside
Digital Marketing from insideDigital Marketing from inside
Digital Marketing from insideDataArt
 
What's new in Android, Igor Malytsky ( Google Post I|O Tour)
What's new in Android, Igor Malytsky ( Google Post I|O Tour)What's new in Android, Igor Malytsky ( Google Post I|O Tour)
What's new in Android, Igor Malytsky ( Google Post I|O Tour)DataArt
 
DevOps Workshop:Что бывает, когда DevOps приходит на проект
DevOps Workshop:Что бывает, когда DevOps приходит на проектDevOps Workshop:Что бывает, когда DevOps приходит на проект
DevOps Workshop:Что бывает, когда DevOps приходит на проектDataArt
 
IT Talk Kharkiv: «‎Soft skills в IT. Польза или вред? Максим Бастион, DataArt
IT Talk Kharkiv: «‎Soft skills в IT. Польза или вред? Максим Бастион, DataArtIT Talk Kharkiv: «‎Soft skills в IT. Польза или вред? Максим Бастион, DataArt
IT Talk Kharkiv: «‎Soft skills в IT. Польза или вред? Максим Бастион, DataArtDataArt
 
«Ноль копеек. Спастись от выгорания» — Сергей Чеботарев (Head of Design, Han...
 «Ноль копеек. Спастись от выгорания» — Сергей Чеботарев (Head of Design, Han... «Ноль копеек. Спастись от выгорания» — Сергей Чеботарев (Head of Design, Han...
«Ноль копеек. Спастись от выгорания» — Сергей Чеботарев (Head of Design, Han...DataArt
 
Communication in QA's life
Communication in QA's lifeCommunication in QA's life
Communication in QA's lifeDataArt
 
Нельзя просто так взять и договориться, или как мы работали со сложными людьми
Нельзя просто так взять и договориться, или как мы работали со сложными людьмиНельзя просто так взять и договориться, или как мы работали со сложными людьми
Нельзя просто так взять и договориться, или как мы работали со сложными людьмиDataArt
 
Знакомьтесь, DevOps
Знакомьтесь, DevOpsЗнакомьтесь, DevOps
Знакомьтесь, DevOpsDataArt
 
DevOps in real life
DevOps in real lifeDevOps in real life
DevOps in real lifeDataArt
 
Codeless: автоматизация тестирования
Codeless: автоматизация тестированияCodeless: автоматизация тестирования
Codeless: автоматизация тестированияDataArt
 
Selenoid
SelenoidSelenoid
SelenoidDataArt
 
Selenide
SelenideSelenide
SelenideDataArt
 
A. Sirota "Building an Automation Solution based on Appium"
A. Sirota "Building an Automation Solution based on Appium"A. Sirota "Building an Automation Solution based on Appium"
A. Sirota "Building an Automation Solution based on Appium"DataArt
 
Эмоциональный интеллект или как не сойти с ума в условиях сложного и динамичн...
Эмоциональный интеллект или как не сойти с ума в условиях сложного и динамичн...Эмоциональный интеллект или как не сойти с ума в условиях сложного и динамичн...
Эмоциональный интеллект или как не сойти с ума в условиях сложного и динамичн...DataArt
 
IT talk: Как я перестал бояться и полюбил TestNG
IT talk: Как я перестал бояться и полюбил TestNGIT talk: Как я перестал бояться и полюбил TestNG
IT talk: Как я перестал бояться и полюбил TestNGDataArt
 

Mehr von DataArt (20)

DataArt Custom Software Engineering with a Human Approach
DataArt Custom Software Engineering with a Human ApproachDataArt Custom Software Engineering with a Human Approach
DataArt Custom Software Engineering with a Human Approach
 
DataArt Healthcare & Life Sciences
DataArt Healthcare & Life SciencesDataArt Healthcare & Life Sciences
DataArt Healthcare & Life Sciences
 
DataArt Financial Services and Capital Markets
DataArt Financial Services and Capital MarketsDataArt Financial Services and Capital Markets
DataArt Financial Services and Capital Markets
 
About DataArt HR Partners
About DataArt HR PartnersAbout DataArt HR Partners
About DataArt HR Partners
 
Event management в IT
Event management в ITEvent management в IT
Event management в IT
 
Digital Marketing from inside
Digital Marketing from insideDigital Marketing from inside
Digital Marketing from inside
 
What's new in Android, Igor Malytsky ( Google Post I|O Tour)
What's new in Android, Igor Malytsky ( Google Post I|O Tour)What's new in Android, Igor Malytsky ( Google Post I|O Tour)
What's new in Android, Igor Malytsky ( Google Post I|O Tour)
 
DevOps Workshop:Что бывает, когда DevOps приходит на проект
DevOps Workshop:Что бывает, когда DevOps приходит на проектDevOps Workshop:Что бывает, когда DevOps приходит на проект
DevOps Workshop:Что бывает, когда DevOps приходит на проект
 
IT Talk Kharkiv: «‎Soft skills в IT. Польза или вред? Максим Бастион, DataArt
IT Talk Kharkiv: «‎Soft skills в IT. Польза или вред? Максим Бастион, DataArtIT Talk Kharkiv: «‎Soft skills в IT. Польза или вред? Максим Бастион, DataArt
IT Talk Kharkiv: «‎Soft skills в IT. Польза или вред? Максим Бастион, DataArt
 
«Ноль копеек. Спастись от выгорания» — Сергей Чеботарев (Head of Design, Han...
 «Ноль копеек. Спастись от выгорания» — Сергей Чеботарев (Head of Design, Han... «Ноль копеек. Спастись от выгорания» — Сергей Чеботарев (Head of Design, Han...
«Ноль копеек. Спастись от выгорания» — Сергей Чеботарев (Head of Design, Han...
 
Communication in QA's life
Communication in QA's lifeCommunication in QA's life
Communication in QA's life
 
Нельзя просто так взять и договориться, или как мы работали со сложными людьми
Нельзя просто так взять и договориться, или как мы работали со сложными людьмиНельзя просто так взять и договориться, или как мы работали со сложными людьми
Нельзя просто так взять и договориться, или как мы работали со сложными людьми
 
Знакомьтесь, DevOps
Знакомьтесь, DevOpsЗнакомьтесь, DevOps
Знакомьтесь, DevOps
 
DevOps in real life
DevOps in real lifeDevOps in real life
DevOps in real life
 
Codeless: автоматизация тестирования
Codeless: автоматизация тестированияCodeless: автоматизация тестирования
Codeless: автоматизация тестирования
 
Selenoid
SelenoidSelenoid
Selenoid
 
Selenide
SelenideSelenide
Selenide
 
A. Sirota "Building an Automation Solution based on Appium"
A. Sirota "Building an Automation Solution based on Appium"A. Sirota "Building an Automation Solution based on Appium"
A. Sirota "Building an Automation Solution based on Appium"
 
Эмоциональный интеллект или как не сойти с ума в условиях сложного и динамичн...
Эмоциональный интеллект или как не сойти с ума в условиях сложного и динамичн...Эмоциональный интеллект или как не сойти с ума в условиях сложного и динамичн...
Эмоциональный интеллект или как не сойти с ума в условиях сложного и динамичн...
 
IT talk: Как я перестал бояться и полюбил TestNG
IT talk: Как я перестал бояться и полюбил TestNGIT talk: Как я перестал бояться и полюбил TestNG
IT talk: Как я перестал бояться и полюбил TestNG
 

Kürzlich hochgeladen

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
 
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
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
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
 
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
 
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
 
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
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
[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
 
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
 
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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Kürzlich hochgeladen (20)

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
 
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
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 
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
 
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
 
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
 
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?
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
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...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
[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
 
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
 
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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»

  • 2. What is DeviceHive? DeviceHive is an Open Source Machine-to-Machine (M2M) framework. It contains a set of services and components that allow establishing a two-way communication with remote devices using cloud as a middleware. The devices can be anything connected: sensor networks, smart meters, security systems, telemetry, or smart home devices.
  • 3. What is inside? • JavaEE or .NET-based server • REST и Websocket APIs for devices and Clients • Data storage: Postgresql and NoSQL (MongoDB). • Device: Linux C/C++, .NET, .NET Micro Framework, Java, Python, MicroChip and AVR native C. • Client: Windows 8, iOS, Android, Windows Phone 7 and 8,.NET, HTML5/JavaScript.
  • 4. What is inside? REST, Websockets REST, Websockets REST, Websockets binary Client: something that manages DevicesDevice: almost everything.  Gateway: fake Device that quite smart to connect to DH and to manage other Devices. Future: merge everything to one entity.
  • 5. How does it work? Client Device commandsnotifications commands notifications
  • 6. Access control system: Networks Client DeviceNetwork 1n n n AccessKey: allows authenticated client to act on behalf of Device • Network list • Device list • IP/Domain • Actions Basic access control. User has access to Device if and only if he has access to network
  • 7. Access control system: AccessKeys AccessKey: more smart security system similar to MAC Privilege contains • Network list • Device list • IP/Domain • Actions Client PrivilegeAccessKey 11 n n
  • 8. Java server implementation • Java EE 7 platform: • JAX-RS 2.0 • Websocket API 1.0 • JPA 2.1 • EJB 3.2 • CDI 1.1 • PostgreSQL 9.x • Glassfish 4, 4.1 as reference JEE7 implementation • Wildfly 8, 8.1 was preliminary tested. There were some issues with websockets, but now the application works generally fine.
  • 9. Feedback • “We’d like to be able to deploy it to Tomcat” Existing code is built to .war application. • “Do I need JEE application server? Oh.” • “Deployment procedure is quite hard.”
  • 10. OK, let’s try to simplify it. Spring? • Again not so new technology stack, but quite rich. • Application can be deployed almost everywhere. Only servlet container is needed (Tomcat, Jetty,..) • Migration would not be so hard. • JAX-RS -> Spring MVC or using Jersey (no code migration in fact) • EJB -> Spring @Service + spring-tx • Bean Validation API -> the same, just configuration changes. • JPA -> no changes again • CDI -> Spring DI (CDI events may be an issue). • Spring Boot.
  • 11. Spring Boot. • Easy deployment There are many “default” configurations that could be applied automatically. • Standalone Spring-based applications • “fat” executable jar • archive with two directories: /lib with jars and /bin with unix shell and windows batch scripts. • .war packaging is still possible
  • 13. Gradle integration buildscript { dependencies { classpath("org.springframework.boot:spring-boot-gradle- plugin:1.2.2") } } apply plugin: 'spring-boot‘ Tasks: bootRepackage bootRun
  • 14. Sample application @RestController @EnableAutoConfiguration public class Sample { @RequestMapping("/") String home() { return "Hello World!"; } public static void main(String[] args) throws Exception { SpringApplication.run(Sample.class, args); } }
  • 15. Starter POMs • dependency descriptors, cover all required dependencies. • named spring-boot-starter-* Web applications: Use spring-boot-starter-web – attaches default servlet container and spring web dependencies. spring-boot-starter-tomcat (default one) spring-boot-starter-jetty spring-boot-starter-undertow • Versions • sprint-boot-starters parent pom • your own one.
  • 16. Customizing the application • Main configuration file: application.properties • Read from classpath or location can be overridden: java -jar myproject.jar --spring.config.location=... • Spring Profiles --spring.profiles.active=dev,qa,etc… application-{profile}.properties is used
  • 17. DataSources deployment • Embedded datasources: • embedded H2, HSQL and Derby databases • just specify spring-jdbc and add runtime DB dependency • useful for testing • Production datasource • add ‘spring-boot-starter-jdbc’ started pom • specify spring.datasource.* properties (url, user, pw, driver) • JNDI is also supported
  • 18. Databases initialization • JPA - spring.jpa.generate-ddl (good for testing only) • Spring JDBC Two files: schema.sql, data.sql or schema-${db}.sql and data-{db}.sql Again looks file for testing purposes only. • Embedded Database migration tools • Flyway SQL files in classpath:db/migration • Luqibase Looks fine for production deployments.
  • 19. Creating deployable .war file @SpringBootApplication public class Application extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(Application.class); } public static void main(String[] args) throws Exception { SpringApplication.run(Application.class, args); } } @SpringBootApplication == @Configuration @EnableAutoConfiguration @ComponentScan
  • 20. Servlet container customization and other features • Since container is embedded, it can be customized by the application • Basic options, e.g. server.port server.address server.sessionTimeout • Container-specific customizations: TomcatEmbeddedServletContainerFactory JettyEmbeddedServletContainerFactory UndertowEmbeddedServletContainerFactory
  • 21. Migration Still in progress… But we hope it will be done in nearby future. TODO: comparison, tests, final decision…