Quarkus: a blast from the future

Yep, Quarqus has definitely exploded just few weeks ago. As one of my friends said, it was marketing lvl8080! Just listen to the slogan – “Supersonic Subatomic Java!”. “A Kubernetes Native Java stack tailored for GraalVM & OpenJDK HotSpot, crafted from the best of breed Java libraries and standards”. Damn, so many buzzwords in one place! The twitter literally exploded as well. Literally everybody twitted about Quarkus.

I said – nah! Yet another microservices framework. There are many available now. The choice is really big. So, I almost ignored it. I’m honest here. Still the last Sunday I’ve downloaded it and played with some examples. My first experience was a failed build. I’ve submitted an issue in GitHub, and it turned to be my local maven issue. The fix was just to upgrade it. But as result this issue opened a discussion, and very same Sunday a maven version enforcer was added. The power of OSS! There are no weekend in OSS! Kudos to the team!

The twit flow nevertheless continued to appear in my feed. This somehow forced to open the Quarkus website and explore more. There was one logo that grabbed my attention:

I said – mmm MicroProfile. Lovin’ it! So it looks like I may try to pack a microservice (which is not Spring) in a GraalVM native image.

Ok, I need to try! This thought came to my mind about 3 a.m. this Thursday. Well, technically it was Friday already…

Luckily enough about a month ago we have deployed some CSV aggregation service. Yet another stage of some fancy bloody enterprise infinite process to generate some invoices. We have made it the most modern way using only MicroProfile specs, on WildFly server, running in some OpenShift pods (yes, we have a lot of RedHat licences). Mmm, a loot of cool buzzwords as well!

The service itself was completely stateless. With three rest clients we gather some data from there other services, mash them up in some CSV and serve it as a plain text on rest request! Technically it is insanely stupid! … making it the perfect candidate to be tested with Quarkus. By the way, all of the pipeline is still under development, so thus we’re not going to ruin someone’s bill and invoice.

Still the service has to work under some pressure. Thus OpenShift scales by adding pods. Since the service is stateless, we are totally ok with that! We also don’t have to care about rest providers from the other side. It’s their responsibility to scale 🙂

So, now comes the fun part!!! I’ve started a new project by copying some of the Quarkus quick–starters. Yes, I can generate a pom from an architype.. but I’m lazy.

I then just copy-pasted the code from my old project.. and it shined red.. Especially the the MicroProfile annotations.. ah. What’s wrong? 3 minutes of googling told me that for the MicroProfile stuff I need to add some Smallrye Quarkus extentions.. Ok, copy–pasted in the pom.xml.. Yay, the red is gone.

mvn clean package


Ok, you made me sweat! Now let us:

mvn quarkus:dev

.. and .. http://localhost:8080/api/v1/invoicingRXT/1253211 (some contract)

AND I HAVE THE RESULT! That’s a WOW!!! This was one the fastest migrations I’ve ever done! I LOVE STANDARDS! Long live MicroProfile!!!

Ok, I have earned my coffee. It took me.. 17 minutes. Yes, this was mostly copy–paste, but look how cool is that!

… But, thats not over! Quarkus documentation says if I add -Pnative to the maven build command it’ll produce a native image! Let’s do it! Luckily I had already setup the GraalVM installation.

mvn clean package -Pnative

Waiting.. 1 minute… 2 minutes.. BUILD SUCCESSFUL! Lovely! Yes, it takes some time to build an image! I should admit, that the business logic code was written in quite straightforward way, without any fancy constructions, just some POJOs. There were no GraalVM specific issues.

Now let us just run the executable:


and the service is up and running in about a second! Although the console says the startup time is 0,212 sec. Technically from the run command to running service is about 2 seconds. THAT DOESN’T COMPARE to ~49 seconds startup time of the WildFly server..

Ok, now lets go to http://localhost:8080/api/v1/invoicingRXT/1253211 and what I see:


Something went wrong!!! Why the example from the quick-starters work? Hmm… It looks like I’m missing one annotation over some classes – @RegisterForReflection. Reflection works a little different in GraalVM. Building it once again. Waiting another two minutes. Oh, how can two minutes can last so long..

Good! BUILD SUCCESSFUL! Now lets go to http://localhost:8080/api/v1/invoicingRXT/1253211 and what I see:


IT WORKED!!! (Now imagine the famous Dexter from Dexter’s lab cartoon shouting this loud). That is so damn cool!!!

Картинки по запросу dexters lab it works

Nice! It’s been 42 minutes since the beginning of the experiment (coffee break included)!

Ok, now let us go back to the OpenShift setup. It will be nice to see if it’s ok in our test environments under some pressure. After making some yaml permutations I’ve rerouted 10% of the traffic to go the new native image pod. After 4 hours watching it work I see no errors! Only sometimes I receive some messages from surprised testers like “Something’s wrong, some pods start in 3 seconds only…”. And I say “Haha! This is magic.”

Now some intermediate conclusions:

– WildFly 78 Mb image, Native 21 Mb image;

– WildFly ~49 seconds start-up, Native ~2 seconds start-up time;

– WildFly ~300 ms per request, Native ~270 ms per request (we are dependent on other services).

– Wildfly ~359 Mb RAM (serving 1 request), Native ~22 Mb RAM (serving 1 request)

Lovely! Just, Lovely!

What can I say – Quarkus is definitely a good thing to play with. It showed extremely well in (almost) production code. Yes, I know the example is really stupid, but that’s a real world demand. The migration took me about 40 minutes by just copy–paste. I love standards!

The coming Monday I’ll make a full native setup, we’ll see how it goes! May be even in production soon..

Disclaimer: Sorry, I can’t share the code. It’s corporate..

Trip Report: DevoxxUA 🇺🇦

Картинки по запросу devoxx ukraine

In the beginning of this year I was quite skeptical, that I will make more then 2 conference, including the one I’m part of – jPrime.

But the end of the year was definitely very intense. After coming from St. Petersburg I had the pleasure to speak at several local events, including the oldest and most prominent local conference OpenFest. It was a great opportunity to meet not only Java programmers, but also to talk about different platforms and languages as well.

As I was in Oslo and St.  Petersburg Ukrainian guys Andrii Rodionov and Oleg Dokuka approached me and invited me to submit a talk to the inaugural Devoxx Ukraine. So I did it, and very soon I’ve received an email saying I was accepted! Actually I was quite happy, since I haven’t been to Kiev for more than 5 years already.

The girls from the organisers helped me a lot to get all the invitations and was able to enter Ukraine without any problems!

By the way, that was the first time I had a direct flight to a conference, without any layovers. This is so much great! I’ve started appreciating this fact!

The conference takes place in a beautiful congress centre “Parkoviy”,

with a beautiful view of the Dnipro river. Well.. at this moment it was a foggy day (like the most of the days in November in Kiev)

The venue itself is very nice and modern..

There was even a car parked inside!

The entrance (or I would say – “the portal”) was extremely cool!

Actually the theme  of the conference was like “You are in a spaceship!” which is really lovely.

Unfortunately I was there only for the second day. I’ve missed some cool sessions like the keynote by  the famous scientist Lawrence Krauss.  It’s also sad, that I’ve missed the BOFs at the end of the day, I’ve started enjoying them a lot. I like this live discussion that happens in between.

But what I definitely really enjoyed was the first session of the day two – “Software Engineering Theory vs. Practice: A Song of Ice and TireFire” by Baruch Sadogursky and Evgeny Borisov.

It’s not very much technically oriented, but the topic about the “Technological maturity”  of a company is something I really have to dive in. I often find myself asking why we need this or another technology to solve current problem. Is the technology we’ve chosen able to solve this problem in the most efficient way and are our teams ready to implement it. Definitely a good talk!

Now I’m looking forward to see the videos of the talks I was not able to see. There were a lot of them running in parallel, the choice was hard!

As for my talk… the was a challenge for me: I had to talk in parallel with awesome Orkhan Gasimov, Doug Stevenson, Nakul Mishra, Reza Shiftehfar,  Mary Grygleski .. and Dr. Venkat Subramaniam. But I was sincerely surprised when I had my room completely packed with extra chair and people standing..

So I’m very grateful for all people that have attended the talk! I hope that the attendees will find good application of the technology in their projects!

I’m happy to have received this awesome comment!

And as always – conference is meeting great people! And finally meeting them in person!

Like Michael Simons! Finally we have talked to each other in real life!

And Rafael Benevides with Dr. Venkat Subraniam

And many many more!!

As I was late to the lunch after my talk, I was arranged a special very Ukranian lunch made of borsch, vareniki and salo!

This definitely made this event very special for me! I’m really grateful to Alina and Irina for arranging it for me!

It was a wonderful conf. Made with all of the Devoxx traditions!

I had a lovely stay! I’m very grateful to everybody who made it possible!

Bye bye, Kiev! Till the next time I hope!


Trip Report: Joker 2018 🇷🇺

Image result for jokerconf

It will be a bit strange to call this blog post a “Trip Report”, bearing in mind that I’m fairly local. Yep, technically I’m living in two homes – St. Petersburg, Russia and Sofia, Bulgaria. So coming to Joker was kinda switching home, but to make it more unified I’ll still call this post a “Trip Report”. A trip report to Joker Conference!

There is one disclaimer I have to make: in this post I do not follow any timeline. Here I just want to share some thoughts and emotions.

So, what is Joker Conference? This is Russia’s biggest Java event, which usually takes place at October/November  in St. Petersburg.  The city itself is now unofficially considered as a technological hub, accommodating a lot of IT offices and foreign representations. Like Oracle for example, they used to have a big R&D office in it. You may be surprised, but Java ME for example, or the biggest part of lambdas in Java 8 were created in St. Petersburg. Now, for some reasons, there is no more R&D, but some other activities. Still a lot of banks, telecoms, retailers, aerospace etc have some quite big R&D offices in St. Petersburg. The Universities produce a lot of very qualified developers to satisfy the huge needs for that.

So, as a result Joker is a big conference. There are usually about 1500 attendees.

The conference is run by JUGru group, and it is absolutely professionally organised.By professionally I mean that conference organisation is their main job. Joker was the first one guys&gals have made, now there are more than 15 conferences they manage. And they  are not only Java oriented.

This was my fourth Joker Conference, and I kind of see its evolution.

For me it all started back in 2015 when it was held in one of the hotels and it was sincerely crowded, but starting from 2016 the conference moved to the Expoforum – a huge expo center near the Pulkovo airport.  This venue definitely has opened some new possibilities like convenient transforming auditoriums, big expo and dining area. The venue is really one of the best I’ve seen in my vast “conference junkie” career.

The stage is cool!

And there is a lot of attendees!

The conference has mixed Russian/English set of sessions, so the speakers were also mixed local and foreign. The audience is mainly local. By local I mean Russian/Belorussian/Ukrainian/Kazahk – or in other words Russian–speaking. But the quantity of foreign speakers grows constantly trough the years, and I consider this as a good sign. All the visa barriers are handled gracefully by the JUGru team.

Russian conferences tend to focus on more hardcore topics. Just introduction talks receive the lowest scores. Russians prefer hardcore stuff! Yes, the talk should be hardcore, with a lot of deep dives, algorithms and case studies. If you can describe, for example, why your JVM consumes few bytes (or gigabytes) more than expected, and you know what experimental flag to put in the JVM params to stop it from doing this, describing in implementation details why this actually happens – this will be a cool talk! You may say, oh, isn’t it kinda JVMLS? Not exactly, dissecting Spring Boot or some Micronaut or Microprofile stuff is the expected topic. Not just knowing that the framework/technology can do this or that, but how actually it does it, and what are the corner cases causing unexpected bugs.

Yes, hardcore is highly tolerated! Why am I saying this? Actually I know this from the source. This year I had the honor and privilege to be invited as a member of the program committee. We had a wonderful team of eight – Gleb Smirnov, Victor Polischuk, Andrey Kogun, Oleg Anastasiev, Vladimir Sitnikov, Ivan Krylov, myself and first Valentina then Daria, to select the best possible talks for this conference. So, we were able to preview all the submissions, make rehearsals, make corrections in the talks, sometimes even redo the talks from scratch. Yes, you’ve got me right. On this conference (or actually on all JUGru conferences) the committee actively works with all the submissions and the speakers themselves. If you submit your talk to Joker – be prepared, that in few days someone from the committee will contact you and ask you for a rehearsal.

Many foreign developers  find this weird. They usually say: “Hey, hey man, I gave my talks at JavaOne, Devoxx etc. I had my rooms packed. Why should I do a rehearsal?”. But at the end of the day, those who accepted to rehearse usually say: “Damn, that was so much useful! And the feedback you gave me is so valuable! And that was totally for free!”.

As a result – the content is very strong and nicely prepared!

This is one of the key aspects that makes this conference kind of unique – a very intense content preparation. Usually the committee starts its work half a year before the conference, and active rehearsals are made until almost the last day before the conference.

By the way, there was even special time slot for direct interaction with the program committee.

Image may contain: one or more people, people sitting and text

Another thing I’ve seen only on Joker are the discussion zones. Every speaker, after giving his talk, is usually invited to answer questions about his talk or continue the discussion. This usually lasts for an hour.

Image may contain: 2 people, people standing

Image may contain: 2 people, people standing

In case of Dr. Venkat Subramaniam and Josh Long those discussion zones have lasted up to three hours. People had so many questions, and they both were answering them all that time!

This year’s conference continues its growth not only in terms of quantity of attendees, but also in terms of activities. There were two additional stages set in the expo area, so that the companies a the booths are able to present some quickes at the breaks.

The booths were also full cool stuff.

Image may contain: 5 people, people on stage

Image may contain: 1 person, crowd and indoor

Btw,  unlike other conferences, it’s not easy to win a prize at these booths. To do this, you have to solve several weird programming problems, most of which are like puzzlers.

Image may contain: 6 people, people smiling

There were also so called experts areas set, where every attendee was able to ask the strangest questions  about certain technology to the coolest programmers and solve their concrete issue! .. Or ask them to sign a book!

Image may contain: 7 people, people sitting

Everything was done to keep everybody busy till the late night (literally) the day one ended up with several cool BoFs. Together with Shelaev, Pangin and Chuyko we have hosted one of them regarding moving to Java 11.. And it was pretty cool! We had a very good discussion, with a lot of interaction, … and we were forcibly stopped, since this could have run all night long! I’m not totally sure whether the Java 11 was considered as a game changer, but one day we will have to migrate to it. The main discussion about it was, as expected, should we pay starting from now???

Image may contain: one or more people, shoes and crowd

Image may contain: 11 people, people sitting, crowd and outdoor

The activities at the conference hadn’t been strictly about knowledge but fun too, like a big exhibition of retro computers and games everyone could try playing.

As always the greatest part on each conference is meeting great people! I’m definitely happy I could meet Sebastien Blanc.

So much great to meet Gerrit Grunwald! I think the last time we have met was in SFO in 2015!

Together with the coolest Tagir Valeev watching Andrey Pangin’s talk.

With the so cool JBaruch (as a JFrog)!

It was great to meet with Ivan Uglyanslki from Novosibirsk!

A great honor for we was to meet in person Robert Scholte – one of the maven creators! It was also great to discuss the future of maven with him!

And we all had a lot of fun!

I liked a lot talking to John McClean not only about Functional programming but about Irish music as well.


This is the most OMG picture I’ve ever taken:

It was very interesting to talk with foreign speakers not just about the technology, but also about Russia. The most of the speakers are for the first time in the country, and it is very delightful to hear that they like the town of St. Petersburg a lot! Some of them have said: “They show us different thing on the TV..”

And by the way (yes, yet another by the way), on this conference I was not only part of the committee, but also a speaker. I gave a talk about Microprofile.io based on the tutorial we have done together with Ivan St. Ivanov from our BGJUG. My session was scheduled as last of the day one.  Surprisingly the room for 700 people was almost packed! Never thought so many people would like to dedicate their time on Friday evening for the ” bloody enterprise”.

Image may contain: 1 person, eyeglasses

I would like to say huge thanks everybody for coming! I hope this will be useful for your next projects! I liked the phrase several people have said – “Oh, this microprofile is like the light in the tunnel for the enterprise! This is great! It is so cool the technology is evolving so fast! And the community is there to help!”

At the end of the second day, as a final nontechnical keynote we all have listened to a very both interesting and strange talk about people’s digital mental health by famous in Russia Dr. Kurpatov.

Image may contain: 1 person

Actually there were a lot of take-aways for me from this talk. I still keep training my personal multithreading, but at the same time I train the concentration on a particular important task I have to finish on time with great responsibility.

And the last but lot least thing I should mention – just before the conference, the previous day the world’s greatest java speaker Dr. Venkat Subramaniam gave  his wonderful two (technically almost three) hours jug session. I was very happy to meet him after he came to jPrime to Bulgaria earlier this year. It was absolutely great to have his book signed for me! I’m feeling blessed now!


As expected, it was fully packed on this event!

Just to mention that this event took place at the Oracle office in St. Petersburg. Like every other building there it looks like a palace!

Image result for келлерман центр


So, Joker was great! As always great! Getting more and more great!

Thanks Andrey!

Thank you Alexey!

And thanks to the team! It was huge honor and pleasure to be part of this event! Hope to see you next year!

Image may contain: one or more people and crowd


And St. Petersburg is just amazing in autumn…

Image may contain: tree, outdoor and nature

See you soon, beautiful home!

Image may contain: sky, cloud and outdoor

Trip Report: JavaZone 2018 🇳🇴

Hmm, too few posts. I definitely have to change this. In my defence I’ll say, that only for this summer I’ve visited 12 countries. But you will argue, that for example Josh Long (my hero) made 12 countries only for this week, and he still has written several blog posts for this time. And you a right, I’m too lazy, I have to post more often!

Finally I’m in the local Starbucks, my cappuccino is ready, looks like it’s a perfect time to remember one of the greatest adventures of this year so far – JavaZone 2018!

