Feed aggregator

The Power, Patterns, and Pains of Microservices

Javalobby Syndicated Feed - Fri, 23-Oct-15 21:55

For more insights on microservices, JVM languages, and more trends in Java, get your free copy of the DZone Guide to the Java Ecosystem!

It is not necessary to change. Survival is not mandatory.
—W. Edwards Deming

The principles of the agile manifesto , now non-controversial and well accepted, speak to how to both write and deploy software more quickly and more safely—to production. Indeed, the very measure of success is defined by how quickly software is delivered to customers working— and working reliably. It's easy to forget this, but unless your customers can use it, it's not shipped . Software in production provides a vital feedback loop that helps businesses better react to market forces. Software in production is the only differentiator for any software business and—as my friend Andrew Clay Shafer reminds us—"you are either building a software business, or you will be losing to someone who is."

Categories: Java

3 Synchronization Idioms

Javalobby Syndicated Feed - Fri, 23-Oct-15 21:23

While testing vmlens on open source projects, I found the following 3 synchronization idioms. Each synchronization idiom is useful for a specific access pattern:

Access patternSynchronization idiom
All threads only read or writeSignal
One thread reads and writes other only readSnapshot
All threads read, creating an object if it does not existPutIfAbsent


Change the behavior of a thread based on an event in another thread.

Categories: Java

Blade: A Simple, Elegant Java Web Framework

Javalobby Syndicated Feed - Fri, 23-Oct-15 21:01

What Is Blade?

Blade is a lightweight MVC framework. It is based on the principles of simplicity and elegance. If you like it, you can Star and Fork, thanks!


  •  Lightweight. The code is simple and structure is clear
  •  Modular (you can choose which components to use)
  •  Support plug-in extension mechanism
  •  Restful style routing interface
  •  Multiple configuration files support (currently properties, json and coding)
  •  Eembed jetty server and template engine support
  •  Support jdk1.6 or higher version


  • Simplicity. The design is simple, easy to understand, and doesn't introduce many layers between you and the standard library. It is a goal of the project that users should be able to understand the whole framework in a single day.
  • Elegance. Support the REST style routing interface, provide DSL grammar to write, no invasive interceptors.

Getting Started

To get started, first include the Blade library and then create a class with a main method like this:

Categories: Java

Catch New Zulu Embedded Demos @ JavaOne 2015

Javalobby Syndicated Feed - Fri, 23-Oct-15 10:51

Note: We still have free passes to the keynotes and the exhibit hall — if you’d like to attend please send a note to info@azul.com.

This year Azul is showcasing several new demos for embedded and IoT at JavaOne 2015 in San Francisco.  Azul has partnered with Microsoft, BitReactive, and Object Computing to demonstrate how Java developers can build real-life IoT applications.  Things that were considered only possible by programming with Assembly or C/C++ on embedded devices are now possible with Java.

Categories: Java

Building Microservices With Java

Javalobby Syndicated Feed - Fri, 23-Oct-15 03:01

This article is featured in the DZone Guide to the Java Ecosystem. Get your free copy for more insightful articles, industry statistics, and more.

Quick View

  1. Strategies for building microservices in the Java ecosystem include container-less, self-contained, and in-container.
  2. Container-less microservices package the application, with all its dependencies, into a single “fat” JAR file.
  3. Self-contained microservices also package a single fat JAR, but these also include an embedded framework with optional third-party libraries that will be compatible.
  4. In-container microservices package an entire Java EE container and its service implementation in a Docker image.

Architectures based on microservices introduce new challenges for architects and developers. An ever-increasing list of languages and tools brings with it the capabilities to conquer this challenge. Java is no exception. This article explores different approaches to building microservices using the Java ecosystem.

Categories: Java

Why Java 8?

Javalobby Syndicated Feed - Fri, 23-Oct-15 02:31

This article is featured in the DZone Guide to the Java Ecosystem. Get your free copy for more insightful articles, industry statistics, and more.

Quick View:

  • In many cases, Java 8 will improve application performance without any specific work or tuning.
  • Lambda expressions, the Streams API, and new methods on existing classes are some of the key productivity improvements.
  • Java 8’s new Optional type gives developers significant flexibility when dealing with null values, reducing the likelihood of NullPointerExceptions

Java 8 came out early last year—and Java 7 is now end of life—making Java 8 the only Oracle-supported option until Java 9 comes out at the end of next year. However, since organizations value stability over trendiness, many of us are still working with Java 7, or even 6. 

Categories: Java

11 Concerns With the Java Ecosystem

Javalobby Syndicated Feed - Fri, 23-Oct-15 01:16

To more thoroughly understand the state of the Java ecosystem, we asked 11 executives about their biggest concerns about the current and future state of the Jave ecosystem. 

