SlideShare uma empresa Scribd logo
1 de 44
Baixar para ler offline
Using Grails to power
your Electric Car
Small Intro
● Marco Pas (1973)
› Education in Chemistry and then
moved to Transportation & Logistics
to finally IT.. what is next?
● Software Engineer
● Burgundian lifestyle
Wikipedia tells us :
'enjoyment of life, good food,and extravagant spectacle'
Agenda
● What the heck am I trying to solve!!
● How on earth did we solve it?
● What are our plans for the future?
Disclaimer....
Electric Cars vs Electric Vehicles
Convention Fueling != Electric Vehicle Charging
● EV Charging Challenges:
› Impossible to store & forward electricity
› Charge often (Limited Range)
› Time to charge (from minutes to hours)
› Compatibility (plugs, charging cables)
Not kidding... !!
Range Anxiety Reducer :)
Public EV Chargers in numbers
● 2011: EU 12.000
● 2020: EU 660.000
2011 2020
Denmark 280 5.000
Germany 1.900 150.000
Italy 1.300 125.000
Netherlands 1.700 32.000
United Kingdom 703 122.000
EV Chargers in the wild
Charging Process
Back OfficeValidation / Verification
● Is the card valid?
● Electricity pricing?
● How much can I charge?
● Who is the customer?
● Did you make a reservation?
● ….
Stakeholders involved in EV Charging
How to manage
all those
(different kind of)
Chargers?
Stakeholders?
Processes?
Requirements
● Implement a platform that enables EV Infra management:
› To monitor a Charge Point (CP) network
› Supports remote management
› Track charging sessions
● Including charge authorization &
transaction storage
› Multi-tenancy
› 3rd party integration using Web Services (SOAP / REST)
Schematic overview of a Charge Point
Open Charge Point Protocol (OCPP)
● Open protocol between charging stations and a managing central
system aka back office
› Asynchronous
› Based on SOAP (v1.2)
› Working group with support from all manufacturers!
Agenda
● What the heck am I trying to solve!!
● How on earth did we solve it?
● What are our plans for the future?
Release 1.0
!
! SOAP ~ Contract First with Grails was not that easy, so we moved to a pure JAVA/Spring OCPP application
Jackson JSON Mapper
public class JsonMapper extends ObjectMapper {
public JsonMapper() {
super();
/**
* De-Serialization options JSON -> OBJECT
*/
// - ignore unknown fields - otherwise the construction of the object will fail!
this.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
// - make it possible to also construct empty objects
this.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
/**
* Serialization options OBJECT -> JSON
*/
// properties with non-null values are to be included in the resulting JSON
this.setSerializationInclusion(JsonInclude.Include.NON_NULL);
}
}
Jackson JSON Mapper
● JSON → Object
● Object → JSON
resources.groovy
beans = {
// a preconfigured Jackson JSON mapper with defaults
jsonMapper(JsonMapper){}
}
def jsonContent = “{'name': 'John Doe'}”
Person person = jsonMapper.readValue(jsonContent, Person.class)
Person person = new Person(name: 'John Doe')
def jsonContent = jsonMapper.valueToTree(person)
Theming support
● Login-Logout & user configurable themes
● Using Spring Security Core Plugin
Config.groovy
// make sure we can act on security events
grails.plugins.springsecurity.useSecurityEventListener = true
// executed when a user succesfully authenticates into the application
grails.plugins.springsecurity.onInteractiveAuthenticationSuccessEvent = { e, appCtx →
// .. code intentionally emitted .. //
session.theme = “MyNameOfTheTheme”
}
page.gsp
<g:if test="${session?.theme == null}">
<% session.theme="${grailsApplication.config.default.theme}"%>
</g:if>
<r:require module="${session?.theme}"/>
<g:external uri="/css/themes/${session?.theme - "theme_"}/images/favicon.ico"/>
Chargepoint Overview
Pool Overview
Nokia Maps – Heat Map
Technical Debt
● Client was very happy but.... shame on us:
› Tightly coupled
› Poor test coverage
› Spring project & Grails project
› Adding functional value is just to much fun!
● But... ready for round 2..
› Thanks to Grails we could refactor with great ease and speed!
Release 2.0
● Guidelines:
› Focus on creating a modular platform
› Test Driven Development
› Use Grails for everything!!
› Minimize the use of plugins!!!
Grails CXF Plugin
● WSDL
› Contract First & Code First
● Wire Interceptors
› Logging, Security
● Support for versioning
@GrailsCxfEndpoint(address='/myCustomSoapService/v2/')
Annotated example
@GrailsCxfEndpoint(
address='/centralsystem/ocpp/v1/5',
wsdl = 'wsdl/ocpp_15_centralsystem.wsdl',
expose = EndpointType.JAX_WS_WSDL,
soap12 = true,
inInterceptors = ["logSoapInboundInterceptor", "setReplyToSOAPHeaderInInterceptor"],
outInterceptors = ["logSoapOutboundInterceptor"])
@WebService(
name = "CentralSystemService",
targetNamespace = "urn://Ocpp/Cs/2012/06/",
serviceName = "CentralSystemService",
portName = "CentralSystemServiceSoap12"
)
@GZIP
class CentralSystemOcpp15Service implements CentralSystemService {
// ... code intentionally omitted
// ... contains the methods that needs to be implemented due to the 'implements'
}
Demo
● Create a contract first webservice using Grails CXF plugin
› Source WSDL: CustomerService.wsdl
› Steps:
● Create grails project
● Install CXF plugin
● Use WSDL2JAVA to generate web service implementation
● Create Grails service that implements the web service interface
● Test using SOAPUI
AMQP - Advanced Message Queuing Protocol
● Asynchronous and synchronous message exchange
› Enables modular platform architecture
RabbitMQ – an AMQP implementation
● Grails RabbitMQ Plugin
› High-level abstraction for sending and receiving messages
› Fallback to Spring Template
class MessageReceiveService {
static rabbitQueue = 'helloQ'
void handleMessage(message) {
// handle message…
}
}
class MessageSendController {
def sendMessage = {
rabbitSend 'helloQ', 'Hello!'
}
}
RabbitMQ Synchronous
class MessageSendController {
def rabbitTemplate // use the Spring rabbitTemplate directly
def sendMessage = {
def response = rabbitTemplate.convertSendAndReceive 'helloQ', 'Hello World'
println response
}
}
class MessageReceiveService {
static rabbitQueue = [queues: 'helloQ', messageConverterBean: '']
void handleMessage(Message message) {
// determine the reply queue
def returnQueue = message.messageProperties.replyTo
// return the response to temporary return queue..
rabbitSend returnQueue, 'Hello there'
}
}
Demo
● Send and Consume a message via RabbitMQ
› Steps:
● Install RabbitMQ plugin
● Configure Grails app to use RabbitMQ
● Create code to publish and consume a message
Testing
● Functional & Unit Testing
› Build-Test-Data
› Spock
● Load & Performane Testing
› BadBoy / Apache JMeter
Some stuff we have used
● Grails Plugins
› Spring Security
› Export
› RabbitMQ
› CXF
› Fixture
› Spock
› Build-Test-Data
● Non-Plugins
› Twitter BootStrap
› Jackson JSON
Agenda
● What the heck am I trying to solve!!
● How on earth did we solve it?
● What are our plans for the future?
Release 3.0
● Additional protocol implementation in JSON
› Eliminating the verbosity of SOAP!
› To ([<MessageTypeId>, “<UniqueId>”, “<Action>”, {<Payload>}])
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:cp="urn://Ocpp/Cp/2012/06/" xmlns:cs="urn://Ocpp/Cs/2012/06/"
xmlns:imp="urn://iMOVE/Cp/2011/09/" xmlns:ims="urn://iMOVE/Cs/2011/09/">
<SOAP-ENV:Header>
<wsa5:MessageID>940</wsa5:MessageID>
<wsa5:From>
<wsa5:Address>http://127.0.0.1:1234</wsa5:Address>
</wsa5:From>
<wsa5:ReplyTo SOAP-ENV:mustUnderstand="true">
<wsa5:Address>http://127.0.0.1:1234</wsa5:Address>
</wsa5:ReplyTo>
<wsa5:To SOAP-ENV:mustUnderstand="true">http://www.starwarsrules.com/services/centralsystem/ocpp/v1/5</wsa5:To>
<wsa5:Action SOAP-ENV:mustUnderstand="true">/Heartbeat</wsa5:Action>
<cs:chargeBoxIdentity SOAP-ENV:mustUnderstand="true">CHARGER_001_1234</cs:chargeBoxIdentity>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<cs:heartbeatRequest />
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
[2, “19223201”, “HeartBeat”, {“”}]
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:cp="urn://Ocpp/Cp/2012/06/" xmlns:cs="urn://Ocpp/Cs/2012/06/"
xmlns:imp="urn://iMOVE/Cp/2011/09/" xmlns:ims="urn://iMOVE/Cs/2011/09/">
<SOAP-ENV:Header>
<wsa5:MessageID>940</wsa5:MessageID>
<wsa5:From>
<wsa5:Address>http://127.0.0.1:1234</wsa5:Address>
</wsa5:From>
<wsa5:ReplyTo SOAP-ENV:mustUnderstand="true">
<wsa5:Address>http://127.0.0.1:1234</wsa5:Address>
</wsa5:ReplyTo>
<wsa5:To SOAP-ENV:mustUnderstand="true">http://www.starwarsrules.com/services/centralsystem/ocpp/v1/5</wsa5:To>
<wsa5:Action SOAP-ENV:mustUnderstand="true">/Heartbeat</wsa5:Action>
<cs:chargeBoxIdentity SOAP-ENV:mustUnderstand="true">CHARGER_001_1234</cs:chargeBoxIdentity>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<cs:heartbeatRequest />
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Release 3.0
● Using WebSockets for full-duplex communication
WebSockets
● Defines an API establishing a "socket" connections between a
client and a server
› Providing full-duplex communication
channel over a single TCP
connection
› HTTP upgrade by
Protocol Negotiation
› Firewall friendly! (port 80)
› No reconnect handling or guaranteed
message delivery
WebSocket handshake
● Client Request
● Server Response
GET /mychat HTTP/1.1
Host: server.example.com
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: x3JJHMbDL1EzLkh9GBhXDw==
Sec-WebSocket-Protocol: chat
Sec-WebSocket-Version: 13
Origin: http://example.com
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: HSmrc0sMlYUkAGmm5OPpG2HaGWk=
Sec-WebSocket-Protocol: chat
WebSocket API Hooks
Vertx.io
● Asynchronous Application Development
› Polyglot, Simplicity, Scalability, Concurrency
› Distributed Event Bus
› WebSocket support
● Verticles
Server.groovy
vertx.createHttpServer().requestHandler { req ->
req.response.headers().put("Content-Type", "text/html; charset-UTF-8");
req.response.end("<html><body><h1>Hello from vert.x!</h1></body></html>");
}.listen(8080)
vertx run Server.groovy
vertx run Server.groovy -instances 4
Thank you!!
http://twitter.com/marcopas
marco.pas@ihomer.nl
http://www.linkedin.com/in/marcopas

Mais conteúdo relacionado

Mais procurados

Weaving Through the Mesh: Making Sense of Istio and Overlapping Technologies
Weaving Through the Mesh: Making Sense of Istio and Overlapping TechnologiesWeaving Through the Mesh: Making Sense of Istio and Overlapping Technologies
Weaving Through the Mesh: Making Sense of Istio and Overlapping TechnologiesVMware Tanzu
 
Java 9 - Part1: New Features (Not Jigsaw Modules)
Java 9 - Part1: New Features (Not Jigsaw Modules)Java 9 - Part1: New Features (Not Jigsaw Modules)
Java 9 - Part1: New Features (Not Jigsaw Modules)Simone Bordet
 
Gluecon 2014 - Bringing Node.js to the JVM
Gluecon 2014 - Bringing Node.js to the JVMGluecon 2014 - Bringing Node.js to the JVM
Gluecon 2014 - Bringing Node.js to the JVMJeremy Whitlock
 
UA Mobile 2012 (English)
UA Mobile 2012 (English)UA Mobile 2012 (English)
UA Mobile 2012 (English)dmalykhanov
 
Continuous Integration for front-end JavaScript
Continuous Integration for front-end JavaScriptContinuous Integration for front-end JavaScript
Continuous Integration for front-end JavaScriptLars Thorup
 
Simple tweaks to get the most out of your jvm
Simple tweaks to get the most out of your jvmSimple tweaks to get the most out of your jvm
Simple tweaks to get the most out of your jvmJamie Coleman
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.jsDinesh U
 
Hiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret SauceHiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret SauceJesse Vincent
 
Lucio Grenzi - Building serverless applications on the Apache OpenWhisk platf...
Lucio Grenzi - Building serverless applications on the Apache OpenWhisk platf...Lucio Grenzi - Building serverless applications on the Apache OpenWhisk platf...
Lucio Grenzi - Building serverless applications on the Apache OpenWhisk platf...Codemotion
 
Building a serverless company on AWS lambda and Serverless framework
Building a serverless company on AWS lambda and Serverless frameworkBuilding a serverless company on AWS lambda and Serverless framework
Building a serverless company on AWS lambda and Serverless frameworkLuciano Mammino
 
Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?Dinh Pham
 
Exploring Kotlin language basics for Android App development
Exploring Kotlin language basics for Android App developmentExploring Kotlin language basics for Android App development
Exploring Kotlin language basics for Android App developmentJayaprakash R
 
Smart Gamma - Real-Time Web applications with PHP and Websocket.
Smart Gamma - Real-Time Web applications with PHP and Websocket.Smart Gamma - Real-Time Web applications with PHP and Websocket.
Smart Gamma - Real-Time Web applications with PHP and Websocket.Evgeniy Kuzmin
 
NodeJS: the good parts? A skeptic’s view (devnexus2014)
NodeJS: the good parts? A skeptic’s view (devnexus2014)NodeJS: the good parts? A skeptic’s view (devnexus2014)
NodeJS: the good parts? A skeptic’s view (devnexus2014)Chris Richardson
 
Qt for beginners part 4 doing more
Qt for beginners part 4   doing moreQt for beginners part 4   doing more
Qt for beginners part 4 doing moreICS
 
Fundamental of Node.JS - Internship Presentation - Week7
Fundamental of Node.JS - Internship Presentation - Week7Fundamental of Node.JS - Internship Presentation - Week7
Fundamental of Node.JS - Internship Presentation - Week7Devang Garach
 