When earlier this year, in May, I have received this email telling me that my talk “Java and the GPU: unlock the massive performance” was accepted for this year’s edition of JavaZone in Oslo, Norway, I literally jumped out of mu chair shouting out “Yes!!!”.

Visiting this conference was definitely one of my dreams, I’ve heard so many good words about it! Now finally this dream came true. Huge thanks to the committee for accepting my talk!

Finally September has arrived, I’ve landed in Oslo and literally fell in love with Norway from the first site!

An express train brought me from the airport directly to the Oslo central station for only 19 minutes. You may ask – so what? Actually the airport is about ~60 km away from the city and we were cruising with more 220 km/h. And those trains are scheduled to make this route every 10 min. This so cool!

For this conf choosing the train was the best choice, as the venue – Spectrum arena is just next to the central station. The hotel was there as well. So we were perfectly located.

Oslo welcomed us with a grey rainy weather

But just 20 min later it was beautiful and sunny, like in every northern town

In the evening we were invited to the speakers dinner that took place in a beautifully located restaurant with some stunning views of Oslo!

Oh, thats Chris Thalinger also making some photos of this wonderful sunset. By the way it’s raining.

Definitely a wonderful place to relax before the conference. We stayed there until late.

The next day was the first day of the conference. The first thing I saw was the looooong queue of the attendees.

The good (or may be the bad) part was that my talk was scheduled on for the second day. So the first day I had a chance to explore a little bit.

The conference organisation, or I may even say “architecture” is totally different from all other conferences I have attended. The venue is a huge arena, where big concerts take place. There is a big central area where you can find a lot of software company’s booths.


Just take a look how big is it and how many people are in!

The conference kick-off was lovely with some guitar players


The coolest part is that practically all the booth serve their own food all day long! Yes, yes.. you can have food all the time, all day long.. all two days! There was only one major problem for me – I couldn’t taste it all! I haven’t had enough capacity! Definitely OMG.

But not only food, but tons of other cool activities

One of the unique features of JavaZone are the 8 parallel tracks. Yep, 8! That’s a lot! The rooms are themselves not very big, but that makes the cozy.

That’s me attending Vlad Mihalcea’s great talk.

And like every conference the main reward is actually meet and talk to people! Hey, that’s Chris (..and Doug)!

My good friends Simon, Simon, Phillip and my new friend Jennifer

Finally could meet Sharat Chander in person!

Awesome hardcore JVM company of Doug, Volker and Steve

The discussions we had were really useful to me!

At the end of the day we had a wonderful hangout with David, Vincent and Matthew

Then actually came the funny part. My talk was scheduled for 9.00 the next morning. I was sincerely wondering who will ever be interested in GPUs and massive parallel computation so early in the morning? I was a bit nervious wen my talk was approaching.

But I was ready!

So I was expecting a maximum audience of 3 people to show up. What was my surprise when I found my room fully packed!

Oh My God! Absolutely unexpected!

I sincerely want to thank everybody that came. I hope the talk useful and fun to you!

By the way, it became available just few hours later in vimeo! Cool organisation at JavaZone!

When I was done with my talk I took the chance to hang around the beautiful city of Oslo!

Definitely a beautiful capital!

JavaZone 2018 was a great new experience for me! I’ve seen a cool organisation, met great friends and made great ones!

I want to say huge thanks to Rafael, Rustam, Mark and all the team for having me and making this conf a blast!

At the end as always my best five IMHO sessions of the conf from those I was able to see myself live:

Now I’m on may way watching the other talks I’ve missed (and those I’m able to understand)! They are just great!!!

So good bye Oslo! Thank you for being awesome! Hope to see you again!



Trip report: Devoxx 2017 🇧🇪

I’ve watched all of the published ~180 videos from this year’s Devoxx Belgium. Not all of them till the end, but it was still pretty hard. Also, it’s great nice that the videos are published on the very next day.

This is my first trip report. I’ve never done any of this before, But I think now is a good time to start. And there is a nice reason for this! I had the chance to speak at Devoxx 2017!

Disclaimer: There will be a lot of Me, Myself and I in this post. Its not much technical. It’s just like sharing my own emotions. …I’ll call it a “smoothy post”. If you want to get straight down to my recommended talks (my post-event playlist!) skip to the end section.

Here I’d like to encourage you to attend this type of event, and your employers to support these initiatives. These events are great fuel for personal growth!

All the conferences…

I think the best introduction for this was done in the previous post, so I’ll just copy and pasted it below:

This year was quite a DE(VOXX)ED for me! First I had a chance to speak in wonderful Romania, then beautiful Vienna, after that amazing Lugano, then the loveliest Krakow, finally at the huge Antwerp event! In between I also gave some talks in my home towns Sofia –Java2Days and St. Petersburg – Joker! Let’s not forget that I was in the dreamteam of 5 to organize and run the coolest jPrime conf!

I’ve had quite an intense year!!! Each of these conferences deserves it’s own separate trip report. All of them were just wonderful!

However, I’ve focused on this event because, well, being selected as a speaker at Devoxx Belgium is quite an honоr! And at least twice as honorable to have two sessions!

Why Devoxx Belgium is special?

This is my third time to the city of Antwerpen, but first time to Devoxx. I believe that every developer must go there at least once. Actually, even better would be to go every year! Just because everybody is there, almost all of the Java influencers! Not only can you just listen to the talks, but you can literally talk to them directly. This is what makes this conference truly unique, especially for Europe!

(Well I haven’t been to JavaZone yet. People say it has comparable by attendees count. I hope one day I will be able to go there as well.)

Unfortunately I was not able to be all the five days there, so I’ve missed all the Deep Dive sessions. I was only able to make the three last days, but it was still great!

The funny thing is that to get to Antwerpen, Belgium, the easiest way for me was to make it via Eindhoven, Netherlands. It is only a one hour drive with a car from Antwerpen, and Ryanair flies there.

The event takes place in Kinepolis.

As I came to the venue, I as a speaker I have received a very special gift:

My first impression was that Belgium is not so much to the north for this kind of hats. This looks more like Russian then Belgian! But after spending some time in Antwerp and I have realized that this was actually the best gift for this time of the year! It kept me dry and warm. So thank you very much!