Specifically we spoke to:

Categories: Java

End-to-End Automation for a Docker Hazelcast Cluster on Any Cloud & DCHQ Using Hazelcast for Data Caching In DEV

Javalobby Syndicated Feed - Thu, 22-Oct-15 21:31


Containerizing enterprise applications is still a challenge mostly because existing application composition frameworks do not address complex dependencies, external integrations or auto-scaling workflows post-provision. DCHQ, available in hosted and on-premise versions, addresses all of these challenges and simplifies the containerization of enterprise applications through an advance application composition framework that extends Docker Compose with cross-image environment variable bindings, extensible BASH script plug-ins that can be invoked at request time or post-provision, and application clustering for high availability across multiple hosts or regions with support for auto scaling. Once an application is provisioned, a user can monitor the CPU, Memory, & I/O of the running containers, get notifications & alerts, and get access to scheduled backups, scale in/out policies, and continuous delivery. In this blog, we will go over the end-to-end automation of a Hazelcast Cluster. DCHQ not only automates the application deployments – but it also integrates with 12 different clouds to automate the provisioning and auto-scaling of clusters with software-defined networking. DCHQ has also started using Hazelcast for data caching in development. We will cover:

  • Building the application template for the Hazelcast Cluster that can re-used on any Linux host running anywhere
  • Provisioning & auto-scaling the underlying infrastructure on any cloud (with Rackspace being the example in this blog)
  • Deploying the Hazelcast Cluster on a Rackspace Cloud Server
  • Monitoring the CPU, Memory & I/O of the Running Containers
  • Adding Hazelcast to the DCHQ application stack for data caching

Building the Application Template for the Hazelcast Cluster

Once logged in to DCHQ (either the hosted DCHQ.io or on-premise version), a user can navigate to Manage > Templates and then click on the + button to create a new Docker Compose template. We have created an application template using the official image from Docker Hub for Hazelcast. You will notice that this template has the Hazelcast Management Center and clustered Hazelcast nodes. You will notice that the cluster_size parameter used in Hazelcast allows you to specify the number of containers to launch (with the same application dependencies). You will also notice that you can distribute containers on different hosts to achieve high availability. This is done using the host parameter. The host parameter allows you to specify the host you would like to use for container deployments. That way you can ensure high-availability for your application server clusters across different hosts (or regions) and you can comply with affinity rules to ensure that the database runs on a separate host for example. Here are the values supported for the host parameter:

Categories: Java

Microservice Design Patterns

Javalobby Syndicated Feed - Thu, 22-Oct-15 21:07

The main characteristics of a microservices-based application are defined in Microservices, Monoliths, and NoOps.  They are functional decomposition or domain-driven design, well-defined interfaces, explicitly published interface, single responsibility principle, and potentially polyglot. Each service is fully autonomous and full-stack. Thus changing a service implementation has no impact to other services as they communicate using well-defined interfaces. There are several advantages of such an application, but its not a free lunch and requires a significant effort in NoOps.

But lets say you understand the required effort, or at least some pieces of it, that is required to build such an application and willing to take a jump. What do you do? What is your approach for architecting such applications? Are there any design patterns on how these microservices work with each other?

Categories: Java

Some Cool Things in Lucee

Javalobby Syndicated Feed - Thu, 22-Oct-15 01:31

I really haven’t spoken much about Lucee since the initial announcement a few months back. It seems like a lot of “things” are going on, and frankly, I figured I’d just see where things settle down later this year. It just so happened that I ended up on the cfapplication doc for Lucee and I was pretty surprised by what I saw. Here are some of the cool things Lucee is doing with applications versus ColdFusion. This probably isn’t everything, but here is what I found and what I thought was cool or interesting.

By the way, just in case it isn’t obvious – this list comes from the documentation for the cfapplication tag and is presented as arguments for the tag. Each of these works as “this” scope values in App.cfc too. That is implied, but it may not be obvious from the docs themselves.

Categories: Java

Docker Java App with MariaDB—Deployment in Less than a Minute

Javalobby Syndicated Feed - Wed, 21-Oct-15 22:53

Java developers and DevOps professionals have long struggled to automate the deployment of enterprise Java applications. The complex nature of these applications usually meant that application dependencies and external integrations had to be re-configured each time an application was deployed in DEV/TEST environments.

Many solutions advertised the “model once, deploy anywhere” message for application deployments. In reality, however there were always intricacies that made it very difficult to re-use an application template across both an on-premise vSphere virtual environment and an AWS environment, for example.

Categories: Java

An Answer to CircleCI’s “Why We’re No Longer Using Core.typed”

Javalobby Syndicated Feed - Wed, 21-Oct-15 04:31

