Home » Author Archives: Tomasz Nurkiewicz

Author Archives: Tomasz Nurkiewicz

Java EE developer, Scala enthusiast. Enjoying data analysis and visualization. Strongly believes in the power of testing and automation.

Displaying progress of Spring application startup in web browser

spring-interview-questions-answers

When you restart your enterprise application, what do your clients see when they open the web browser? They see nothing, server doesn’t respond yet so web browser displays ERR_CONNECTION_REFUSED Web proxy (if any) in front of your application notices that it’s down and display “friendly” error message The website takes forever to load – it accepted socket connection and HTTP ...

Read More »

Server-sent events with RxJava and SseEmitter

java-interview-questions-answers

Spring framework 4.2 GA is almost released, let’s look at some new features it provides. The one that got my attention is a simple new class SseEmitter – an abstraction over sever-sent events easily used in Spring MVC controllers. SSE is a technology that allows you to stream data from server to the browser within one HTTP connection in one ...

Read More »

RESTful considered harmful

software-development-2-logo

I don’t like RESTful principles and APIs. In recent years it is seen as universal protocol for inter-process communication, especially in distributed systems. However I see many deficiencies of REST and there are alternatives that work well for certain use cases. Obviously there is no one size fits all, I just want to emphasize that REST architecture is flawed in ...

Read More »

Consuming java.util.concurrent.BlockingQueue as rx.Observable

java-logo

Classical producer-consumer pattern is relatively simple in Java since we have java.util.concurrent.BlockingQueue. To avoid busy waiting and error-prone manual locking we simply take advantage of put() and take(). They both block if queue is full or empty respectively. All we need is a bunch of threads sharing reference to the same queue: some producing and others consuming. And of course ...

Read More »

Writing a download server. Part V: Throttle download speed

java-interview-questions-answers

In the age of botnets that you can rent for few hundred bucks and run your very own distributed-denial-of-service attack, having emergency switches that selectively turn off expensive functionality or degrade performance gratefully is a huge win. Your application is still operational while you mitigate the problem. Of course such safety measure are also valuable under peaks or business hours. ...

Read More »

Writing a download server. Part III: headers: Content-length and Range

java-logo

We will explore more HTTP request and response headers this time to improve download server implementation: Content-length and Range. The former signals how big the download is, the latter allows downloading files partially or continue after failure from where we started.       Content-length response header Content-length response header is tremendously helpful for clients that track download progress. If ...

Read More »

Writing a download server. Part I: Always stream, never keep fully in memory

java-interview-questions-answers

Downloading various files (either text or binary) is a bread and butter of every enterprise application. PDF documents, attachments, media, executables, CSV, very large files, etc. Almost every application, sooner or later, will have to provide some form of download. Downloading is implemented in terms of HTTP, so it’s important to fully embrace this protocol and take full advantage of ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.