Categories
Development

Graal basics

I spent last year designing and implementing javascript scripting support in our Java/Spring backend with the help of GraalVM and its polyglot support. I fell in love with Graal, as it brings quite a lot of features and performance improvements to Java JVM. Will focus on basics of Graal Polyglot capabilities in this article.

I’m not going to write about what is Graal, others have done this better:

https://www.graalvm.org/why-graalvm/
https://www.graalvm.org/reference-manual/embed-languages/

Nice article to read is also Top 10 Things To Do With GraalVM.

Make sure you follow their twitter and blog:
https://twitter.com/graalvm
https://medium.com/graalvm

And its a good idea to join public Graal slack group as the devs and community is quite active and eager to respond.

https://join.slack.com/t/graalvm/shared_invite/zt-anuczas6-PrCle0QVfUFPrnMEcp_JEw

From my experience you will need to ask for some advanced/hidden features as they are not described in docs or scattered between several sources. Advanced topics are described here:

https://github.com/oracle/graaljs/tree/master/docs/user

One of the killer features of Graal is its polyglot support. The most mature one is the Javascript scripting engine. And as opposed to previous javascript java implementation, its fully ECMAScript compliant so you have the whole JS library ecosystem at your disposal.

Categories
Personal

Back again

Neglected my site for quite a while. Will try to do better :). Started by cleaning up about me page and old posts. It seems that all photos dissapeared during site migration last year. Never really noticed.

I do have some backlog of article ideas that I want to write about, mostly about GraalVM polyglot and RSocket.

Categories
Development

Do until loop in Spring reactor

Reactor 3.1.0 added a brand new and shiny operator expand, which solved by long term dilemma about how to implement downloading of paginated REST endpoints without recursion.

Categories
Development

Pagination with Github, Reactor and Spring Webclient

I wanted to go beyond the basic example of extracting a single rest result from github rest API which is shown everywhere these days. So here it is, a simple base for Reactor API for Github. It showcases basic functionality of flatMap, recursive calls, custom subscribtion rate limiter implementation.

Categories
Development

Spring Reactor common mistakes

I recently gotten fond of Spring Reactor, reactive java library used by Spring 5.0. There is a lot of resources out there which describe it, so I’m not going to repeat the internet here. But in short it makes any asynchronous development a LOT easier and I dare to say its the first library which makes it almost trivial. There is a catch, learning curve is steep. And when I mean steep I mean it took me at least half a year (senior java dev) to wrap my head around it. Me and my colleagues made some stupid mistakes so here are 4 so far, will add more in the future.

Categories
Development

Google analytics report parsing in Java 8

Google has deprecated Google Analytics API v3 in favor of its new reporting API (V4). New API is quite universal and easy to use and its java library gets the job done well with one exception: mapping result to Java types. It returns everything in strings and you have to parse the Reports yourself and map the values to your object. I recently had to load quite a lot of daily statistics from google analytics so I wrote a simple class which does this dirty work for me.

Categories
Development

NullPointerException thrown from out of nowhere

Today I spent 30 minutes debugging a code which was throwing a null pointer exception. I never seen it before so I ruled out the obvious suspects and checked during several debugging runs what is and what actually is not null. It was not my code and it looked a bit shady, but everything seemed fine in debugger and more importantly, nothing seemed to be null.

Categories
Travel

Corsica GR20 trip

I spent this year’s vacation in Corsica mountains walking the half of GR20 trail. See this page for more info about GR20. We hiked only the nothern half from Callenzana to Vizzavona and it was one of the best hikes I did. The landscape is beautiful and changes quite a lot during the trip.¬† I had to quit one day early as my shoes transformed into sandals and my big toe had a nail problem. Plus after 9 days in the mountains, I had enough of rocks and was really forward to have a nice meal, hot shower and sleep in decent bed. Photos inside the article.

Categories
Development

Instrumentation Testing with Dagger and Espresso

dagger_espressoOver the Christmas holidays Google has integrated the Espresso testing framework into its android built tools and bumped the version to 2.0. Old espresso maven repos went dead because of that which forced us to temporally move to Jake Wharton’s repo until we got the time to move. I was the fortunate one who had to make the switch. This post describes the pitfalls of the upgrade.

Categories
Travel

Malaysia trip

I really enjoyed travelling through Malaysia. We travelled for 17 days visiting most of “top” places on the continental Malaysia¬†east coast: Kuala Lumpur -> Cameron Highlands -> Penang / George Town -> Langkawi -> Singapore and back to Kuala Lumpur.