Somedays you come across some code and think that's pretty, why didn't I think of that? So my long time colleague Mark Warner has a nice twist on the standard name/value store pattern using method references to deal with converting from a String.
int size = store.getProperty("cache.limit", 500, Integer::parseInt);
boolean enabled = store.getProperty("cache.enabled", true, Boolean::getBoolean);
I took his example and refactored it slightly to return Optional, and I ended up with (more...)
I've been heads-down in writing my next O'Reilly report and didn't had enough time to blog in a while. Time to catch up here and give you a real quick start into the new microservices framework named Lagom. It is different to what you might know from Java EE or other application frameworks. And this is both a challenge and opportunity for you to learn something new. If you can wait for a couple of (more...)
Read this article on my new blog
In this article you will learn how to create a MapR Streams Consumer that saves all the messages into a MapR-DB JSON Table.
Install and Run the sample MapR Streams application
The steps to install and run the applications are the same as the one defined in the following article:
MapR Streams application
Once you have the default producer and
Automatic memory management (garbage collection) is one of essential aspects of Java platform. Garbage collection relieves developers from pain of memory management and protects them from whole range of memory related issues. Though, working with external resources (e.g. files and socket) from Java becomes tricky, because garbage collector alone is not enough to manage such resources.
Originally Java had finalizers facility. Later special reference classes were added to deal with same problem.
If we (more...)
So I got frustrated with two limitations of the Optional interface in JDK 8. The first problem is that there is no obvious way to perform an else operation in a block as there is only a
method unless you are using an old school if statement. The second problem is of course the old chestnut that even if you could do that the methods would not be able to throw a checked exception. (more...)
Read this article on my new blog
You can find a new tutorial that explains how to deploy an Apache Kafka application to MapR Streams, the tutorial is available here:
Getting Started with MapR Streams
MapR Streams is a new distributed messaging system for streaming event data at scale, and it’s integrated into the MapR converged platform.
MapR Streams uses the Apache Kafka API, so
The cake is backed. We're proud to announce that the new Apache licensed microservice framework Lagom is available on GitHub
! While other frameworks focus on packaging and instance startup, Lagom redefines the way that Java developers build microservice based applications. Services are asynchronous. Intra-service communication is managed for you. Streaming is out of the box. Your microservices are resilient by nature. And you can program in the language you love the most: Java.What is (more...)
This was my second day:
Michael Tamm (optivo GmbH): Feature Toggles on Steroids
Very good summary off all topic’s covering feature toggles. Wish I had this summary 2 years before, were we have evaluated this. Unfortunately furthermore no solutions for declarative frameworks like Oracle ADF with it’s wizards and xml configurations, which later generated code. Ironic answer to my question: “Don’t use frameworks – use Java”
Alexander Casall (Saxonia Systems AG): User Experience for techies
This year I have decided to give the Javaland conference a try. I’m not a java professional, but in the program was listed a lot of interesting testing presentations, so my company booked for me.
The location in Phantasierend Brühl near cologne was very fine. Unfortunately the conference rooms had not enough space this year so for some presentation you have to go to 2 rooms outside of the parc. Additionally it is not understandable, why (more...)
A really quick post today, I was writing a unit test that needed to put up a temporary JAX-RS resource in order to test something very specific with out the need of a large testing framework. Unfortunately the code I was using didn't know about replacing zero with a random allocated port so I had to do something different. The nice tidy code that does this looks like the following:
try(ServerSocket ss = new ServerSocket(0)) (more...)
Read this article on my new blog
Ted Dunning and I have worked on a tutorial that explains how to write your first Kafka application. In this tutorial you will learn how to:
Install and start Kafka
Create and Run a producer and a consumer
You can find the tutorial on the MapR blog:
Getting Started with Sample Programs for Apache Kafka 0.9
Appium is an open source API which can be used for black-box testing of apps. It is built on top of Selenium WebDriver, which was covered in a previous post. Appium can be used to test native, hybrid and mobile web apps on Android or iOS. Several languages are supported, including Java. This blog will focus testing native Android applications in Java using Eclipse. Writing such tests requires you to have access to an .apk (more...)
Stack trace sampling is very powerful technique for performance troubleshooting. Advantages of stack trace sampling are
- it doesn't require upfront configuration
- cost added by sampling is small and controllable
- it is easy to compare analysis result from different experiments
Unfortunately, tools offered for stack trace analysis by stock profilers are very limited.
Solving performance problem in complex applications (a lot of business logic etc) is one of my regular challenges. Let's assume I have another (more...)
So I was refactoring some code to use non-locking collection classes and I noticed the this significant different between ConcurrentMap.computeIfAbsent
. They key different is that for the former default implementing the mapping function can be called many times for a particular key where as for the concrete implementation it will be called only once.
Right okay so armed with that you know that any collection that implements just ConcurrentMap will inherit (more...)
After an update it is often desirable to check whether existing features of an application are still working correctly. This process is called ‘regression testing’. Several tools can be used to automate this process. This blog will focus on Selenium IDE, Selenium WebDriver and Selenide which can be used for front-end/ black-box testing of browserapplications.
Selenium IDE is a Firefox plugin which can be used to record interactions with a web application. After (more...)
So I was presented with a large suite that I need to distribute amongst an arbitrary number of Hudson slaves. Now my first guess would be to hand balance this into N sub suites; but that would require on-going work and would need to change depending on the number of nodes. (We have a target of 30 minutes to run all tests in parallel which is going to take some machines)
I downloaded the latest version of SQL Developer (4.1.2) to a just-provisioned, pristine server running Windows Server 2012 R2.
I downloaded sqldeveloper-126.96.36.199.64-x64.zip
, unzipped it, and placed it under c:program filessqldeveloper-188.8.131.52.64-x64
. I double-clicked the main sqldeveloper executable and expected it to "just work" (as it usually does), but this time it didn't.
I got the following error message:sqldeveloper64W.exe - System Error
Recently, I have discovered a fancy bug affecting few version of Linux kernel. Without any warnings JVM just hangs in GC pause forever. Root cause is a improper memory access in kernel code. This post by Gil Tene gives a good technical explanation with deep emotional coloring.
While this bug is not JVM specific, there are few other multithreaded processes you can find on typical Linux box.
This recent bug make me remember few other (more...)
In February of this year, Oracle University launched the PeopleSoft Learning Stream. Oracle's Learning Streams are short, educational vignettes. I was given the privilege of recording 6 streams:
- REST Query (more...)