springone 2016 in a nutshell
TRANSCRIPT
SpringOne 2016in a nutshell
@JeroenResoort @jdriven_nlTim te Beek
How is Las Vegas?
How is Las Vegas?It’s Hot! 35 degrees Celsius…
How is Las Vegas?It’s Hot! 35 degrees Celsius… at 05:00 in the morning…
How is Las Vegas?It’s Hot! 35 degrees Celsius… at 05:00 in the morning…
45 degrees Celsius during daytime!
● 2000+ attendees● 184 speakers● Great speakers, great talks● 9 parallel tracks● Superb venue
TodayA variety of subjects
● Spring Boot 1.4● Spring Framework 5.0● PCF Dev● Microservices and DDD● The talent pool● Consumer driven contracts● Spring cloud Sleuth and Zipkin
What’s new in Spring boot 1.4Uses Spring Framework 4.3
Run Unit Tests with only a ‘slice’ of Spring easily
● @WebMvcTest, @DataJpaTest, @JsonTest● Only setup controller for specific test● Setup MockMvc automatically● Less boilerplate code
What’s new in Spring boot 1.4FailureAnalyzer
● Many common failures get easy to read failure messages● You can write your own analyzers
Spring REST Docs
● Combines hand-written documentation written with Asciidoctor and auto-generated snippets produced with Spring MVC Test
● Guarantees your documentation is in line with your API
What’s new in Spring boot 1.4See keynote session by Stephane Nicoll and Josh Long
https://www.youtube.com/watch?v=7U90Lfxatpk
Microservices and Domain Driven DesignMicroservices and DDD go hand in hand
DDD Aggregates are a useful concept when designing microservices
When communicating across contexts you use Events
Forget about ACID and XA transactions
Use event sourcing
Check the talk by Chris Richardson when it comes online!
Spring Framework 5.0Roadmap:
● 5.0 RC1: Dec 2016● 5.0 GA: Q1 2017
Upgrades: JDK8+, Servlets 3.1+, JMS 2.0+, JPA 2.1+, JUnit 5
JDK9 compatibility
Startup performance
Junit 5
Spring Framework 5.0HTTP/2
Lambda-oriented HTTP routing and processing
Reactive streams support Backpressure
Use Spring Reactor or RxJava
Why reactive?
Why reactive?
More on ReactiveDon’t miss the reactive workshop by Bas and Riccardo at JFall!
"Making the paradigm-shift to Reactive Programming with Spring 5 Web Reactive"
Pivotal:
“We Transform How The World Builds Software”
Keynote session: “Help Developers Do What They Love”by Onsi Fakhouri
Summarises quite nicely the main subjects of the conference
How to transform your business into a software business?
Organisation structure
Cultural change
Continuous delivery. Continuously experimenting and taking risk.
How to transform your business into a software business?
ComCast has made this journey, they are now doing 4000 deployments a day
PCF Dev Run a cloud foundry locally from your laptop
Easy to install: download file and execute
Some additional steps required to run offline
To update to a new version you will need to download and install again
PCF Dev Demo time
Using 100% of the talent poolDon’t ignore women and people of other ethnicity
A Tale of Two Ladies: On Generating Opportunity for Women in Tech - Cornelia Davis
Inclusion through Lending Privilege - Anjuan Simmons
Using 100% of the talent poolEducation
Perception
Unconscious bias
Consumer driven contractsInteresting way of defining contracts
See http://martinfowler.com/articles/consumerDrivenContracts.html
Consumer contracts express a subset of the system's business function capabilities in terms of the consumer's expectations of the provider contract.
Consumer driven contractsInteresting way of defining contracts
See http://martinfowler.com/articles/consumerDrivenContracts.html
Consumer contracts express a subset of the system's business function capabilities in terms of the consumer's expectations of the provider contract.
Spring Cloud Contract helps you with that
Spring Cloud ContractSee https://cloud.spring.io/spring-cloud-contract/
Spring Cloud Contract Verifier is a tool that enables Consumer Driven Contract (CDC) development of JVM-based applications. It is shipped with Contract Definition Language (DSL). Contract definitions are used to produce following resources:
● JSON stub definitions to be used by WireMock (HTTP Server Stub) when doing integration testing on the client code (client tests). Test code must still be written by hand, test data is produced by Spring Cloud Contract Verifier
● Acceptance tests (in JUnit or Spock) used to verify if server-side implementation of the API is compliant with the contract (server tests). Full test is generated by Spring Cloud Contract Verifier
Latency analysis and distributed tracing● Service architecture isn’t simple anymore
○ Multiple servers, instances, possible paths
● Troubleshooting becomes murder-mystery○ Is POST /things slow?
○ Where did this happen?
○ Which event was it?
○ Is it abnormal?
● Clues are scattered and hard to relate
Spring Cloud Sleuth - SpanSpan - individual operation, contains timestamped events and tags
Unique, generated id
Spring Cloud Sleuth - TraceTrace - end-to-end latency graph, composed of spans
Another unique, generated id
Spring Cloud Sleuth - Log correlationLogs get Mapped Diagnostic Context tags of span and trace IDs
Correlate requests across services with Logstash / Kibana
Send traces to Zipkin for latency visualization
Spring Cloud Sleuth - How to1. Add `spring-cloud-starter-sleuth` to classpath
2. Check instrumentationa. Out of the box: HTTP, Messaging, Feign, Zuul, Hystrics, @Async, Runnable/Callable
3. Send to Zipkin with `spring-cloud-starter-sleuth-zipkin`a. HTTP to localhost:9411 by default
4. Tweak sampling percentagea. 10% by default
Visualize traces with Zipkin
Zipkin - How toJust a jar, available from GitHub
Data stored in memory, cassandra, elasticsearch or mysql
Available as-a-service in PCF
Sleuth / Zipkin summary● Log correlation allows you to match logs for a given trace
● Distributed tracing allows you to quickly see latency issues in your system
● Zipkin is a great tool to visualize the latency graph and system dependencies
● Spring Cloud Sleuth integrates with Zipkin and grants you log correlation
What more?Spring cloud task and Spring cloud data flow (evolution of Spring Batch and Spring XD)
Google and Microsoft promoting their cloud platforms as cloud foundry compatible
Watch listYoutube channel from Pivotal contains keynotes sessions and some other talks:https://www.youtube.com/watch?v=xdw_9dADM-4&list=PLAdzTan_eSPQ1fuLSBhyB4eEZF7JQM0Mx
Recommended talks:
● Simplifying the Future - Adrian Cockcroft - https://www.youtube.com/watch?v=DGK6jjamzfY● A Tale of Two Ladies: On Generating Opportunity for Women in Tech - Cornelia Davis -
https://www.youtube.com/watch?v=2lFv3qknbqQ● Cloud Native Java - Josh Long - https://www.youtube.com/watch?v=5q8B6lYhFvE● Developing microservices with aggregates - Chris Richardson ● Consumer Driven Contracts and your microservice architecture - Marcin Grzejszczak● From Imperative To Reactive Web Apps - Rossen Stoyanchev● A lot more...
(hope they come online soon!)
“Open source is a positive-sum game”Sam Ramji, CEO at Cloud Foundry
SpringOne 2016in a nutshell
@JeroenResoort @jdriven_nlTim te Beek