Kafka Consumer 0.10.1 has introduced a background thread for sending heartbeat instead of relying on user application thread to keep polling regularly like in the earlier versions. The normal pattern of Kafka consumer looks like the code below Before 0.10.1, heart beat is sent as part of polling for new message. This is by-design mechanism to… Continue reading
Post Category → programming
Instance Confinement
Ialmost forgot that I have this story in my to-be-blogged list. I was assigned to perform performance tuning on a system in my previous project. I found a concurrency bottleneck and rearrange the synchronization pattern to gain noticeably throughput. I later had a chance to read about the Instance Confinement technique which could be applied… Continue reading
Cut it out and run
One of the big gaps between seasoned developers and the less experienced ones is the troubleshooting skill. Unlike any other knowledge, this kind of skill is difficult to teach and learn. Developers invest tons of hours to develop his or her own techniques in gathering information and seeing through details to find the root cause… Continue reading
DOM NodeList iteration performance problem
I am having a performance problem with a module of my project. The code actually does something really easy. It just iterates over a NodeList and overwrites an attribute of each element. At first, I thought this slowness was related to the size of my XML document. I found out later that it has more… Continue reading
Simple explanation for inner join and left join
Last week, I have heard my colleague explained how inner join and left join are used. SQL join types are typically explained using Venn diagrams but my colleague’s explanation is from the view of how we are using them. Let’s say we are writing an SQL to get list of employees in the database shown below SELECT… Continue reading
Java Deflater and OutOfMemoryError
I guess this is old for many developers but it is new to me. I have been asked to join an investigation of OutOfMemoryError issue occurred in a project outside my division. Actually, it was a brief involvement. My colleague who was handling the issue already got a possible root cause. He believed that it’s… Continue reading
The Answer Lies Elsewhere
I have been thinking about this for quite sometime. An event occurred last week prompted me to finally write about it. It is about the problem investigating approach that my former group leader taught me when I was still in the early period of my working life. The approach goes like this Sometimes, we just… Continue reading
Debugger is your friend
Debugger has always been a big help for me. It is one of the main tools I uses in my day-to-day work, both in coding and troubleshooting. One great thing about debugger is that you can get big benefit form it just by using some simple features like step-over or step-into. I don’t quite get… Continue reading
JAXB Binder and XPath
came across javax.xml.bind.Binder when I was reading SOA Using Java Web Services (excellent book). I had never used this class before so I set out to find how the class could be used. I found that the class hadn’t been mentioned as much as the classes like Marshaller or UnMarshaller but it was very useful Binder is usually used… Continue reading
Spurious Wakeup
I have finished reading Effective Java long time ago. It is such a great book. The more I passed through each page the more I realized how little I know about java programming. The distance between “coder” and “developer” is really far I read most of the item listed in the book. One of the items I have… Continue reading