Node.js: A Guided Tour
Node.js: A Guided TourNode.js: A Guided Tour
Node.js: A Guided Tourcacois
 

Mais procurados (20)

Weaving Through the Mesh: Making Sense of Istio and Overlapping Technologies
Weaving Through the Mesh: Making Sense of Istio and Overlapping TechnologiesWeaving Through the Mesh: Making Sense of Istio and Overlapping Technologies
Weaving Through the Mesh: Making Sense of Istio and Overlapping Technologies
 
Java 9 - Part1: New Features (Not Jigsaw Modules)
Java 9 - Part1: New Features (Not Jigsaw Modules)Java 9 - Part1: New Features (Not Jigsaw Modules)
Java 9 - Part1: New Features (Not Jigsaw Modules)
 
Gluecon 2014 - Bringing Node.js to the JVM
Gluecon 2014 - Bringing Node.js to the JVMGluecon 2014 - Bringing Node.js to the JVM
Gluecon 2014 - Bringing Node.js to the JVM
 
JCatapult
JCatapultJCatapult
JCatapult
 
UA Mobile 2012 (English)
UA Mobile 2012 (English)UA Mobile 2012 (English)
UA Mobile 2012 (English)
 
Continuous Integration for front-end JavaScript
Continuous Integration for front-end JavaScriptContinuous Integration for front-end JavaScript
Continuous Integration for front-end JavaScript
 
Simple tweaks to get the most out of your jvm
Simple tweaks to get the most out of your jvmSimple tweaks to get the most out of your jvm
Simple tweaks to get the most out of your jvm
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 
Hiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret SauceHiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret Sauce
 
Lucio Grenzi - Building serverless applications on the Apache OpenWhisk platf...
Lucio Grenzi - Building serverless applications on the Apache OpenWhisk platf...Lucio Grenzi - Building serverless applications on the Apache OpenWhisk platf...
Lucio Grenzi - Building serverless applications on the Apache OpenWhisk platf...
 
Building a serverless company on AWS lambda and Serverless framework
Building a serverless company on AWS lambda and Serverless frameworkBuilding a serverless company on AWS lambda and Serverless framework
Building a serverless company on AWS lambda and Serverless framework
 
Developing Async Sense
Developing Async SenseDeveloping Async Sense
Developing Async Sense
 
Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?
 
Exploring Kotlin language basics for Android App development
Exploring Kotlin language basics for Android App developmentExploring Kotlin language basics for Android App development
Exploring Kotlin language basics for Android App development
 
Smart Gamma - Real-Time Web applications with PHP and Websocket.
Smart Gamma - Real-Time Web applications with PHP and Websocket.Smart Gamma - Real-Time Web applications with PHP and Websocket.
Smart Gamma - Real-Time Web applications with PHP and Websocket.
 
NodeJS: the good parts? A skeptic’s view (devnexus2014)
NodeJS: the good parts? A skeptic’s view (devnexus2014)NodeJS: the good parts? A skeptic’s view (devnexus2014)
NodeJS: the good parts? A skeptic’s view (devnexus2014)
 
Qt for beginners part 4 doing more
Qt for beginners part 4   doing moreQt for beginners part 4   doing more
Qt for beginners part 4 doing more
 
Fundamental of Node.JS - Internship Presentation - Week7
Fundamental of Node.JS - Internship Presentation - Week7Fundamental of Node.JS - Internship Presentation - Week7
Fundamental of Node.JS - Internship Presentation - Week7
 
JVM Internals (2015)
JVM Internals (2015)JVM Internals (2015)
JVM Internals (2015)
 
Node.js: A Guided Tour
Node.js: A Guided TourNode.js: A Guided Tour
Node.js: A Guided Tour
 

Destaque

Contributing to Grails
Contributing to GrailsContributing to Grails
Contributing to GrailsGR8Conf
 
Scraping with Geb
Scraping with GebScraping with Geb
Scraping with GebGR8Conf
 
Using Grails to power your electric car
Using Grails to power your electric carUsing Grails to power your electric car
Using Grails to power your electric carMarco Pas
 
Metaprogramming with Groovy
Metaprogramming with GroovyMetaprogramming with Groovy
Metaprogramming with GroovyGR8Conf
 
Mum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerMum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerGR8Conf
 
Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle GR8Conf
 

Destaque (6)

Contributing to Grails
Contributing to GrailsContributing to Grails
Contributing to Grails
 
Scraping with Geb
Scraping with GebScraping with Geb
Scraping with Geb
 
Using Grails to power your electric car
Using Grails to power your electric carUsing Grails to power your electric car
Using Grails to power your electric car
 
Metaprogramming with Groovy
Metaprogramming with GroovyMetaprogramming with Groovy
Metaprogramming with Groovy
 
Mum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerMum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developer
 
Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle
 

Semelhante a Using Grails to power your Electric Car Charging Platform

