# Configuration Management – Part 3: The Journey Begins

Today I want to tell you about a configuration management solution I have developed. It is built for Software AG‘s ESB (the webMethods Integration Server). The latter did, for a very long time, not have built-in capabilities for dealing with configuration values. So what many projects did, was to hack together a quick-and-dirty “solution” that was basically a wrapper around Java properties.

At the time (early 2008) I was working in a “SWAT” team in presales, where we dealt with large prospects that typically looked for a strategic solution to their integration requirements. Of course configuration management, although not as prevalent as today, came up more and more often. So instead of trying to dodge the bullet, I started working on a solution. And since webMethods Integration Server is built on an open architecture, you can easily add things.

So let’s dive into some of the details of my configuration management solution, called
WxConfig. Its overall design goal was to have packages (roughly the platform’s equivalent to a web application on servlet containers) that could be moved around without any additional manual setup or configuration. The latter is a requirement stemming from the fact that we are in an ESB/integration context. By definition most packages therefore have some “relationship” to the outside world, and are not an application running more or less in isolation. Typical example would be a connection to a database, or an ERP system.

Traditionally there were two approaches for dealing with these external environment dependencies. On development (DEV) environments, there was some kind of document, telling the developer what setup/configuration they would have to apply to their DEV environment. For all “higher” stages like test (TEST) or production (PROD) this was hopefully handled by some kind automation; although back in 2008 that was rarely case and more often than not also there a manual checklist was used.

From a presales perspective (that is where it all started) the DEV part was the relevant one. My idea was to come up with something that could transform the document with the setup instructions into some kind of codification. So I basically devised an XML format (or rather a convention) that did just that. It started out quite small, with only schedulers being supported. (In that specific case we needed a periodic execution of logic for a demo.)

Since then a lot of other things were added. The approach was so successful that  many customers have moved their entire environment setup (well, at least those parts that are supported) to the WxConfig solution. And there are, interestingly enough, quite a few customers who use WxConfig solely for environment configuration but not for configuring their actual applications.

You may now ask: Hang on, what about the other environments, like TEST and PROD? Very good question! This is one of the core strengths of the WxConfig solution and therefore warrants a separate post. Stay tuned …

# LaTeX: Hyphenation of \texttt

I have been using $\LaTeX$ since I was 17 and still love it. But one thing has been bugging me for a long time. For a while I had been manually tweaking documents to get proper linebreaks when using the \texttt{} macro. Now I had finally come to the point where this did not work any longer. A search gave me this snippet:

\renewcommand{\texttt}[1]{%
\begingroup
\ttfamily
\begingroup\lccode~=/\lowercase{\endgroup\def~}{/\discretionary{}{}{}}%
\begingroup\lccode~=[\lowercase{\endgroup\def~}{[\discretionary{}{}{}}%
\begingroup\lccode~=.\lowercase{\endgroup\def~}{.\discretionary{}{}{}}%
\catcode/=\active\catcode[=\active\catcode.=\active
\scantokens{#1\noexpand}%
\endgroup
}

It works great!

# VMware Fusion 4 on OS X Mavericks

Having upgraded to OS X Mavericks just recently, one of the main questions for me was, whether I would need to upgrade from VMware Fusion 4 to the current version (which is Fusion 7). Initially the thought had not really occurred to me, but after the second crash of my MacBook I started to look around. The majority of content I found was about the support status and some people had gotten really agitated during the discussion. But little was said about the technical side of things, i.e. whether the stuff was working or not.

What I can say today is that for me VMware Fusion 4.1.4 works nicely and without issues so far. I use it almost exclusively to run a company-provided Java development environment on Windows 7 64 bit. So no 3D graphics, USB drives, or other “fancy” things.

The crashes were most like caused by an old version of the keyboard remapping tool Karabiner (formerly KeyRemap4MacBook). Once I had upgraded to the appropriate version, the crashes were gone.

# Keyboard Tools

Just a quick post to share two awesome utilities that I have been using for a while now. I like working with the keyboard over the mouse in many cases, simply because I am faster with that, and was recently pointed to a a tool that will make things even better:

Auto Hotkey: This allows you to “play” an arbitrary set of key strokes and commands either by replacing text you just typed or by re-assigning a key (combination). Very handy for emails where you can now simply type “brc” and get “Best regards,<NEW_LINE>Christoph”

Another tool worth mentioning is Key Tweak, which provides a GUI over the registry that allows to remap the keyboard. My use-case was a very old IBM Model M keyboard that does not have a Windows key (I was made aware of the tool by this post)

# JMeter 2.5 Release

I am quite happy that my first contribution to a pretty well known open source program has made it into the latest release of JMeter, the famous load-testing tool from the Apache folks. At the beginning of this year I needed to do some load-testing on JMS topics with durable subscriptions. At the time those weren’t available in JMeter so I dug into the code and added the functionality, which was less difficult than anticipated.

# Custom target directory for unattended Java installation on Windows

There is a bunch of information available that explain how to perform an unattended (aka silent) installation of Java on Windows  (examples for JRE and JDK).

What is usually not mentioned is the fact that when you specify a non-standard target directory, it must not contain any spaces. The easiest way to achieve this is the use of the 8.3 format. So instead of “C:\Program Files” you can use “C:\Progra~1”.

# WebDAV Client

If you are looking for a small cross-platform WebDAV client, you should probably check on DAV Explorer. It looks a bit old-fashioned but is small (less than 600 KB), does not require installation, and simply worked for me. The only requirement is a JDK and its “bin” sub-directory in the path, but you have that anyway, don’t you?

It is probably not the best choice if you are a non-technical person, want to work with it every day, and look for a nice integration into your system’s GUI. But for quick tests or the occasional development-centric work it’s absolutely sufficient.

# Automate hMailServer Setup

For a set of demo systems (running on Windows) I needed a local mail server. I have been using hMailServer for quite a while in such scenarios. It integrates nicely with Windows (runs as a service), has an administration GUI and overall a good reputation. What was different this time? Well, I simply wanted to do the setup in a fully automated (also referred to as unattended) fashion. This comprises the installation and all following configuration steps that I so far used to perform using the GUI.

Some research on the web revealed that automating the  installation itself is quite easy but several requests for doing the same with the configuration were unanswered. This is funny because hMailServer comes with a COM API that allows you to do pretty much everything you would normally do with the GUI. I did not want to emerge as a .Net developer from this and quickly found that VBS (Visual Basic Script) is probably the quickest way. Back in 1998 I had done some serious development with VBA (Visual Basic for Applications) and Access 97 which made things relatively easy. So here we go …

The installation is automated using the /verysilent command line switch, which will install

• in the default location (%PROGRAMFILES%\hMailServer)
• using the embedded MS SQL database

If you want a custom location for the installation, you can add /DIR="c:\pathto\hmailserver".

Then you  have to run the VBS script (download here and rename to hmail-create-accounts.vbs) which will create the account. The syntax to call from a command line window (cmd.exe) is start hmail-create-accounts.vbs USERNAME PASSWORD DOMAIN`If you need other things automated the script and the API documentation should make this sufficiently easy.

If you want to go one step further, simply put the hMailServer installable and the script into your own installer. I usually recommend NSIS (Nullsoft Scriptable Install System) and its Eclipse plugin for this. The latter provides a nice wizard, so you can have your individual setup.exe in a just a few minutes.

# Using LaTeX with Windows 7

For those who are lazy and look for a relatively quick and easy setup guide for LaTeX with Windows 7, you should have a look at http://schlosser.info/latexsystem-en . Another interesting PDF document is here (German only).

Where I have deviated is the installation of Emacs. For several years now I have been using the distribution from http://ourcomments.org/Emacs/EmacsW32.html (patched version) which auto-installs all you need, incl.  gnuserv and gnuclientw. There is one caveat, however.  At the end of the installation you can have Emacs started automatically (on by default). This will most likely cause problems on Windows 7 (and probably also on Vista), because the installer is usually running with admin rights. In such a case the directory ~/.emacs.d and its subdirectories will not be created with the proper account as owner. Instead the admin user or group will own things. This will show itself in two problems:

• The window “Emacs Client” will display the message “Waiting for Emacs server to start” until a timeout occurs
• You will see the message “The directory ~/.emacs.d/server is unsafe” in the status line of your main Emacs window

To correct things, go to %USERPROFILE%\AppData\Roaming and change the owner of .emacs.d/ to your own user (make sure to apply this change to all sub-directories!).

Update October 2015

# Version Control Systems and other Repositories

Recently, a few colleagues and I had a very interesting discussion about what should go into a Version Control System (VCS) and what should not. In particular we were arguing as to whether things like documents or project plans should go in. Here are a few things that I came up with in that context.

I guess the usage of VCS (and other repositories) somehow comes down to a few general desires (aka use-cases):

• Single source of truth
• History/time machine
• Traceability
• Collaboration
• Automation of builds etc.

In today’s world with its many different repositories you can either go for a mix (best-of-breed) or the lowest common denominator which is usually the VCS. So what’s stopping people from doing it properly (=best of breed)?

• Lack of conceptual understanding:
• Most people involved in those kinds of discussion usually come from a (Java) development background. So there is a “natural” tendency to think VCS. What this leaves out is that other repositories, which are often DB-based, offer additional capabilities. In particular there are all sorts of cross checks and other constraints which are being enforced. Also, given their underlying architecture, they are usually easier to integrate with in therms of process-driven approaches.
• Non-technical folks are mostly used to do versioning-by-filename and require education to see the need for more.
• Lack of repository integration: Interdependent artefacts spread over multiple repositories require interaction, esp. synchronisation. Unless some kind of standard has emerged, it is a tedious task to do custom development for these kinds of interfaces. Interestingly, this goes back to my post about ALM needing middleware.
• Different repositories have clients working fundamentally differently, both in terms of UI and underlying workflow (the latter is less obvious but far-reaching in consequence). Trying to understand all this is really hard. BTW: This already starts with different VCS! As an example just compare SVN, TFS and Git (complexity increasing in that order, too) and have “fun”.
• Lack of process: Multiple repositories asking for interaction between themselves also means that there is, at least implicitly, a process behind all this. Admittedly, there is also a process behind a VCS-only approach, but it’s less obvious and its evolvement often ad-hoc in nature. With multiple repositories a more coordinated approach is required to the process development, also because often this means crossing organisational boundaries.

Overall, this means that there is considerable work to be done in this area. I will continue to post my ideas here and look forward to your comments!