And it’s we’re talking about hats, they were quite trendy at this conference!

(Baruch Sadogursky, Alexey Shipilev, Oleg Shelaev)

Since I came Wednesday afternoon, this day I could not attend any session, just because all of my good friends were there in the lobby.

I just could not stop myself from chatting and greeting everybody!

I was so happy to meet my amazing friend Dr. Venkat Subramaniam and great Kirk Pepperdine!

My dearest friend Roberto!

Edson Yanaga and Peter Palaga!

And of course Sebastian Blanc!!!

(Yes it’s blurry, it was made in the end of the day when everybody was tired)

Meeting people is definitely the coolest part of every conference!

I could have a very interesting discussion with Chris Thalinger about project Sumatra and Johan Vos about Gluon! Chat with Davide Delabassée, meet again with Matt Raible, have some shawarma with Rafael Winterhalter.

These guys are awesome!

By the way at the end of the day I had the chance to attend this speakers BOF by Hubert Sablonnière.

Hubert always hosts very useful discussions about how to speak and perform well at conferences. I have attended first such discussion in Morocco and I liked it a lot!

Day one ended in a very Belgian way:

Day two

Day two (or technically day four) was the day I gave both of my talks. But before that, I was honored to be interviewed by amazing Yolande Poirier About my talk “Java and the GPU”.

It was also a great pleasure to chat with wonderful Katharine Beaumont, with whom we’ve met many times through all of the year on different Voxxed/Devoxx events.

To tell you the truth I liked the venue! In many ways cinemas are great speakers’ perspective: Huge movie screen, plus very comfortable for attendees!

Is a disabled in a wheelchair was always easy for me to find a convenient place as an attendee.

From the organisers’ perspective I know that there are some issues with cinemas, but still it was ok!

Finally it was my turn to speak! The first session was a bit strange for me. It was not exactly technical, it was more social. It was named “Disabled > work > enabled”. I’m truly happy that the organisers gave a chance to me to make this quickie. In those 15 minutes I tried to share my experience, and how it helped me as a disabled to find my place in this industry. I’ve also try to convince companies to hire more remote workers thus equalizing the chances of disabled people to get a good job.

Video can be found here:

My  second talk was “Java on GPU”.

But just before that, quite accidentally I was introduced to Brian Goetz himself by James Weaver. I was really happy! Its a pity I had to prepare for my talk and had to leave the conversation. My deepest respect for both of them!

I knew from the beginning that my talk about the GPU is not a hype talk. So I didn’t expect much people to come. Still I was quite happy that the hall was almost full!


(This is 15 minutes before the talk)

I must admit that I felt so nice as the demo worked. Since I was using the Amazon cloud, I wasn’t quite sure that the demo gods will support me, but it worked!

The video is available here:

By the way we have shared some of the Bulgarian Java User Group T-shirts in this event for free!!

It was an amazing experience! I want to thank everybody who attended this session I sincerely hope you found something new for you! I had a lot of questions and discussions after the session. Although the scope of the technology is quite limited, if the task is suitable, some huge benefits can be achieved. I’ve tried to demonstrate this. And GPUs can be easily used in the Java world.

After getting done get I’ve got this wonderful feeling of relief! That was a good time to hang around!

And suddenly whom do I see! Josh!! My old buddy Josh Long! OMG!! I must admit he was one of the people who inspired me to try to speak at conferences.

Not only Josh! Brother Mark Heckler is also here!

But thats not all! I’ve met Stephen Chin! I’ve been watching his night hacking series since the very beginning! And now I’ve met him!

At the end of the day there was a special edition of the Russian podcast Razbor Poletov.

We had a live emission together with Baruch Sadogursky, Viktor Gamov, Alexey Shipilev, Alex Borisov, Andrey Cheptsov and Mykyta Protsenoko.

http://razbor-poletov.com/2017/11/episode-144.html (in Russian)

It was a pleasure for me as a regular listener to be part of it this time.

Day three

Day three (or technically day five), was a short day. Unfortunately only half day was allocated for the final sessions of the event. So it was wonderful just to attend the talks. Still it was a tough choice – I wanted to attend all of the sessions! But it all ended up with the wonderful talks by Stuart Marks, Heinz Kabutz and Brian Goetz.

It was great! Definitely a must attend event!

After the conference…

As we had some time and our return flight was scheduled for the next day, we’ve decided to make a small ride to Gent. Absolutely lovely and very beautiful town!

The technical side

Ok, this was the “emotional” part of the event. Now some technical thoughts.

This Devoxx actually represented all of the modern trends in Java (and all around Java) world:

  • Java 9 and modularity;
  • Java Enterprise;
  • Spring and all around Spring;
  • Kotlin;
  • Machine learning and AI;
  • Some Devops/Containers/Clouds;
  • Microservices.
  • Hardcore stuff

As I’ve mentioned above, I’ve watched about ~180 videos of the talks I could not attend. So I’ve made my own short list of the talks I liked the most, including those I’ve seen there myself:

Once again!

It was a truly great experience and a lot of run! Special thanks for Stephen and the team for having me!

and special thanks to Ivan Ivanov, Vlado Pavlov  and the Bulgarian guys/gals for the full time support!

And as member of The Gang of Five which stands behind the jPrime conference, I’ll try share the experience I’ve gained with the Bulgarian Java Community and inside my Company.

I’ll try to make some more posts.. if my talks are accepted elsewhere 🙂

Java as a technology glue, or how to use GPU from JavaScript

Ah! It’s been a while since I’ve posted the last time!

But this year was quite a DE(VOXX)ED for me! First I had a chance to speak in wonderful Romania, then beautiful Vienna, after that amazing Lugano, then the loveliest Krakow, finally at the huge Antwerp event! In between I also gave some talks in my home towns Sofia –Java2Days and St. Petersburg – Joker! Let’s not forget that I was in the dreamteam of 5 to organize and run the coolest jPrime conf!

Quite an intense year!!!

So finally this weekend I had some time just to play. Of course play with coding!

As may be some of you saw, I’m really interested in the Nashorn engine to run JavaScript on JVM. I gave once some talks about it!