Micronaut: A new way to build microservices
Micronaut: A new way to build microservicesMicronaut: A new way to build microservices
Micronaut: A new way to build microservicesLuram Archanjo
 
Intro to node.js - Ran Mizrahi (27/8/2014)
Intro to node.js - Ran Mizrahi (27/8/2014)Intro to node.js - Ran Mizrahi (27/8/2014)
Intro to node.js - Ran Mizrahi (27/8/2014)Ran Mizrahi
 
Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)Ran Mizrahi
 
Deep dive into Android async operations
Deep dive into Android async operationsDeep dive into Android async operations
Deep dive into Android async operationsMateusz Grzechociński
 
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...GITS Indonesia
 
node.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoonnode.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang YoonJesang Yoon
 
Java gpu computing
Java gpu computingJava gpu computing
Java gpu computingArjan Lamers
 
Testing and validating spark programs - Strata SJ 2016
Testing and validating spark programs - Strata SJ 2016Testing and validating spark programs - Strata SJ 2016
Testing and validating spark programs - Strata SJ 2016Holden Karau
 
Profiling & Testing with Spark
Profiling & Testing with SparkProfiling & Testing with Spark
Profiling & Testing with SparkRoger Rafanell Mas
 
PyCon 2016: Personalised emails with Spark and Python
PyCon 2016:  Personalised emails  with Spark and PythonPyCon 2016:  Personalised emails  with Spark and Python
PyCon 2016: Personalised emails with Spark and PythonTomas Sirny
 
Ob1k presentation at Java.IL
Ob1k presentation at Java.ILOb1k presentation at Java.IL
Ob1k presentation at Java.ILEran Harel
 
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDBMongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDBMongoDB
 
Testing OSGi the "groovy" way - Lars Pfannenschmidt, Dennis Nobel
Testing OSGi the "groovy" way - Lars Pfannenschmidt, Dennis NobelTesting OSGi the "groovy" way - Lars Pfannenschmidt, Dennis Nobel
Testing OSGi the "groovy" way - Lars Pfannenschmidt, Dennis Nobelmfrancis
 
React Native in Production
React Native in ProductionReact Native in Production
React Native in ProductionSeokjun Kim
 

Semelhante a Using Grails to power your Electric Car Charging Platform (20)

Micronaut: A new way to build microservices
Micronaut: A new way to build microservicesMicronaut: A new way to build microservices
Micronaut: A new way to build microservices
 
Intro to node.js - Ran Mizrahi (27/8/2014)
Intro to node.js - Ran Mizrahi (27/8/2014)Intro to node.js - Ran Mizrahi (27/8/2014)
Intro to node.js - Ran Mizrahi (27/8/2014)
 
Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)
 
Deep dive into Android async operations
Deep dive into Android async operationsDeep dive into Android async operations
Deep dive into Android async operations
 
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...
 
node.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoonnode.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoon
 
Java 9-coding-from-zero-level-v1.0
Java 9-coding-from-zero-level-v1.0Java 9-coding-from-zero-level-v1.0
Java 9-coding-from-zero-level-v1.0
 
Java gpu computing
Java gpu computingJava gpu computing
Java gpu computing
 
Testing and validating spark programs - Strata SJ 2016
Testing and validating spark programs - Strata SJ 2016Testing and validating spark programs - Strata SJ 2016
Testing and validating spark programs - Strata SJ 2016
 
Profiling & Testing with Spark
Profiling & Testing with SparkProfiling & Testing with Spark
Profiling & Testing with Spark
 
PyCon 2016: Personalised emails with Spark and Python
PyCon 2016:  Personalised emails  with Spark and PythonPyCon 2016:  Personalised emails  with Spark and Python
PyCon 2016: Personalised emails with Spark and Python
 
Ob1k presentation at Java.IL
Ob1k presentation at Java.ILOb1k presentation at Java.IL
Ob1k presentation at Java.IL
 
Node azure
Node azureNode azure
Node azure
 
JS Class 2016
JS Class 2016JS Class 2016
JS Class 2016
 
JS class slides (2016)
JS class slides (2016)JS class slides (2016)
JS class slides (2016)
 
Retour JavaOne 2009
Retour JavaOne 2009Retour JavaOne 2009
Retour JavaOne 2009
 
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDBMongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
 
Testing OSGi the "groovy" way - Lars Pfannenschmidt, Dennis Nobel
Testing OSGi the "groovy" way - Lars Pfannenschmidt, Dennis NobelTesting OSGi the "groovy" way - Lars Pfannenschmidt, Dennis Nobel
Testing OSGi the "groovy" way - Lars Pfannenschmidt, Dennis Nobel
 
React Native in Production
React Native in ProductionReact Native in Production
React Native in Production
 
Spock pres
Spock presSpock pres
Spock pres
 

Mais de GR8Conf

DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your TeamGR8Conf
 
How to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and AndroidHow to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and AndroidGR8Conf
 
Ratpack On the Docks
Ratpack On the DocksRatpack On the Docks
Ratpack On the DocksGR8Conf
 
