Monitoring Docker Swarm

In one of my last Blog Posts I explained how you can setup a Lightweight Docker Swarm Environment. The concept, which is already an open infrastructure project on Github enables you to run your business applications and microservices in a self-hosted platform.

Today I want to explain how you can monitor your Docker Swarm environment. Although Docker Swarm greatly simplifies the operation of business applications, monitoring is always a good idea. The following short tutorial shows how you can use Prometheus and Grafana to simplify monitoring.

Prometheus is a monitoring solution to collect metrics from several targets. Grafana is an open analytics and monitoring platform to visualize data collected by Prometheus.

Both services can be easily integrated into Docker Swarm. There is no need to install extra software on your server nodes. You can simply start with a docker-compose.yml file to define your monitoring stack and a prometeus.yml file to define the scrape configuration. You can find the full concept explained here on Github in the Imixs-Cloud project.

Continue reading “Monitoring Docker Swarm”

JSF Best Practice

I do developing with Java Server Pages (JSF) since the early beginning with version 1.0. Today , 17 years later,  we have version 2.3 and thus a lot of improvements and new features.  I’ve made many mistakes in using this standard web framework in my own applications. And therefore I would like to show some best practice rules in this Blog. And I hope this will simplify the work with JSF – for you and also for me – during refactoring my own applications. Most of which I write here comes from the great book ‘ The Definitive Guide to JSF in Java EE 8’ written by Bauke Scholtz (BalusC) and Arjan Tijms. I recommend you to buy this book if you have had already made experience with JSF.  So let’s start… Continue reading “JSF Best Practice”

JSF, f:ajax and render…..

Designing JSF pages with the usage of the <f:ajax> tag can be a pretty frustrating affair.  For example, if you’re trying to build a table with Ajax behavior, it often won’t work the way you expect it to. For example imaging a table with a delete-button which changes the content of your table:

<h:panelGroup layout="block" 
	<ui:repeat var="bookingItem" value="#{childItemController.childItems}">
			<td><h:commandLink value="delete"
				<f:ajax render="artikel_table_id"/>

This example won’t work even if it looks logical. The problem here is the render attribute pointing to the id of an outer h:panelGroup. This UI component tree is created during the initial build of the view.  If You’re manipulating the component references after building the view, the changes will not be reflected in the UI component tree during a ajax event life-cycle if you do not care to also execute the compete tree.

To solve this you can change the render attribute in the following way:

<f:ajax render="#{artikelTableContainer.clientId}" 

In this way now you have a binding to a component instance which forces jsf to execute and to rebuild the complete UI component tree. Note:  the execution is necessary to update input fields placed within a table row.

ui:repeat versus c:forEach

At a first look it seems that between ui:repeat and c:forEach there is not big difference. This is true if only want to visualize a data set. But if you want to manipulate the entries too – e.g in a table with an embedded edit-mode than you can run in trouble if you are working with an ui:repeat. As explained in the example before, the elements inside a ui:repeat are not part of the component tree. This becomes an issue if your entries are editable. It will work on the first look if you simply submit the outer component. But in case of a JSF validation error, which is initiating the JSF-Life-Cycle the component tree will lost your entered values.

For that reason it is recommended to use a c:forEach tag instead of a ui:repeat if your data set is editable.

Enclosing Ajax Tags

If you use an enclosing ajax tag like in the following example, please note that you need to use a c:foreach instead of ui:repeat :

<h:panelGroup binding="#{artikelTableContainer}"> 
  <f:ajax onevent="updateOrderItems">
    <c:forEach var="orderitem" items="#{childItemController.childItems}">        
       <td><h:commandLink value="delete"
      <f:ajax render="#{artikelTableContainer.clientId}" 

In this case you should not call the ‘execute’ in the enclosing ajax!

Manage Big Data With Apache Cassandra

In this article, I will share my experience with Cassandra and how you can manage big data in an effective way.  Apache Cassandra is a high-performance, extremely scalable, fault-tolerant (i.e., no single point of failure), distributed non-relational database solution. But Cassandra differs from SQL and RDBMS in some important aspects. If, like me, you come from the world of SQL databases, it’s hard to understand Cassandra’s data concept. It took me several weeks to do so.  So let’s see what is the difference. Continue reading “Manage Big Data With Apache Cassandra”