But not only this bothers me! For several years I’m interested in General Purpose computations on Video Cards (GPGPU)! I even gave some introductory talks on how to use GPU and Java together.

On Devoxx in English:


And on Joker in Russian will be hopefully available soon 🙂

But! What will happen if actually unite these two my passions? How to run some code on the GPU but submitted from.. JavaScript!!!

You will say just use WebCL! But, isn’t it a little bit not ready yet? And as far as I know it is not exactly a full binding to OpenCL but mainly browser oriented stuff. Please correct me if I’m wrong. I’ve even played with some experimental drafts.

What if I want to utilize the full control of our computations on GPU through JS and make it very dynamic?

Yes, yes!! Nashorn is here to help us! And yes, we have the full power of the available bindings like those provided by JOCL!

So let’s do it! The usual example with vector add will be just cool enough!

That’s the JavaScript code:

I just put it all in jscl.js file.

As you in the beginning I’ve added some type definition shortcuts just to make code look more readable.

To run it in the console I just put:

JJS is available by default if you have minimum Java 8 installed.

The JOCL jar you can just get from their site.

And what we have (on my Mac):

Isn’t this lovely!!

Funny fact that is that because of the memory latency it about 700 ms no matter if I make 1k computations or 100m of them 🙂

Still, this may be good example of how Java/JVM can be a kind of a technology glue. Having in mind that there are more than 40 languages running on JVM, all of them can benefit from the de facto standard libraries already available for Java.

This is so much cool!! Have Fun!

Thoughts on Enterprise

I’ve always considered myself a Spring guy. I mean, it’s so cool to code with Spring! Spring is quite honestly the essence of the modern Java enterprise! It has everything for building an amazing, modern, scalable web application. The most of the routines are highly automated there. Just with few annotations you can convert some crappy POJOa into a real world working webapp. And it will work, it will scale, it will be testable! At some moment it came to a point that it’s not even required to implement some methods. Just annotate a method and Spring will read the method signature and implement the method for you! I believe that in the future you will just write something like:

You may lough, but just go to http://start.spring.io/ and it’s quite near to the idea above. Btw, it will be a cool idea to create a DSL to “talk to Spring”. I always liked and still like coding with Spring!

And then… suddenly, a disaster happened!

I had to start to work on a pure Java EE project! Oh no!

My first reaction was like: well, at least I will be paid for that.

At that period Java EE was considered as something big, outdated, sluggish.. at some parts even retro, with all the negative in this word. And my reaction was predictable since I had some “nice” experience with EJB 2. Yes, yes – EJB 2.0! Remember all this remote interfaces, local interfaces etc, etc. But after that I never touched it again. Good for me!

From several conferences I came to a feeling that Java EE just copies everything from Spring, and renames some of the annotations. And I said to myself – actually, that’s a huge plus for me! I just need to write @Inject instead of @Autowire.

So I’ve started the project and what was my first surprise? Of course it came out of maven. The pom file was really small.

And not more than 3-4 other small dependencies like Primefaces. And that’s ok! You have everything on board. And you don’t have to care about every API you use and every realization of that API etc etc. Unless you want to spoil everything, or, in other words, optimize.

And all of these ugly EJB 2.0 stuff is no more there. Everything is very nice and pure! Again with some annotations you convert your POJOs into beautiful enterprise webapp! Java EE is AWESOME!

So everything is standardized. And that rulez everything. In theory I don’t have to think about on what platform my WAR runs, it should demonstrate the same output every time I call something from my app. Realizing this was like OMG! So now we can develop one app and not think much of what dependencies to include. Take the app and drop it on every server supporting the current profile of Java EE. And we can make almost the same stuff as Spring does. Or I would say the really essential part of it with not so much sugar. Exactly – standards are the true essence of the common functionality widely used in the industry at its best! Damn! I’m in love! From now on I’m a Java EE definite fan! And always will be!

And I have discovered the power of the @EJB annotation!

So I’ve started digging in and then I faced some real life.

The first thing that blocked me was the … you are right – configuration! Every server is configured in its own way!!! So I can’t just drop my app and and make it work, I have to configure some datasources, security and many other stuff. Oh.. so now I have to ship my app with bunch of configs… a little bit disappointing. Still, I don’t have to ship my app with tons of custom libraries, or even with the server itself where it is all set up.

Then some other issues came like one with JAAS. So JBoss/Wildfly and TomEE they both support it but in some slightly different ways.. so in my code I had to put some ifs and see on which platform does the app actually run and call appropriate custom method.

Then the other issue came. The Primefaces upload worked gracefully on TomEE and didn’t even show up on Wildfly. With some insane magic I found out that if I remove the upload filter in web.xml the situation will switch to the opposite – it will work on Wildfly and stop working on TomEE. And that was predictable since at that point they used different versions of Mojarra..

So.. In theory I had to ship different web.xml files. But, that’s so much NOT beautiful! I spent one night almost in tears as I was unable to find a nice solution. But after some beer an in genius solution came to my head – create a server “on start listener” and fix all missing “on the fly”. That was so brilliant that the next night I didn’t sleep as well since I was drunk in the bar. I couldn’t withstand and put some other server depended config there. But that were just two other small things.

And what about the performance and the resources consumption? Surprisingly, the average memory consumption of this app written with Java EE 7. I was expecting something like several gigs, but it was only about 250 Mb RAM on TomEE with about 100 users connected. Not bad at all!!! I have even packed it as single executable jar with TomEE and uploaded on some of the cheap cloud providers. It performed great! Beautiful!

Btw. This app that I’ve written had to make some of Batch activities. And guess what? I didn’t even have to put any additional dependency in my maven or reinvent the wheel, since JBatch was already there in that Java EE provided dependency. I just used it! That’s so cool!

So Java EE can rule them all! In some cases, definitely yes, especially when your tasks are standard enough. And I may say, that from my decade in this branch the most of the tasks are quite standard. With really few deviations.

