23
Aug 10

Pipelining support in Hotpotato

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 →


21
Aug 10

An enhanced version of ReplayingDecoder for Netty

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 →


19
Aug 10

Hotpotato has gone live!

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!


20
Jul 10

new vs newInstance()

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 →


15
Jul 10

Handshaking tutorial with Netty

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 →


04
Jul 10

Scala plugin on IntelliJ IDEA

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 →


28
Jun 10

Naming threads created with the ExecutorService

When profiling applications it sometimes becomes a pain to understand where so many threads come from and what the hell they are doing.

What?

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 →


05
Jun 10

The importance of -1, 0 and 1 in Java's Comparator

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 →


21
May 10

We interrupt this broadcast to bring you a special report on dealing with set-to-null in delta updates

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 →


20
May 10

Data Access Layer, the endless obsession – Part 2

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 →


Asynchronous Google Analytics for WordPress plugin powered by WordPress Expert at minilibra.com.