EJB Transaction Timeout in Wildfly

If you have long running transactions, in Wildfly it can happen that you run into a timeout durinng your processing EJB method. In this case you can change the default timeout from 5 minutes via the standalone.xml file:

 <subsystem xmlns="urn:jboss:domain:transactions:4.0">
  <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
  <coordinator-environment default-timeout="1200"/>
  <object-store path="tx-object-store" relative-to=""/>

In this example I changed the coordinator-environment default-timeout to  20 minutes

An Alternative to Kubernetes

Kubernetes is an container-orchestration system which helps you to automate your deployment, scaling and management of containerized applications. Originally this platform was designed by Google and is today part of the Cloud Native Computing Foundation. Kubernetes is surely one of the major providers in the market of container operating systems.

But what many do not know, is the complexity of this platform if used in smaller projects. To understand this you need to know, that Kubernetes was designed for the operation of large cloud environments as they are operated by Google, Amazon or Microsoft.  This means that with the help of Kubernetes you can not only manage one server, but hundreds of servers with thousands of services. For most projects, this power is superfluous. Continue reading “An Alternative to Kubernetes”

WWW Inventor Tim Berners-Lee Launches a Project to Save the Internet

The WWW Inventor Tim Berners-Lee Launches a new  open platform called “Solid”. With Solid, users can share their data with others without having to surrender their sovereignty to a group. Users should be able to decide for themselves who can access the data and which apps will be used.

To solve the problem of how to control personal data, in Solid all data is stored in a so called Solid POD. This Solid POD can be in your house or workplace, or with an online Solid POD provider of your choice. Since you control your server you own your data. You’re free to move it at any time, without interruption of service.

In my opinion, this is the only sensible solution to return data control back to the user. I hope this project gets enough attention. Your data is too serious to ignore.

Use Docker Instead of Kubernetes

Today we are all talking about Containers and container based infrastructure. There is a lot of hype and noise about this topic. But what is this container technology? And how does it solve today problems? I am using containers by myself and of course I am fascinated from this server technology. Containers can really simplify things. After more than 20 years in building server applications I have experienced many problems very closely. I call it “server technology“, which may sound a little strange to some. Are containers not more of a cloud technology? And this is the one thing that really bothers me is this current hype. When I talk about containers many people think about this Kubernetes thing. And this was the impulse to write this article. Continue reading “Use Docker Instead of Kubernetes”

XSLT 2.0 with Eclipse and Wildfly

Eclipse IDE provides a cool feature which allows you to execute XSL templates within the IDE. You just need to select the XSL file together with the XML file and choose from the context menu

Run As -> XSL Transformation

But for some reasons Eclipse is not supporting XSL 2.0 – which is standard in these days. So for example if you try to use xsl functions like ‘format-date-time’ or ‘replace’ this will not work. This is also true for Wilfly application server. So here is how to add XSLT 2.0 support for both – Eclipse and Wilffly

Eclipse IDE

You can install an XSLT 2.0 processor manually into your Eclipse IDE:

  1. Download the latest Saxon XSLT processor
  2. Unzip the package to get the saxon9he.jar file and place it into your workspace or some external folder
  3. In eclipse choose “Window > Preferences” then “XML > XSL > Java Processors > Add”
  4. Fill in a “Processor Name”, e.g. “Saxon XSLT 2.0”
  5. In field “Processor type” choose “Saxon (XSLT 2.0)”
  6. Choose “Add external jar” and choose your saxon jar, e.g. “saxon9he.jar”
  7. Confirm by clicking “OK”

Now you can use saxon for XSLT 2.0 transformations in Eclipse. You need just configure your Run As Configurations and select the option ‘use specific process‘ to select the newly added Saxon processor.

Wildfly Sever

Also wildfly server supports only XSL 1.0 per default. If you need XSL 2.0 in your application add the following maven dependency:

        <!-- XSL 2.0 support-->