Connecting to a Remote database from a JWS/Tomcat application on OpenShift

One of the common requirements for Java based applications on OpenShift is to have these workloads connect back out to an enterprise database that resides outside of the OpenShift infrastructure. While OpenShift natively supports a variety of relational databases (including Postgres and MySQL) as Docker based deployments within the platform, connecting to an existing enterprise database infrastructure is preferred in many large organizations for a variety of reasons including:

  • Inherent confidence in traditional databases due to in house experience around developing and managing these databases
  • Ability to leverage existing backup/recovery procedures around these databases
  • Technical limitations with these databases in being able to be deployed in a containerized model

One of the strengths of the OpenShift platform is its ability to accommodate these “traditional” workloads so that middleware operations can take advantage of the benefits/efficiencies gained from Dockeri’zed applications while giving development teams a platform to start designing/architecting applications that would fit into more of a Microservice based pattern that would leverage a datastore such as MongoDB or MySQL that OpenShift supports.

In addition to that, another common workflow in many organizations from a deployment point of view is to externalize the database connection information so that the application can be migrated from environment to environment (example Dev to QA to Prod) with the appropriate database connection information for the various environments. In addition, these teams typically work with the application binary (.war, .ear, .jar) deployment as the artifact thats promoted between environments as opposed to Docker based images.

In this article, I will walk through an example implementation for achieving this. A sensitive aspect of this migration process are the credentials to the database, where storing credentials in clear text is frowned upon. I will cover a variety of strategies in dealing with this in a follow on article. For this example, I will be using the following project which contains the source code that I will be covering in this article.

Lets get started!

Continue reading “Connecting to a Remote database from a JWS/Tomcat application on OpenShift”


Join Red Hat Developers, a developer program for you to learn, share, and code faster – and get access to Red Hat software for your development.  The developer program and software are both free!

 


For more information about Red Hat OpenShift and other related topics, visit: OpenShift, OpenShift Online.

Effective Business Process Management with JBoss BPM (MEAP)

For the last four years I was focused on evangelizing JBoss BPM Suite and the content I produced, the talks I have given and the articles I published led to many requests for a book focused on JBoss BPM products. This got me to thinking and in early November of 2015 I decided to submit a proposal, hoping Manning would be open to the idea of a book that was not only focused on developers, but also on architects and process analysts.

There was a process that went back and forth as the proposal was discussed, then early in January of 2016 Manning started a proposal review where they then ask for input from sources in the wild that are knowledgeable of the topics BPM and JBoss.  At the end of February 2016, having collected enough positive input during their review process, Manning committed to the book and I started to write.

The chapters have been flowing nicely and today the Manning Early Access Program (MEAP) has been kicked off for Effective Business Process Management with JBoss BPM, a book that focuses on developers, architects and process analysts that want to get started with JBoss BPM Suite.

Continue reading “Effective Business Process Management with JBoss BPM (MEAP)”


Join Red Hat Developers, a developer program for you to learn, share, and code faster – and get access to Red Hat software for your development.  The developer program and software are both free!

 

JBoss EAP 7 on OpenShift

RHJB_EnterpriseApplicationPlatform_Logotype_RGB-Gray_0213_cw_72JBoss EAP 7 was recently released, and brings with it a whole host of new features and support, such as support for Java EE 7, reduced port usage, graceful shutdown, improved GUI and CLI management, optimizations for cloud and containers, and much more. EAP 7’s small footprint, fast startup time and support for modern Java and non-Java frameworks make it uniquely suitable for deployment onto PaaS cloud environments, and Red Hat happens to have a leading one: OpenShift.

I put together a short screencast demonstrating how you as a developer can quickly get started deploying your EAP 7 apps to OpenShift (Enterprise version 3). Whether you are starting a new Silicon Valley unicorn startup or are migrating an existing app to EAP 7, developing and deploying to OpenShift will simplify your life greatly. In this screencast I cover:

Hope you like it!


Join Red Hat Developers, a developer program for you to learn, share, and code faster – and get access to Red Hat software for your development.  The developer program and software are both free!

 


For more information about Red Hat OpenShift and other related topics, visit: OpenShift, OpenShift Online.

Offline CLI with JBoss EAP 7

Over the years, I’ve come across many command line interfaces (CLI) to larger applications, each with varying levels of access and power. Having a CLI at all is a great first step for an application, as it opens up a much wider range of possibilities: administration, extension, and trust.

CLIs also promote scriptability – the ability to create and maintain repeatable scripts, and the easier it is to develop said scripts, the better. Sometimes scripts can solve issues that developers of the app never thought of. (Pro tip: find good user experience designers who know the product and are comfortable on the command line, then put them in charge of the CLI user experience. Your users will love you.

Continue reading “Offline CLI with JBoss EAP 7”


Join Red Hat Developers, a developer program for you to learn, share, and code faster – and get access to Red Hat software for your development.  The developer program and software are both free!

 

An Announcement for JBoss Core Services Collection

Red Hat JBoss Core Services Collection is a group of common services that are critical for application developers. The services included change as new services and projects are added over time, but the idea is to include common, developer-friendly projects under a single subscription. The collection makes it much easier for developers to access these services.

The launch of the Core Services Collection includes services that focus on three areas: web servers, security, and monitoring.

New Components

There are six components available in the launch of Core Services Collection:

  • JBoss Operations Network, which is based on the former RHQ project (now Hawkular). From a high level, this is a monitoring and management server, but the key is that it is developed in parallel with other JBoss products, so there is tight integration with other JBoss products. This centralizes all management for JBoss middleware products and also for Java applications running on JBoss EAP.
  • An integrated single sign-on server based on the Keycloak project. This SSO server supports SAML 2.0, OAuth, and OpenID and it can work with LDAP servers and Active Directory for user identity management. Keycloak SSO makes it a lot easier to define user domains, federated identities, and client applications because it has a very simple graphical UI, as well as REST APIs.
  • The Apache Commons Jsvc daemon provides a way to manage Java virtual machines on Unix/Linux; in general, this is used as a wrapper for Java applications so that those applications can be managed by native system tools.
  • Apache HTTP server is the most-used web server in the world. Web servers are used to route traffic and load balance requests to JBoss EAP and other middleware servers.
  • Web connectors provide a connection with third-party web servers which need to interact with JBoss middleware products and may not have a native connection. For this release, there are two connectors available:
    • Microsoft IIS
    • Oracle iPlanet

Continue reading “An Announcement for JBoss Core Services Collection”


Join Red Hat Developers, a developer program for you to learn, share, and code faster – and get access to Red Hat software for your development.  The developer program and software are both free!

 

Maven mirrors on OpenShift with and without Source to Image (S2I)

velocimetroI’m guessing if you’ve done enough repeated builds on OpenShift, using Maven, that you are probably aware of the “download the internet” phenomenon that plagues build times. You start a build, expecting all those Maven dependencies you downloaded for your last build to be re-used, but quickly see your network traffic ramp up while the same 100MB of jars are downloaded again and again. Even builds of a few minutes tend to grind on me, frustrate me as a developer when I’m trying to test/deploy/fix quickly.

Thankfully, Maven has a nice feature that allows you to set up local mirrors that cache dependencies and make them available to future builds, only updating from the upstream repo as needed on a regular (and configurable) schedule.

Continue reading “Maven mirrors on OpenShift with and without Source to Image (S2I)”


Join Red Hat Developers, a developer program for you to learn, share, and code faster – and get access to Red Hat software for your development.  The developer program and software are both free!

 


For more information about Red Hat OpenShift and other related topics, visit: OpenShift, OpenShift Online.

Red Hat CDK installation in just minutes!

Ready to develop container application in
just over 4 minutes?

Since I started playing around with OpenShift in its various forms, such as Online with cartridges and then later as containerized images, nothing has gotten me more excited than the availability of the Red Hat Container Development Kit (CDK).

This kit has made it possible to easily gain access to a full, product based installation of OpenShift as you would interact with it in application development in just minutes. While exploring all the steps involved to get this installed locally, I decided to roll it all into the demo template that is used extensively on both JBoss Demo Central and Red Hat Demo Central.

Continue reading “Red Hat CDK installation in just minutes!”


Join Red Hat Developers, a developer program for you to learn, share, and code faster – and get access to Red Hat software for your development.  The developer program and software are both free!

 

Take advantage of your Red Hat Developers membership and download RHEL today at no cost.


For more information about Red Hat OpenShift and other related topics, visit: OpenShift, OpenShift Online.

Building JBoss Projects with PatternFly and AngularJS

Recently I’ve been looking into different UI tech in use for apps built onPatternFly Logo top of Red Hat middleware, and I’ve discovered that many of Red Hat’s products use PatternFly (in differing capacities) for their administrative UIs. PatternFly is “A community of designers and developers collaborating to build a UI framework for enterprise web applications.” (from the website). There are also components, directives, etc, for AngularJS projects (which I really like).

This sounds awesome, particularly because I’m a terrible designer, so I thought I’d take a crack at converting an existing demo to use PatternFly, and along the way learn more about the framework and its best practices. These are concepts you can use in your own projects when building JS-heavy projects using Maven (which has about a billion ways to do things).

You can find the demo on jbossdemocentral, along with instructions for building it. In this article, I will describe some of the highlights of what I learned.

Continue reading “Building JBoss Projects with PatternFly and AngularJS”


Join Red Hat Developers, a developer program for you to learn, share, and code faster – and get access to Red Hat software for your development.  The developer program and software are both free!

 

“Don’t cross the streams”: Thread safety and memory accesses at the speed of light

The classic 1984 movie Ghostbusters offered an important safety tip for all of us:


Don’t cross the streams.” – “Why not?” – “It would be bad.” – “I’m fuzzy on the whole good/bad thing. What do you mean, ‘bad’?” – “Try to imagine all life as you know it stopping instantaneously and every molecule in your body exploding at the speed of light.” – “Right. That’s bad. Okay. All right. Important safety tip. Thanks…”


Similarly, in computing, there are also cases where data crossing through memory between different instruction streams would cause a similar effect to a software application – “all execution as we know it stopping instantaneously”.

This is due to the performance optimizations that both hardware and software implement to reorder and eliminate memory accesses. Ignoring these “memory access reordering” issues can result in extremely problematic debugging scenarios.

The bug from hell was a scenario where Java’s OpenJDK runtime parallel garbage collector very occasionally crashed because one thread’s write would signal that the data structure had been updated. This signal occurred before the actual update writes (to the same data structure), and the result was that other threads would end up reading invalid values. We’re going to take a deeper look into this scenario to understand exactly what went on in this notorious issue.

Continue reading ““Don’t cross the streams”: Thread safety and memory accesses at the speed of light”


Join Red Hat Developers, a developer program for you to learn, share, and code faster – and get access to Red Hat software for your development.  The developer program and software are both free!

 

Take advantage of your Red Hat Developers membership and download RHEL today at no cost.

JBoss participates in Google Summer of Code 2016

Google Summer of Code (GSoC), for those who are not familiar, is an initiative led by Google to encourage students to participate in Open Source projects during their summer break. Projects like JBoss Community or Fedora apply to be a mentoring organization and if selected by Google, are paired with students who they are expected to mentor. Selected and successful students receive a stipend from Google for their participation.

JBoss has been participating in GSoC for the past several years, with outstanding success, and I am happy to announce that the JBoss community has once again been selected as a mentoring organization for GSoC 2016.

Continue reading “JBoss participates in Google Summer of Code 2016”


Join Red Hat Developers, a developer program for you to learn, share, and code faster – and get access to Red Hat software for your development.  The developer program and software are both free!