CircleCI has recently published a very useful post “Why we’re no longer using Core.typed” that raises some important concerns w.r.t. Typed Clojure that in their particular case led to the cost overweighting the benefits. CircleCI has a long and positive relation to Ambrose Bonnaire-Sergeant, the main author of core.typed, that has addressed their concerns in his recent Strange Loop talk “Typed Clojure: From Optional to Gradual Typing” (gradual typing is also explained in his 6/2015 blog post “Gradual typing for Clojure“). For the sake of searchability and those of us who prefer text to video, I would like to summarise the main points from the response (spiced with some thoughts of my own).

Disclaimer: All the useful information comes from Ambrose. All the errors and misinterpretations, if any, are mine.

Categories: Java

The Basics of Scaling Java EE Applications

Javalobby Syndicated Feed - Wed, 21-Oct-15 01:31

To be honest, ‘scalability’ is an exhaustive topic and generally not well understood. More often than not, its assumed to be same as High Availability. I have seen both novice programmers and ‘experienced’ architects suggest ‘clustering‘ as the solution for scalability and HA. There is actually nothing wrong with it, but the problem is that it is often done by googling rather than actually understanding the application itself ;-)

I do not claim to be an ‘expert’, just by writing this post ;-) It just (briefly) lays out some strategies for scaling Java EE applications in general.

Categories: Java

Bringing javax.cache'ing To Your Spring Applications

Javalobby Syndicated Feed - Tue, 20-Oct-15 23:31

Recorded at SpringOne2GX 2015.

Speakers: Jeff Brown, OCI Web

Categories: Java

MVC 1.0 in Java EE 8 – Getting Started with NetBeans 8.1 and Payara 4.1

Javalobby Syndicated Feed - Tue, 20-Oct-15 23:01

In JEE 8 there will be an action-based web framework. Its name is Model-View-Controller or MVC for short. Model-View-Controller leverages existing JEE technologies, uses JAX-RS and integrates CDI and Bean Validation.
This article gives a brief overview of MVC 1.0 and enables interested people to get started with MVC quickly.

Getting Started

The current version of the MVC reference implementation named Ozark is an early draft 2 so you need to download the latest version of Payara or Glassfish to run MVC on it. If you are a NetBeans user as well, you have to download the Release Candidate of NetBeans 8.1 to get support for the current versions of Payara 4.1.153 and Glassfish 4.1.1.

Categories: Java

How to Handle an InterruptedException

Javalobby Syndicated Feed - Tue, 20-Oct-15 13:31

InterruptedException is a permanent source of pain in Java, for junior developers especially. But it shouldn't be. It's a rather simple and easy-to-understand idea. Let me try to describe and simplify it.

Let's start with this code:

Categories: Java

Key Takeaways from ContainerCon

Javalobby Syndicated Feed - Tue, 20-Oct-15 12:22

PictureThis is an overdue blog around the key takeaways from ContainerCon. We had the privilege of being a silver sponsor of this event. While we were mostly at our booth talking to conference participants, we managed to attend a couple of keynote sessions as well.

Here are the key takeaways:

Categories: Java

Scala Extractors Infix Sample with Rational Numbers

Javalobby Syndicated Feed - Mon, 19-Oct-15 23:01

I keep coming back to the awesome introductory material on Scala put together by Daniel Westheide. One of the examples that he provides for extractors using an infix operation pattern is the Streams API -

val xs = 58 #:: 43 #:: 93 #:: Stream.empty
xs match {
case first #:: second #:: _ => first - second
case _ => -1

Where the extractor is defined this way:

Categories: Java

What is JAR Hell?

Javalobby Syndicated Feed - Mon, 19-Oct-15 21:31

What is JAR Hell? (Or is it classpath hell? Or dependency hell?) And which aspects are still relevant when considering modern development tools like Maven or OSGI?

Interestingly enough there seems to be no structured answer to these questions (i.e. even the second page listed no promising headlines). This post is supposed to fill that gap.

Categories: Java

Java 8: Query Databases Using Streams

Javalobby Syndicated Feed - Mon, 19-Oct-15 01:31

When I wrote my first Java database application back in the late 90's, I had to do everything myself. There was a lot of code, error capturing ,and object conversions going on and the code rapidly became very difficult to maintain and, I have to admit, error prone.

Even today, when you work with databases, it is often cumbersome to bridge between the two fundamentally different worlds of an object oriented language like Java and a relational database. Often, you need write your own mapping layer or you can use an Object Relational Mapper (ORM) like Hibernate. It is often convenient to use an ORM, but sometimes it is not so easy to configure it in the right way. More often than not, the ORM also slows down your application.

Categories: Java

Thread Slivers eBook at Amazon

Syndicate content