And what about Spring? With Spring you can do the same and sometimes more (and I wonder if it can do less). Yes, there are some differences in the “philosophy”, but it is obvious that many of the coolest ideas now available in Java EE actually came from Spring, or were deeply influenced by Spring. If there is a request to build something with very narrow Time-To-Market frame, I think I’ll first think about Spring, especially Spring Boot. There I can put some piece of code into real world production within just two hours. Although this can easily be done with TomEE or Payara as well. There are so many things available out of the box, like security, data, MVC, even batches! Batch is one of the examples how a Spring solution inspired the creation of a JSR-352. Btw now it’s the opposite – Spring Batch conforms the standard. It already supports the JBatch job declaration.

So they both do the same? Here is one small thing, rarely discussed. Spring is a proprietor solution. It’s a full ecosystem driven by one company, with a lot of open source efforts included. Still the evolution decision process is a bit different there.

So isn’t Oracle doing the same? I personally think that it has tried to do the same, but they couldn’t. Actually the Java EE standard evolution and support is driven by the Java Community Process. And unlike Spring Java EE is a standard, not a product. At the moment a discussion about Java EE end of life emerged the community and EE vendors started a campaign against those predictions. The well-known Java EE Guardians were formed, with a great support from the community and James Gosling himself. Four big Java EE middleware vendors have even started a common effort for creation of a fraction of the Java EE suitable for optimal microservices operation called Microprofile.io. And its fully community driven and open. The guys standing behind this initiative are really amazing! Truly passionate professionals that do care!

So Spring and Java EE are both comparable and incomparable. And I believe they both serve their needs, although in many areas they are overlapping.

I prefer even not to compare them but there is one thing we developers quite often forget – the financial part of the story. As written in the Adam Bien’s post Spring has its very clear support policy – upgrade or pay for the support. This once played some bad story for us. We have started the project with one version of Spring and somewhere in the middle a new version of it was released with some of the interfaces deprecated. This caused us some delays as we were dealing with updating our code. Still their corporate support is really awesome.

In terms of Java EE, it kind of moves this question to hierarchically lower level – to vendors that do implement this standard has their own support strategies. But the good thing is that they have to correspond to the standard, and the standard does not change too often. On the other side not all the issues can be solved entirely by some standard portable code. At some moment it comes to the point of “no turning away” when it’s necessary to switch to some, for example, underlying API provider specific optimizations. And the portability of the code declines drastically. But you still are not fully tied to one and only proprietor support, and switching it is much less painful. Btw. this question about equalizing of some of the parameters arose at the Microprofile.io multivendor session on the latest Devoxx.

So it’s a tricky question what is better. The answer is though very easy: well, it depends! It’s not always about the technology. A clear knowledge of how your app will perform and evolve can have more impact than just choosing the latest and the trendiest technology.

But if we take the just the technology itself, in my humble opinion Java EE and Spring are doing a great synergy together and move the Enterprise Java forward!

Fetching all the data in JPA?

I’m really not much into blogging recently, but I couldn’t not share this)

ORM is cool. No, it’s really cool! In Java EE that’s the standard for data persisting. It is so cool that by using it people start to forget that there is a database underneath the wonderful and extremely beautiful object model that gracefully expresses the business needs of the app. People don’t have to think about all of this chemistry happening under the curtains. Yes, in RDBMs the data lives in a totally different world, there are absolutely different rules, and the mathematics of it is absolutely different, but who cares! Yes, it is so much automatic! You don’t have to care about the low level ResultSets, mapping the data, their relations, etc etc… And the modern ORMs are so much smart that the data is loaded lazily and only when its need, making the app so much optimized.

And the app works perfectly while it’s been developed. Even when its accepted it works beautiful and as required.

But suddenly something goes wrong. Unexpectedly there are more than one users connected to the app. How could this happen? And the server treacherously crashes with some OutOfMemory exceptions! OMG!

No problem! That can be easily fixed – just by adding some more RAM. For several week its working wonderful. But then the OutOfMemory exception is back! No, that can’t be possible!

That’s the bloody Java EE! It’s very heavy and bad! Should have used Spring instead! Just because it’s cool! Ah.. the app should be rewritten! And of course there is no budget for that!

But still this production issue has to be fixed. And some more RAM is being added jut to keep it alive. Several iterations like that lead back to the same situation. Then, to keep the app running, the cleverest decision is made: a limit of users per time is put on the app. And yay! The scalability problem is solved! Solved, but not exactly, after another period of time the app crashes with the same exception even with one user! 

Common story? I believe that yes. But it’s not much popular to talk about issues like that, since we are all cool programmers, and never make such mistakes.

This story happened to me. But luckily I was not the one to code this app. On my freelance period I was hired as a consultant to solve this issue on a live relatively (not so much) legacy system.

Imagine you have quite an ordinary Java EE webapp, with JSF in front, some business logic expressed with mostly stateless beans and hibernate underneath. Nothing special.

The user logs in and navigates to a certain page which should display a table with some information. One of the columns has links to some downloadable items.

So I’ve logged in, clicked on the required link… and got the error. It was so easy to reproduce the bug. So the first action was to see the Heap Dump with MAT.. and the results were terrifying! A list with several thousand objects having a string field with a several megs of XML inside!!! That’s a WOW!

The JSF itself is designed in the simplest way as well, all the several thousands of items are displayed on one page and the user has to be able to download the XML directly from the object from the table. And you understand it yourself: that’s so wrong! With 10 test items during the development process this approach worked perfectly, and it’s hard to see what it leads to. Yep, for a developer and XML is just a string, which can be a member of an object. What can go wrong…

So imagine the following approximation:


Two very easy classes.


And Child:

There is a bidirectional OneToMany relation between them:

The field names are self-explanatory. Everything which is important, very important and shown has to be visualized in front to the user in the JSF. The other stuff – not on this page.

Looks ok for now… but have you spotted the problem?

Of course its the hugeXMLPayload that should always be loaded, although never displayed…

But, haha, this is so easy to fix! With just few annotations like:

At some point you are right. This should work if the code instrumentation/enhancement is supported and enabled in the JPA persistence provider.