Groovy Powered Clean Code
Groovy Powered Clean CodeGroovy Powered Clean Code
Groovy Powered Clean CodeGR8Conf
 
Cut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature pluginsCut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature pluginsGR8Conf
 
Performance tuning Grails applications
 Performance tuning Grails applications Performance tuning Grails applications
Performance tuning Grails applicationsGR8Conf
 
Ratpack and Grails 3
 Ratpack and Grails 3 Ratpack and Grails 3
Ratpack and Grails 3GR8Conf
 
Grails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloudGrails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloudGR8Conf
 
Functional testing your Grails app with GEB
Functional testing your Grails app with GEBFunctional testing your Grails app with GEB
Functional testing your Grails app with GEBGR8Conf
 
Deploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCDeploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCGR8Conf
 
The Grails introduction workshop
The Grails introduction workshopThe Grails introduction workshop
The Grails introduction workshopGR8Conf
 
Idiomatic spock
Idiomatic spockIdiomatic spock
Idiomatic spockGR8Conf
 
The Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedThe Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedGR8Conf
 
Groovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examplesGroovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examplesGR8Conf
 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and GroovyGR8Conf
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineGR8Conf
 
Grooscript gr8conf
Grooscript gr8confGrooscript gr8conf
Grooscript gr8confGR8Conf
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineGR8Conf
 
Jan reher may 2013
Jan reher may 2013Jan reher may 2013
Jan reher may 2013GR8Conf
 
Good Form - complex web forms made Groovy
Good Form - complex web forms made GroovyGood Form - complex web forms made Groovy
Good Form - complex web forms made GroovyGR8Conf
 

Mais de GR8Conf (20)

DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your Team
 
How to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and AndroidHow to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and Android
 
Ratpack On the Docks
Ratpack On the DocksRatpack On the Docks
Ratpack On the Docks
 
Groovy Powered Clean Code
Groovy Powered Clean CodeGroovy Powered Clean Code
Groovy Powered Clean Code
 
Cut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature pluginsCut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature plugins
 
Performance tuning Grails applications
 Performance tuning Grails applications Performance tuning Grails applications
Performance tuning Grails applications
 
Ratpack and Grails 3
 Ratpack and Grails 3 Ratpack and Grails 3
Ratpack and Grails 3
 
Grails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloudGrails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloud
 
Functional testing your Grails app with GEB
Functional testing your Grails app with GEBFunctional testing your Grails app with GEB
Functional testing your Grails app with GEB
 
Deploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCDeploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPC
 
The Grails introduction workshop
The Grails introduction workshopThe Grails introduction workshop
The Grails introduction workshop
 
Idiomatic spock
Idiomatic spockIdiomatic spock
Idiomatic spock
 
The Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedThe Groovy Ecosystem Revisited
The Groovy Ecosystem Revisited
 
Groovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examplesGroovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examples
 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and Groovy
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual Machine
 
Grooscript gr8conf
Grooscript gr8confGrooscript gr8conf
Grooscript gr8conf
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual Machine
 
Jan reher may 2013
Jan reher may 2013Jan reher may 2013
Jan reher may 2013
 
Good Form - complex web forms made Groovy
Good Form - complex web forms made GroovyGood Form - complex web forms made Groovy
Good Form - complex web forms made Groovy
 

Último

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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
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
 
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
 

Último (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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)
 
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
 

