Feb 29, 2016

2015 conference talks

The past 2015 has been very eventful year for me on both professional and private plan. I got married, moved to Sweden, started working for Klarna and did a lot of talks on events around Europe, here are the recordings and summaries of them

JPrime 2015: the core libraries you always wanted

It was a great community event organized by BGJUG. I also got a chance to meet up with some of the friends there. One big highlight of the conf for me was beeing able to meet Bozho, one of the top contributors on StackOveflow. We even got a selfie but after an extensive search I am unable to find it. The team is preparing next year's event and they had few smaller events in the meantime like JProffesionals. In any case here is my talk on goodies from Guava:


Voxxed days Belgrade 2015: Microservice and distributed systems decoupling patterns

A first-time event for the Heap Space community and the best Voxxed event I have been( probably best of them all). Great content, awesome speakers and superb organization. Some photo from the organizers :


Devoxx BE 2015 : Updates to the Java API for JSON Processing for Java EE 8 with Alex Soto

It is one of the best conference in the Java world and I was delighted to have a talk with Alex on the JSR we have been working on. It's the latest additions to the JSON processing for Java EE. One mind blowing thing for me was that in parallel with us there was a talk by Andrew Tanenbaum. And yes it is THE Andrew Tanenbaum. While there were tons of other great stuff during the conference this was my personal highlight.

Same year I also talked on VoxxedDays Istanbul and had a panel on EOUS. I am happy to have taken part in all of these events and hope to have brought value to the folks who listen them. Until next time ...

Feb 26, 2016

JFokus 2016 : Java Awesomeness in the Heart of Scandinavia

Originally published on Voxxed https://www.voxxed.com/blog/2016/02/jfokus-2016-bringing-awesomeness-heart-scandinavia/
After watching many sessions online, this year I was able to attend Jfokus in person for the first time. This was the 10th edition of the event, bringing over 1800 attendees. One other thing to note is that the conference was sold out 2 weeks in advance, which as JFokus main organiser Mattias Karlsson commented, "hasn't happened in several years". This is testament that the Java community is still alive and kicking after all this time.
 

Amusement park fair party As a prequel to the main conference, there was a JFokus VM Tech Summit chaired by my Klarna colleague Markus Lagergren. Unfortunately, I didn't got visit this part of the event but Simon Ritter has a great write up on the Azul blog. The same day university sessions with 3 hour presentations on topics ranging from Mob Programming to TinkerForge and RXJava. The conference day started off with a great keynote by Brian Goetz on Java's evolution and future evolution.
There were many great talks throughout the day and you can see the speaker lineup as well as some of the presentation slides on the schedule page. I would really like to highlight a few which really got me thinking:
  • 'Git from the Bits Up' by Tim Berglund followed the creation of a git repository and how the information is internally represented by looking at the .git folder.
  • 'From Concurrent to Parallel' by Brian Goetz took me back to the college days of a parallel vs. serial code
  • Making Java more dynamic by Rafael Winterhalter covered the awesome topic of bytecode manipulation and how Byte Buddy can make things more simple.
Throughout the conference, Stephen Chin was live streaming and filming his NightHacking sessions. You can find the recordings on his blog but I would like to recommend the one from Simon Ritter on Struct-Like Performance in Java. The organisation was also excellent - internet at all times and no technical problems. I particularly enjoyed the amusement park-like theme of the party and the Atlassian and Red Hat bars. What followed the conference as a three day speakers (un)conference. Unfortunately this was not open for the general public, but two lucky people were selected to join the speakers in Vemdalen. Having taken part in unconferences before, I do understand the need to keep it small, but I would say that having few more outsiders is always good for the community. Here are few Tweets from behind the scenes:
Last but not least, here is a message from the JFokus team
And a few other images of the event up on the Flickr page,

Feb 4, 2015

HttpClient 4.x Timeout



HttpClient is one of the most versatile Java libraries. Unfortunately, it comes with a lot of configuration options that may be way too cryptic or difficult. While the API for 4.x series has been significantly improved there are still some sharp edges.

The deprecated or 3.x way of setting the timeout.

This is done using params. Note that this is still 4.x code but a deprecated one.

DefaultHttpClient httpClient = ...;
   
HttpParams httpParams = httpClient.getParams();
httpParams.setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 1000L);
httpParams.setParameter(CoreConnectionPNames.SO_TIMEOUT, 1000L);
httpParams.setParameter(ClientPNames.CONN_MANAGER_TIMEOUT, 1000L);


Now the part httpClient.getParams() is deprecated since obviously this is a nasty API. You need to keep track of parameters with Enums/constants and their type as well.

The right 4.x way aka the builder way


HttpClient 4 is full of builder for everything. While I often love the Builder patterns in some cases the testing part is really difficult but I guess it is always a tradeoff. This would be the "right way".


public RequestConfig requestConfigWithTimeout(int timeoutInMilliseconds) {
        return RequestConfig.copy(RequestConfig.DEFAULT)
                .setSocketTimeout(timeoutInMilliseconds)
                .setConnectTimeout(timeoutInMilliseconds)
                .setConnectionRequestTimeout(timeoutInMilliseconds)
                .build();
}

The meaning of the parameters

