↓ Skip to main content

Setting promoted properties on install

·2 mins

There have been a couple of questions recently on an internal forum asking how best to parameterise a module. For mediation modules the seemingly obvious answer is via promoted properties. However, in these scenarios the parameterisation was required to handle the deployment of a module in to different environments and the originators felt that promoted properties were more about making administrative changes to properties post-deployment. I pointed out that, in the admin console, if you use the J2EE application installation process (rather than the install button on the SCA modules panel) and select the “Show me all installation options and parameters” radio button then you will find a panel entitled “Edit module properties” that allows you to modify promoted properties on installation.

Now that is all very well but it is cumbersome and error prone if you have a large number of properties to modify. I’d also recommend that application deployment, as with any administrative action in anything but a workstation development environment, be performed by scripting. There is no special command for installing mediation modules (they just use the standard AdminApp.install command) so how to specify the module properties? An intial search of the InfoCenter failed to turn up anything useful so I resorted to running the AdminApp.installInteractive command. This showed me the syntax required for specifying the properties on the command line but I still needed to know the name of the corresponding task. I then looked at the wsadmin.traceout file in the profile logs directory where a entry is added showing the generated command. For example:

[20/05/09 16:15:38:000 BST] 0000000a AdminAppClien A   WASX7278I: Generated command line: install 'c:/temp/module.ear' '[ -SIBSCAClientInstall [[, [group1]key1=value1,[group2]key2=value2]]]'

A little bit of massaging and I had the necessary Jython needed to modify properties on application installation:

AdminApp.install('c:/temp/module.ear',[ '-SIBSCAClientInstall', [[', [group1]key1=value1,[group2]key2=value2']]])

It wouldn’t take much to read the property names and values out of a property file to allow the necessary parameterisation for different environments.

The only place I found this task documented was in a very good IBM Education Assistant presentation covering promoted properties. Unfortunately this presentation only covers V6.1 so doesn’t show the syntax required for group names.

Lastly, an alternative approach (although not one that I’d necessarily advocate in terms of following a supported process) would be to have multiple copies of the sca-module-properties.xml file and build a different EAR for each environment. This file contains the default values for each promoted properties in the following format:

<sCAModuleProperty identifier="key1" value="value1" group="group1"/>

Related

Service Integration Bus Destination Handler

I’ve previously plugged the Service Integration Bus Explorer and IBM Client Application for JMS as useful tools to have in your WebSphere messaging kitbag. Thanks go once again to Dave Screen, this time for bringing the Service Integration Bus Destination Handler to my attention. This provides a very configurable mechansim for carrying out actions on a set of messages either on a one-off basis (via client or web application) or on a scheduled basis. Particularly useful operations include dumping messages, moving messages from one destination to another, and resurrecting messages from the exception destination. The readme file available in the download provides lots of detailed instructions and examples.

Sharing libraries at runtime

Thanks to my colleague Dave Screen for highlighting a useful technote relating to sharing library modules in WebSphere ESB and Process Server. The WebSphere Integration Developer concept of a library is typically only used for development time sharing of artifacts i.e. when you deploy a module that depends on that library, a copy of the JAR file is included in the enterprise application that is deployed. The technote describes how to deploy the library as a WebSphere shared library and have multiple modules depend on the same instance at runtime. This has the potential to reduce memory usage (the library is on a shared classloader) and ease managability. It does, however, mean that you need to be more careful about versioning of the library and breaking other dependent modules. If you’re not on 6.2 then note the list of APARs at the bottom of the document.

Dynamic JMS endpoints revisited

·1 min
This is a long overdue update to a previous post on achieving dynamic JMS endpoints in WebSphere ESB. As several people have commented, WebSphere ESB 6.2 added support for dynamic endpoints for all of the bindings types as documented in the InfoCenter. A couple of points to note: