hotpotato — No comments
23
Aug 10
Seems that one of the upcoming features for Hotpotato – pipelining – is trivial to implement with Netty! At least on the connection point of view…
Pipelining is great because you can issue multiple requests before a response arrives, thus saving some round trip times and potentially take advantage of fitting more than one HTTP request per TCP frame!
Continue reading →
softwarerockstar — 2 comments
21
Aug 10
One of the things you’ll instantly fall in love with when using Netty is the ReplayingDecoder.
However, with time and increasingly complex requirements, you’ll soon realise that it has a couple of shortcomings, namely when dealing with complex message structures.
Continue reading →
softwarerockstar — 1 comment
19
Aug 10
Hotpotato is a Java HTTP client based on Netty that focuses on server-side execution of HTTP requests.
It’s designed to be used in high concurrency environments as well as stand extremely high peak loads without bringing the whole system to a halt.
It can either be used in synchronous (like Apache’s HTTP Client) or asynchronous (“fire request now, deal with response later”) modes.
Check it out at http://hotpotato.factor45.org/.
Feedback is more than welcome!
protip — No comments
20
Jul 10
Edit: after an interesting discussion at StackOverflow, I’ve updated some values and the conclusion.
Everybody knows (or should) that any operation performed using reflections is bound to be slower than its static, compiled counterpart.
What I had no idea was that the difference was so big!
Continue reading →
softwarerockstar — 2 comments
15
Jul 10
As we all did, I first started using plain NIO for highly scalable network based apps (mostly server-side). Then I jumped to Apache MINA, which I used for just about anything network related until a couple of months ago, thanks to @neteinstein, I discovered Netty.
While MINA took the whole Java asynchronous I/O a step further, Netty pushed it two steps beyond that.
Continue reading →
protip — 4 comments
04
Jul 10
Following the instructions found here, I installed the Scala plugin and prepared myself for some sugar coated FP funfun.
Wrote the hello world example, Ctrl+Shift+F10, and voil…
Continue reading →
protip — 3 comments
28
Jun 10
When profiling applications it sometimes becomes a pain to understand where so many threads come from and what the hell they are doing.

If you’re like me and have a dependency on java.util.concurrent‘s API’s for anything concurrency-related, then you’ve certainly noticed that default thread names aren’t particularly helpful with the aforementioned problem.
Here’s a quick & dirty implementation of a ThreadFactory (based on Executors.DefaultThreadFactory) but with support for your own thread name prefixes.
Continue reading →
softwarerockstar — No comments
05
Jun 10
I ran into a weird behaviour the other day, when removing elements from an ordered TreeSet that I had created with a Comparator implementation. Basically, removing elements that I knew were there wouldn’t work. Testing presence with .contains() also failed. Iterating over the elements and manually testing with .equals() did work, though.
Continue reading →
softwarerockstar — No comments
21
May 10
Today I came across a lovely issue that almost made me go haywire: dealing with set-field-to-null in delta updates.
Think of CRUD operations. Now focus on the U part.
Most people will take the naive approach of updating the records with all the values provided in the update request – I call this the full overwrite.
Continue reading →
softwarerockstar — No comments
20
May 10
This is a continuation of this post.
You probably should read it first for some context.
So, on to the hybrid data access layer. The goals I’m aiming for are:
- API that follows the principle of least astonishment
- Interchangeable data access technology (hibernate, iBatis, jdbc, whatever)
- Storage record objects (map the storage structure directly)
- Domain objects (object oriented data structures)
- Easy conversion between storage and domain objects
- Damn fast code!!1
With these in mind lets first address the Domain and Storage Objects.
Continue reading →