Notice that we are actually setting 3 different timeouts.
  • Socket Timeout - this is the time of inactivity to wait for packets to arrive
  • Connection Timeout - the time to establish a connection with the remote host
  • Connection Manager Timeout - the time to fetch a connection from the connection pool
The third one costed me dearly, it wasn't until the client was under a high load that issues started happening. The connection pool I was using had 10 connections per route limitation set and the scenario was quite common. As you can see these settings do not provide a mechanism for making an N millisecond hard timeout.

If we were to setup the timeout to 10 seconds on each of this we could end up with a request that lasts 9(sec to get a connection) + 9( sec to open connection ) + 9( sec of inactivity ) = 27 sec.

More info

A bug when setting the ConnectionRequestTimeout
The RequestConfig Javadoc
Apache HttpClient examples

Jan 31, 2015

JavaDay 2014 a leap forward


Java Day is an event that jug.mk organizes for the past 5 years. From the small group of enthusiastic presenters in EU-info center in Skopje to a full 7h filled with lectures at a cinema hall JavaDay has grown to be one of the leading technical events in the area.

What has changed over the years and what the future holds

We started out as a small event with only local speakers in 2009 happening each year since then. In 2013, we had 1 person outside of Macedonia. The need for diversity was becoming more apparent. 2014 was the year we went fully international with 6 speakers coming from Switzerland, Serbia, and Bulgaria. We had participants in the audience from all the neighboring countries.
The Bulgarian JUG presence was a great addition and an awesome connection between our JUGS.

The keynote 


Corsin Decurtins, CTO of Netcetera gave an awesome talk on "how to become a great developer".
To quote the abstract:
At the core, the job of a software developer is and has always been the same: writing good, elegant, sustainable and bug-free software that exceeds the expectations of your clients. But the context in which we do our job is changing and with it the skills required to be a great software developer. In this talk, I want to go through a couple of things that I think make the difference between a developer and a great developer. This includes some technical skills and practices, but also non-technical things that you might not consider relevant for a developer at first.
The talk was extremely well perceived by the audience. This is very visible by the survey where he got the best reviews also by the fact the we were approached multiple times by persons telling us we need more of this.

Why this type of events are important to the community 





Conferences help you get in touch with other like-minded persons. They keep you up to date with modern technologies and interesting concepts.  Also it is great for the companies where it enables them to reach narrowly selected audience, they get to promote himself and be recognizable.

Female participation @ JavaDay

This year we also had our first female speaker Raluca Breaur one of the organizers or the Agile meetups and Java User Group in Iasi, Romania. She had an awesome talk "Caching – oldie but goldie"  with great analogies for caching systems.
It is unfortunate that after so many JavaDay this was our first female speaker especially since the from the side of the attendees we had more than 30%. 
Few weeks later a nice initiative was started by forming a local chapter of JDutchess. Few of them were also involved in the organization and we extremely grateful.
I am just hoping that next years event will have lot more of this group.



What's next 


Hopefully sometime in the near future we are gonna get the video recordings processed and uploaded to Parleys.
We continue next year and try to make the event better. Going bigger is also an option but we are not sure if that is the right direction. We definitely wanna raise the organization level and the quality of the event.
Special thanks to the 7 sponsors that supported up and without them the event could not be free.


We had a little competition about choosing the next name for JavaDay so next year we might be called Javalicious.  
The organizing  team

The survey

Notice the Gaussian distribution for the speaker reviews :) 

Jan 21, 2015

A New Try-with-resources Improvement in JDK 9

The JEP 213 - Milling Project Coin is a follow up to the Project Coin additions to Java 7. Note, as the JEP states, this isn't a Project Coin 2.0. It's more of an attempt at smoothing the "rough edges" that came along with these additions. Just as a reminder - with the original Project Coin, among other things, we got:
  • Strings in switch
  • Binary integral literals and underscores in numeric literals
  • Multi-catch and more precise rethrow
  • Improved type inference for generic instance creation (diamond)
  • Try-with-resources statement
  • Simplified varargs method invocation
Try with resources has been a great simplification, especially when working with I/O code. The addition in JDK 9 is an improvement of the standard try-with-resources way of writing code. Previously in Java 7 and 8 we had;


BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
// Original try-with-resources statement from JDK 7 or 8
try (BufferedReader r1 = reader) {
// use buffered reader
} catch (IOException e) {
// ignoring exceptions because that is how I roll
}


which works just fine, but we still needed to declare a special variable in the try-with section. The cleaner and simpler way in JDK 9 is now;

// The JDK 9 way
try (reader) {
// use the reader
}catch (IOException e){
// ignoring exceptions because that is how I roll
}

This is more "natural" way of writing even though it most use cases we don't need the resource outside the scope of the try block. The restriction is that the reader variable should be effectively final or just final. You can play around with the new way already in the latest JDK 9 snapshot. More info available in Joe Darcy's Oracle Weblog post and the related  JDK bug report.

 Originally published on https://www.voxxed.com/blog/2015/01/new-try-resources-improvement-jdk-9/

2015 conference talks

The past 2015 has been very eventful year for me on both professional and private plan. I got married, moved to Sweden, started working f...

Popular posts