Using Grails to power your Electric Car Charging Platform

  • 1. Using Grails to power your Electric Car
  • 2. Small Intro ● Marco Pas (1973) › Education in Chemistry and then moved to Transportation & Logistics to finally IT.. what is next? ● Software Engineer ● Burgundian lifestyle Wikipedia tells us : 'enjoyment of life, good food,and extravagant spectacle'
  • 3. Agenda ● What the heck am I trying to solve!! ● How on earth did we solve it? ● What are our plans for the future?
  • 5. Electric Cars vs Electric Vehicles
  • 6. Convention Fueling != Electric Vehicle Charging ● EV Charging Challenges: › Impossible to store & forward electricity › Charge often (Limited Range) › Time to charge (from minutes to hours) › Compatibility (plugs, charging cables)
  • 7. Not kidding... !! Range Anxiety Reducer :)
  • 8. Public EV Chargers in numbers ● 2011: EU 12.000 ● 2020: EU 660.000 2011 2020 Denmark 280 5.000 Germany 1.900 150.000 Italy 1.300 125.000 Netherlands 1.700 32.000 United Kingdom 703 122.000
  • 9. EV Chargers in the wild
  • 10. Charging Process Back OfficeValidation / Verification ● Is the card valid? ● Electricity pricing? ● How much can I charge? ● Who is the customer? ● Did you make a reservation? ● ….
  • 12. How to manage all those (different kind of) Chargers? Stakeholders? Processes?
  • 13. Requirements ● Implement a platform that enables EV Infra management: › To monitor a Charge Point (CP) network › Supports remote management › Track charging sessions ● Including charge authorization & transaction storage › Multi-tenancy › 3rd party integration using Web Services (SOAP / REST)
  • 14.
  • 15. Schematic overview of a Charge Point
  • 16. Open Charge Point Protocol (OCPP) ● Open protocol between charging stations and a managing central system aka back office › Asynchronous › Based on SOAP (v1.2) › Working group with support from all manufacturers!
  • 17. Agenda ● What the heck am I trying to solve!! ● How on earth did we solve it? ● What are our plans for the future?
  • 18. Release 1.0 ! ! SOAP ~ Contract First with Grails was not that easy, so we moved to a pure JAVA/Spring OCPP application
  • 19. Jackson JSON Mapper public class JsonMapper extends ObjectMapper { public JsonMapper() { super(); /** * De-Serialization options JSON -> OBJECT */ // - ignore unknown fields - otherwise the construction of the object will fail! this.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); // - make it possible to also construct empty objects this.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); /** * Serialization options OBJECT -> JSON */ // properties with non-null values are to be included in the resulting JSON this.setSerializationInclusion(JsonInclude.Include.NON_NULL); } }
  • 20. Jackson JSON Mapper ● JSON → Object ● Object → JSON resources.groovy beans = { // a preconfigured Jackson JSON mapper with defaults jsonMapper(JsonMapper){} } def jsonContent = “{'name': 'John Doe'}” Person person = jsonMapper.readValue(jsonContent, Person.class) Person person = new Person(name: 'John Doe') def jsonContent = jsonMapper.valueToTree(person)
  • 21. Theming support ● Login-Logout & user configurable themes ● Using Spring Security Core Plugin Config.groovy // make sure we can act on security events grails.plugins.springsecurity.useSecurityEventListener = true // executed when a user succesfully authenticates into the application grails.plugins.springsecurity.onInteractiveAuthenticationSuccessEvent = { e, appCtx → // .. code intentionally emitted .. // session.theme = “MyNameOfTheTheme” } page.gsp <g:if test="${session?.theme == null}"> <% session.theme="${grailsApplication.config.default.theme}"%> </g:if> <r:require module="${session?.theme}"/> <g:external uri="/css/themes/${session?.theme - "theme_"}/images/favicon.ico"/>
  • 24. Nokia Maps – Heat Map
  • 25. Technical Debt ● Client was very happy but.... shame on us: › Tightly coupled › Poor test coverage › Spring project & Grails project › Adding functional value is just to much fun! ● But... ready for round 2.. › Thanks to Grails we could refactor with great ease and speed!
  • 26. Release 2.0 ● Guidelines: › Focus on creating a modular platform › Test Driven Development › Use Grails for everything!! › Minimize the use of plugins!!!
  • 27. Grails CXF Plugin ● WSDL › Contract First & Code First ● Wire Interceptors › Logging, Security ● Support for versioning @GrailsCxfEndpoint(address='/myCustomSoapService/v2/')
  • 28. Annotated example @GrailsCxfEndpoint( address='/centralsystem/ocpp/v1/5', wsdl = 'wsdl/ocpp_15_centralsystem.wsdl', expose = EndpointType.JAX_WS_WSDL, soap12 = true, inInterceptors = ["logSoapInboundInterceptor", "setReplyToSOAPHeaderInInterceptor"], outInterceptors = ["logSoapOutboundInterceptor"]) @WebService( name = "CentralSystemService", targetNamespace = "urn://Ocpp/Cs/2012/06/", serviceName = "CentralSystemService", portName = "CentralSystemServiceSoap12" ) @GZIP class CentralSystemOcpp15Service implements CentralSystemService { // ... code intentionally omitted // ... contains the methods that needs to be implemented due to the 'implements' }
  • 29. Demo ● Create a contract first webservice using Grails CXF plugin › Source WSDL: CustomerService.wsdl › Steps: ● Create grails project ● Install CXF plugin ● Use WSDL2JAVA to generate web service implementation ● Create Grails service that implements the web service interface ● Test using SOAPUI
  • 30. AMQP - Advanced Message Queuing Protocol ● Asynchronous and synchronous message exchange › Enables modular platform architecture
  • 31. RabbitMQ – an AMQP implementation ● Grails RabbitMQ Plugin › High-level abstraction for sending and receiving messages › Fallback to Spring Template class MessageReceiveService { static rabbitQueue = 'helloQ' void handleMessage(message) { // handle message… } } class MessageSendController { def sendMessage = { rabbitSend 'helloQ', 'Hello!' } }
  • 32. RabbitMQ Synchronous class MessageSendController { def rabbitTemplate // use the Spring rabbitTemplate directly def sendMessage = { def response = rabbitTemplate.convertSendAndReceive 'helloQ', 'Hello World' println response } } class MessageReceiveService { static rabbitQueue = [queues: 'helloQ', messageConverterBean: ''] void handleMessage(Message message) { // determine the reply queue def returnQueue = message.messageProperties.replyTo // return the response to temporary return queue.. rabbitSend returnQueue, 'Hello there' } }
  • 33. Demo ● Send and Consume a message via RabbitMQ › Steps: ● Install RabbitMQ plugin ● Configure Grails app to use RabbitMQ ● Create code to publish and consume a message
  • 34.
  • 35. Testing ● Functional & Unit Testing › Build-Test-Data › Spock ● Load & Performane Testing › BadBoy / Apache JMeter
  • 36. Some stuff we have used ● Grails Plugins › Spring Security › Export › RabbitMQ › CXF › Fixture › Spock › Build-Test-Data ● Non-Plugins › Twitter BootStrap › Jackson JSON
  • 37. Agenda ● What the heck am I trying to solve!! ● How on earth did we solve it? ● What are our plans for the future?
  • 38. Release 3.0 ● Additional protocol implementation in JSON › Eliminating the verbosity of SOAP! › To ([<MessageTypeId>, “<UniqueId>”, “<Action>”, {<Payload>}]) <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:cp="urn://Ocpp/Cp/2012/06/" xmlns:cs="urn://Ocpp/Cs/2012/06/" xmlns:imp="urn://iMOVE/Cp/2011/09/" xmlns:ims="urn://iMOVE/Cs/2011/09/"> <SOAP-ENV:Header> <wsa5:MessageID>940</wsa5:MessageID> <wsa5:From> <wsa5:Address>http://127.0.0.1:1234</wsa5:Address> </wsa5:From> <wsa5:ReplyTo SOAP-ENV:mustUnderstand="true"> <wsa5:Address>http://127.0.0.1:1234</wsa5:Address> </wsa5:ReplyTo> <wsa5:To SOAP-ENV:mustUnderstand="true">http://www.starwarsrules.com/services/centralsystem/ocpp/v1/5</wsa5:To> <wsa5:Action SOAP-ENV:mustUnderstand="true">/Heartbeat</wsa5:Action> <cs:chargeBoxIdentity SOAP-ENV:mustUnderstand="true">CHARGER_001_1234</cs:chargeBoxIdentity> </SOAP-ENV:Header> <SOAP-ENV:Body> <cs:heartbeatRequest /> </SOAP-ENV:Body> </SOAP-ENV:Envelope> [2, “19223201”, “HeartBeat”, {“”}] <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:cp="urn://Ocpp/Cp/2012/06/" xmlns:cs="urn://Ocpp/Cs/2012/06/" xmlns:imp="urn://iMOVE/Cp/2011/09/" xmlns:ims="urn://iMOVE/Cs/2011/09/"> <SOAP-ENV:Header> <wsa5:MessageID>940</wsa5:MessageID> <wsa5:From> <wsa5:Address>http://127.0.0.1:1234</wsa5:Address> </wsa5:From> <wsa5:ReplyTo SOAP-ENV:mustUnderstand="true"> <wsa5:Address>http://127.0.0.1:1234</wsa5:Address> </wsa5:ReplyTo> <wsa5:To SOAP-ENV:mustUnderstand="true">http://www.starwarsrules.com/services/centralsystem/ocpp/v1/5</wsa5:To> <wsa5:Action SOAP-ENV:mustUnderstand="true">/Heartbeat</wsa5:Action> <cs:chargeBoxIdentity SOAP-ENV:mustUnderstand="true">CHARGER_001_1234</cs:chargeBoxIdentity> </SOAP-ENV:Header> <SOAP-ENV:Body> <cs:heartbeatRequest /> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
  • 39. Release 3.0 ● Using WebSockets for full-duplex communication
  • 40. WebSockets ● Defines an API establishing a "socket" connections between a client and a server › Providing full-duplex communication channel over a single TCP connection › HTTP upgrade by Protocol Negotiation › Firewall friendly! (port 80) › No reconnect handling or guaranteed message delivery
  • 41. WebSocket handshake ● Client Request ● Server Response GET /mychat HTTP/1.1 Host: server.example.com Upgrade: websocket Connection: Upgrade Sec-WebSocket-Key: x3JJHMbDL1EzLkh9GBhXDw== Sec-WebSocket-Protocol: chat Sec-WebSocket-Version: 13 Origin: http://example.com HTTP/1.1 101 Switching Protocols Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: HSmrc0sMlYUkAGmm5OPpG2HaGWk= Sec-WebSocket-Protocol: chat
  • 43. Vertx.io ● Asynchronous Application Development › Polyglot, Simplicity, Scalability, Concurrency › Distributed Event Bus › WebSocket support ● Verticles Server.groovy vertx.createHttpServer().requestHandler { req -> req.response.headers().put("Content-Type", "text/html; charset-UTF-8"); req.response.end("<html><body><h1>Hello from vert.x!</h1></body></html>"); }.listen(8080) vertx run Server.groovy vertx run Server.groovy -instances 4