Hamburger Queue
In my last entry, I presented the Hamburger Pattern and talked about how you can reduce the number of events on a queue by merging them. However, I feel that I should have presented at least one way to...
View ArticleWater Drop Anti-Pattern
In my previous entries, I presented two patterns that allow you to limit the number of messages sent over a queue: the Indiana Jones Pattern and the Hamburger Pattern. The first one filters data while...
View ArticleNegating a Predicate
Often, when using Java streams, I try to replace my lambdas with Method References. For instance, when I have this code: mystream.filter(mystring -> mystring.isEmpty()) ... I tend to replace it with...
View ArticleSanta Claus Pattern
In a previous post, I talked about the Water Drop Anti-Pattern, where the ratio of payload to data was leading to poor performances.A way to alleviate this problem is to introduce the Santa Claus...
View ArticleGodzilla Anti-Pattern
Last time, I presented the Santa Claus Pattern, where you would send several messages wrapped up in the same packet to lower payload and increase performance.However, if you create your packets without...
View ArticleCreate Temporary Files with NIO 2 on Linux
We have an application that had problems with memory consumption. One type of object that we were keeping in memory was kept there only in case a user would start an administration client and connect...
View ArticleOpera Lift Pattern
In my last part, I presented the Godzilla Anti-Pattern, where you would merge so many messages that a monster size packet would be sent and have negative effects.In this part, I would like to present...
View ArticleQueue Patterns
This is just a summary of all my Queue Patterns:PatternDescriptionRocket Anti PatternData cross layersParatrooper ModelSeparate threads for separate layersMarsupilami PatternIntroduce queuesIndian...
View ArticleOne Ring Pattern
Last time, I finished talking about all my Queue Patterns. Now I’ll start with my Thread Patterns. Once you have your queues filled with tasks, the question that arises is: how many Threads do I need...
View ArticleFormat Date with java time
An advantage of the DateTimeFormatter class from the java time package over the old DateFormat is that it is thread-safe. But if the only thing I have is a Date, how can I proceed? The...
View ArticleZebra Pattern
Last time I explained the One Ring Pattern, where only one thread handles data coming from a queue. I also explained the reasons why such a pattern might be preferred.One of those reasons is when...
View ArticleTreeMap misuse
TreeMap is a very practical class when you want your Map to keep its keys ordered. Unless you don't know how it works. I noticed this code recently in one of our projects:private Map<Double,...
View ArticleStar Trek Anti-Pattern
In previous installments, we tried to limit the number of Threads to the minimum, even to one. But what happens if you go the opposite way? Often, we try to parallelize some process, but do not want to...
View Article