But let’s rethink the way CLOBs and BLOBs are stored. Should this be directly in an object field which is then mapped to some table column? I don’t think that’s a good idea. Big data should be accessed rarely and the access should be really targeted. You may say: but, I have annotated them, and according to StackOverflow the code should be instrumented and, all this data should be loaded lazily. But just annotating them the correct way will not help in Hibernate versions lower then 5, as this code instrumentation was not properly ready yet. As seen, that is just a usual String getter method on an object field, this is not even a relationship which could be expressed with a join underneath.

This didn’t work for us.

So the first quick fix that was applied is naturally dynamic pagination in the JSF table. Thus in memory we had only a small subset of the data. Still loading XML CLOBS in memory every time the page is loaded is a little bit stupid.

What may be the other option effectively NOT to load the entire data? And without changing the data model.. and on a live system? It is not possible to create another “Attachment” object and make a OneToOne relationship to the Child to keep it separated.

So how to make it the most natural and portable way?

The answer I have found in the book “High-Performance Java Persistence” by Vlad Mihalcea. I believe this is an absolutely “A Must Read Book” for every full stack developer.

So the answer to our problem was unexpectedly simple. The first idea was to create a projection and to fetch only the desired fields. But the results of those fetches are arrays with objects. And that’s a little bit raw level approach. There should be something more civilized.

And the civilized approach is called subentities. In JPA it is absolutely legal to map different objects to the same table in the DB. These objects may contain a subset of the data of the original object. And JPA/Hibernate will always fetch only the fields relevant to the object. So we have created a parallel read-only structure with subentities and made just one additional service to serve our JSF.

ParentEntity transformed to ParentEntitySummary:

And the ChildEntity transformed to ChildEntitySummary:

We have just thrown away all unnecessary and left what’s important! So good! If the JPA provider is Hibernate we could add an @Immutable annotation to declare our objects as read-only.

The magic here is in the @Table annotation. Its easy to spot that two classes are actually pointing to the same table in the DB.

For Parent it is:

For Child it is:

And we can absolutely legally to work with them as with all other entities:

So much awesome! And it worked!

This of course is not a silver bullet. I would rather call it a good patching.

So if it is impossible to redesign the DB scheme and have to work with live data, this approach may be a nice escape, especially on a read-only data.

As a result, from 8 GB RAM consumption  we went only to 89 MB on a JBoss machine (server memory footprint included). And its obvious that Java EE is very lightweight and quick!

So the idea of this blog post is to remind that developer is not the only user of the system. And “works on my machine” doesn’t mean it production ready!

And ones again the way the RDBM represents data is different from the way objects do. JPA/Hibernate is awesome tool. It saves great efforts! But its is necessary to make correct decisions on how the data is stored!

Have fun with JPA!

Some tips on TomEE development environment setup

I was recently interested to take a look what’s inside the TomEE app server.

We’re using it “heavily” in production. I was interested how some stuff was done.

The great stuff what it’s just a usual maven project. Actually all the info can be found here – http://tomee.apache.org/dev/source-code.html but step by step instruction may be of a help.

So I’ve started from getting the source with executing
git clone https://git-wip-us.apache.org/repos/asf/tomee.git tomee

Before importing the project into IDE a very good idea is to make a full build by calling

mvn -Dsurefire.useFile=false -DdisableXmlReport=true -DuniqueVersion=false -ff -Dassemble -DskipTests -DfailIfNoTests=false clean install

It will take a while, it will download all the dependencies and build TomEE without executing all the tests. Something that pleased me a lot is there is no need for any other special setup.

The integration with IDE is also quite seamless.

In IntelliJ Idea for example Just import the project from POM:


Then check ALL:


and in about 30 min you will get fully indexed working environment:


For Eclipse its almost the same. First import existing maven project into workspace:

14 марта 2016 г. 09-36-52

Eclipse finally supports hierarchical maven projects:

14 марта 2016 г. 09-38-04

And we are done!


A good idea may be to select hierarchical project representation of the project 🙂

The TomEE team has done a great job to make the development setup extremely simple! Within just few action you can start developing for TomEE.

KUDOS to the team!


Nashorn Eclipse Development Environment Setup

Yo fellows!

I recently had some time, so I’ve played with Eclipse to set it up for Nashorn. This article is adopted from the previous one regarding Intllij Idea.

The current setup is made on OS X Yosemite and the latest Eclipse (Luna). But the setup for other OSs should run almost the same way.

1. Verify you have JDK8 installed.

2. Using mercurial clone the repository http://hg.openjdk.java.net/jdk9/dev to the folder you want and execute get_sources.sh

3. Now switch to Eclipse and create a project called Nashorn directly in the folder “<JDK9_SOURCES>/nashorn”

17 июня 2015 г., 11:09:56

4. Eclipse is quite clever to find source folders:

17 июня 2015 г., 11:35:25


5. A bit tricky part: The compilation, development and debugging currently is done against JDK8 since the IDE still does not support JDK9 and the jimage distribution mechanism. So, in order JDK’s Nashorn not to interfere with one we build it’s a good idea to make a new copy of JDK8 and to remove the nashorn.jar from the JDK located under <JDK8_ROOT>/jre/lib/ext/nashorn.jar:




6. Now add this JDK to the IDE:

17 июня 2015 г., 11:39:25

7.  Almost done. Another tricky part: In Nashorn the so called “JavaScript” classes are been generated. There is a special tool “nasgen” for that and it is locates in the “buildtools/nasgen” directory.

17 июня 2015 г., 11:52:04


8. Before running the Nashorn itself the nasgen “all” ant target should be run.

9. Add the resulting “nasgen.jar” to the “Build Path” if it’s not there already.

17 июня 2015 г., 11:54:16

10. Navigate to “<nashorn>/make” folder and run the “all” ant target.

11. Add the resulting classed in “<nashorn>/build/classes/” to the “Build Path”:

17 июня 2015 г., 11:59:31


12. Now it is possible to run the Shell.java to explore and debug the code:

17 июня 2015 г., 12:02:24


Debugging is available directly in the IDE :

17 июня 2015 г., 12:09:38


Warning: Have in mind that some of classes – so called “JavaScript” classes are been generated. Their “bootstrapping” classes are annotated with @ScriptObject. Take some time to explore them. They cannot be debugged from that perspective. But “System.out.println” might help :)

Have fun developing the Nashorn!