Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!

1. JPA Mini Book

2. JVM Troubleshooting Guide

3. JUnit Tutorial for Unit Testing

4. Java Annotations Tutorial

5. Java Interview Questions

and many more ....

 

Constructors Must Be Code-Free

java-logo

How much work should be done within a constructor? It seems reasonable to do some computations inside a constructor and then encapsulate results. That way, when the results are required by object methods, we’ll have them ready. Sounds like a good approach? No, it’s not. It’s a bad idea for one reason: It prevents composition of objects and makes them ...

Read More »

Neo4j: Finding all shortest paths

neo4j-logo

One of the Cypher language features we show in Neo4j training courses is the shortest path function which allows you to find the shortest path in terms of number of relationships between two nodes. Using the movie graph, which you can import via the ‘:play movies’ command in the browser, we’ll first create a ‘KNOWS’ relationship between any people that ...

Read More »

How to Access a Method’s Result Value From the Finally Block

java-logo

While the JVM is a stack-based machine, the Java language doesn’t really offer you any way to access that Stack. Even if sometimes, in rare occasions, it would be very useful. An example Method result values are put on the stack. If you look at the following example: public int method() { if (something) return 1; ... if (somethingElse) return ...

Read More »

Java EE, Docker and Maven (Tech Tip #89)

docker-logo

Java EE applications are typically built and packaged using Maven. For example, github.com/javaee-samples/javaee7-docker-maven is a trivial Java EE 7 application and shows the Java EE 7 dependency: <dependencies> <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>7.0</version> <scope>provided</scope> </dependency> </dependencies> And the two Maven plugins that compiles the source and builds the WAR file: <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>2.3</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> ...

Read More »

Immutable Infrastructure, hotdeploys, and the JVM

java-logo

Do you deploy and undeploy your JVM-based applications (regardless of JVM container/no-container) in production? ie, when you have new versions of an app or service, do you mutate the running JVM by “undeploying” and “hot deploying” the new, updated version of that app? Or, do you try to “move” a deployment of your application from one JVM to another at ...

Read More »

Apache Camel Wire Tap Examples

apache-camel-logo

If you want to monitor, debug, troubleshoot messages that are flowing through the route without the bother of permanently consuming the message off the channel, then you need to use a wire tap. The wire tap acts as a recipient list that consumes messages off the input channel and publishes it to both output channels. The first would be to the actual ...

Read More »

JavaFX, Project Jigsaw and JEP 253

javafx-logo

So Java 9 may break your code… This is particularly likely if your project uses JavaFX because many customizations and home-made controls require the use of internal APIs. With Project Jigsaw these will be unaccessible in Java 9. Fortunately, Oracle announced JEP 253 a couple of days ago. Its goal: Define public APIs for the JavaFX UI controls and CSS functionality ...

Read More »

Spring Integration Jdbc RowMapper Example

spring-interview-questions-answers

The JDBC inbound channel adapter’s basic function is to execute a SQL query, extract the data and pass the result set encapsulated in the form of a Message onto the local channels. You can read more about this in my example on JDBC Inbound Channel Adapter. The type of the payload is decided by the row-mapping strategy. The default one ...

Read More »

Apache Camel Log Component Examples

apache-camel-logo

Apache Camel Log Component Examples You want to log messages to the underlying logging mechanism, use camel’s log: component. Camel uses sfl4j as the logger API and then allows you to configure the logger implementation. In this article, we will use Log4j as the actual logger mechanism. Let’s start with our examples. Dependencies You need to add: slf4j-api – SLF4J ...

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.