JavaOne 2016 - Day 2

Another day in sunny California. Yesterday I had the pleasure of attending an IoT workshop with Oracle. I have done my share of cool stuff on Raspberry Pi computers, but they are so powerful these days you can pretty much do anything with them. This workshop gave me opportunity to play with Arduino-based WiFi microcontroller, which is whole another beast.

California

IoT With Arduino and Raspberry Pi

Architecture for this smaller kind of IoT is simple: The tiny Arduino device works as a sensor, or radiator. It will measure/react/inform, and converse with cloud-based backend to trade information. In this case, a Raspberry Pi was used in the middle, to handle encryption, and act as a local gateway. Also, asynchronous MQTT messaging was used to trade information from Arduino to Raspberry Pi, and then to cloud. Pretty cool stuff! And I can see some immediate usages for this, a battalion of WiFi-enabled cheap microcontrollers….

p.s. It seems as this might be useful for our office wars..

IoT Nerf Gun http://theappslab.com/2015/10/21/connect-all-the-things-an-iot-nerf-gun/

I think we have to break down one of the fully automatic ones at the office and play with it…

Java EE 8

So, there’s some new information in details of Java EE 8. Three features are proposed to be dropped: MVC, and JMS 2.1, and Management. I for one am not so sad to see MVC go. It feels like late, and redundant, and weak attempt. It worked nicely enough in Swing, but the world may not need another enterprise MVC framework at this stage.

Instead, some new items are finding their way in. Proposed additions for Java EE 8 are Health Checking, and Configuration. This brings immediately to my mind Spring Boot actuators, which have been pretty useful. It’s time to have service health checks as lightweight, automatic features as opposed to build-if-you-have-time kind of custom code.

As was mentioned, microservices work will begin with Java EE 8, and be more complete with Java EE 9, as well as more modularity (instead of just having web or full profiles). Work for Java EE 9 doesn’t start after Java EE 8 is completed: It starts immediately, and plan is to release it year after EE 8. We’ll see how that goes. Similar plan is to release Java 10 quite rapidly after the long awaited Java 9 release.

There’s some more echoes of upcoming Java EE 9 already: For example, simple, reactive, event API proposal with annotations like @EventListener, and interfaces EventPublisher, EventConsumers, etc

Microservices - and a text-based adventure game?

IBM has done some pretty cool stuff this year. They have created a text-based adventure game that can be used for learning and teaching microservices. Rationale was to have something completely unrelated to most existing business domains, so it would be easy to approach. There’s actually a competition going on for anyone who participates in the development of a new room - with certain conditions. You can play the text game at:

Game on! - the adventure game https://game-on.org/

Coding competition http://javaone2016.mybluemix.net/regroom/

game on!

JHipster goes Microservices

Earlier a colleague blogged here about JHipster - awesome standards-based code generation framework that can be used to quickly create domain objects and scaffolding - similar to many other frameworks/tools such as Grails and JBOSS Foundry.

It seems not JHipster is going Microservices, as well. There was a few sessions on it, with demonstrations of quick deploy to Heroku cloud in 5 minutes. They seem to have the right ingredients there, too, including Eureka server. And there’s updated documentation at:

JHipster Microservices https://jhipster.github.io/microservices-architecture/

So Juuso, look it up. ;)

Apache Spark and Netflix Hystrix

It seems that Apache Spark was also mentioned everywhere. It’s not anything new, but it hasn’t been on my radar before. It can do large-scale data processing, with several language choices. They are claiming up to 100x faster processing than Hadoop, for example. And as for languages, you can use Java, or Scala, or Python. Seems like an interesting platform to study later. Might also be interesting for our Data Science number crunchers. The things they do often benefit from performance and scalability, even more so than tailored software.

Another very interesting session I attended was about Netflix Hystrix, and more precisely, how to apply it for robustness, tracking and monotoring - not just as a circuit breaker. Some interesting tidbits were using Splunk with Hystrix and Hystrix agent, to be able to faster track issues, and then drill down to causes. Other interesting topics were multiple coding models for Hystrix, including synchronous, asynchronous, reactive, and NIO.

Core Software Principles

I attended a full session by Venkat Subramaniam, and as always, it was perfect mix of deep thoughts and entertainment. Many of the things are familiar, but Venkat reminds the reasons why. Why apply principles such as YAGNI, DRY, SRP, SLAP?

Well, here’s a direct quote:

“If you write a better quality code the future you will thank you”

There’s two ways of being lazy: The bad lazy does the minimum right now, is lazy with design, and just ends up writing a lot of code, and fixing bugs. The good lazy detect issues, resolves them as we go, and enjoys the long run results. Writing code is not hard. It’s very easy. Shaping software along several years is the real artform. I’ve been unfortunate enough to see several pieces of code written lazily, that have dropped for us to maintain and develop further. Nothing is ever beyond repairs, but sometimes it takes a lot of work and sweat to repair a mountain of code written ugly in a years time without applying the core principles.

I was feeling pretty bad about a project that I had seen with code clumps of 10 000 lines or more - but Venkat mentioned a project in Belgium with 40 000 lines of code for single method, and some very broken developers ;) Everybody knows that long methods and long code blocks are bad. Still everybody has experience in them. Who writes them??! ;)

The man and a mission

What’s next?

Here’s my schedule for Wednesday:

Microservices for Mortals [CON6467] Bert Ertman, Fellow, Luminis Wednesday, Sep 21, 8:30 a.m. - 9:30 a.m. | Parc 55 - Cyril Magnin II/III

Spock: Test Well and Prosper [CON3273] Kenneth Kousen, President, Kousen IT, Inc. Wednesday, Sep 21, 10:00 a.m. - 11:00 a.m. | Hilton - Plaza Room B

Let’s Get Lazy: Explore the Real Power of Streams [CON1058] Venkat Subramaniam, President, Agile Developer, Inc. Wednesday, Sep 21, 11:30 a.m. - 12:30 p.m. | Hilton - Continental Ballroom 4

Kubernetes for Java Developers [HOL5413] Edson Yanaga, Director of Developer Experience, Red Hat Rafael Benevides, Director of Developer Experience, Red Hat Wednesday, Sep 21, 12:30 p.m. - 2:30 p.m. | Hilton - Franciscan Room C/D

Decomposing a Java EE Monolith into WildFly Swarm Microservices [HOL4212] Kenneth Finnigan, Principal Software Engineer, Redhat Robert McWhirter, Programmer / Developer, Red Hat Wednesday, Sep 21, 3:00 p.m. - 5:00 p.m. | Hilton - Franciscan Room C/D

Architecting for Failures in Microservices: Patterns and Lessons Learned [CON1802] Bhakti Mehta, Senior Platform Engineer, Atlassian Wednesday, Sep 21, 3:00 p.m. - 4:00 p.m. | Parc 55 - Cyril Magnin I

And, of course, the Oracle Appreciation Event at 7.

MQTT Protocol http://mqtt.org/

Forbes: Ambitious changes to Java http://www.forbes.com/sites/oracle/2016/09/19/javaone-keynote-hints-at-ambitious-changes-in-next-version-of-java/

Hacker’s guide to session hijacking https://www.youtube.com/watch?v=GNmU5vwZua8

Apache Spark http://spark.apache.org/

Payara Micro microservices container http://www.payara.fish/payara_micro