Application Development for IBM WebSphere Process Server and Enterprise Service Bus 7.0

I was recently given a copy of the new book Application Development for IBM WebSphere Process Server 7 and Enterprise Service Bus 7 to review. In general, I’m very impressed. The authors do a good job of explaining general SOA concepts, and the components of the respective IBM products which are used in implementing these concepts, right down to the nitty-gritty of how to implement a sample scenario (with thorough walk-through steps and screenshots). They cover both the key concepts of mediation flows and BPEL-based business processes. The book is light on a few subjects (it doesn’t really discuss the WebSphere Adapters, for example, and the chapter on deployment is a bit light – see the Production Topologies Redbook for more detail), and the hints ‘n’ tips chapter seems messy, but generally, it seems excellent for a beginner trying to learn these products.

(In the interests of disclosure, I received only a free copy of the book for this review).

DynaCache Cache Replication with WebSphere Process Server and ESB

As I blogged about previously, there is a useful technique which involves inserting Java components into SCA modules to cache the results of services using the DynaCache mechanism of WebSphere Application Server. See Gabriel Telerman’s excellent article for more information.

However, if you deploy applications using this technique across a WebSphere cluster, which is fairly typical of a production WebSphere environment, you’ll most likely want to look into WebSphere cache replication (using DRS – the data replication service). This means that rather than having an independent caches on each cluster member (i.e. each server), you’ll have caches that replicate data between each other when it is invalidated or updated in the cache.

This is documented in detail towards the bottom of this InfoCenter page, but broadly speaking you’ll want to modify the properties of the object cache you’re already using. In the article referenced above, the default cache services/cache/distributedmap is used, but to extend this with replication across a cluster, it’s probably appropriate to create your own object cache first if you haven’t already. You then need to specify a “replication domain” for that cache (you’ll need to create one if you don’t already have one), and the replication type. Often “Push only” is suitable for most performance requirements – this pushes new cache entries across the cluster when they are created, modified, or invalidated.

Some other points to be aware of:

  • The Data Replication Service doesn’t always start up straight away on server startup – sometimes it will take a few minutes.
  • It’s primarily intended for internal IBM use, but you may find that the tracing string com.ibm.ws.cache.*=all is useful for figuring out what’s going on inside the cache if it’s not behaving as you expect. It will show cache hits, misses, and replication.

Increasing WebSphere Integration Developer’s Heap Size

Sometimes, when working with WebSphere Integration Developer, you may find that you run out of heap space for its JVM – this will typically result in sudden crashes, and often happens when you have a lot of projects loaded or you’re doing a lot of intensive activity.

In this case, you may want to consider increasing the maximum heap size. Because WebSphere Integration Developer is based on Eclipse, you can do this using the standard Eclipse approach, which is documented on the Eclipse wiki.

Broadly, you’ll want to add some command-line arguments to the WebSphere Integration Developer shortcut. Open the properties of the shortcut from your start menu, and append the following:

-vmargs -Xms512M -Xmx1536M

This will set the initial heap size to 0.5GiB and the maximum heap size to 1.5GiB, for example. You can adjust the value for your needs.

 

WebSphere Business Process Management v7 Production Topologies Draft Redbook Available

This post is a bit of a personal plug, but I’ve just returned from a Redbook Residency writing the book WebSphere Business Process Management (BPM) V7 Production Topologies Redbook, which illustrates how to set up various BPM products for production, including WebSphere Process Server. It’s a fully updated version of the previous book in the series, which was for V6.2 of the BPM products. The book is now available in draft, so please feel free to take a look – you can send feedback via the feedback e-mail address on that page. I’d also encourage you to rate the book, especially if you think it’s good!

Review: WebSphere Application Server Administration Using Jython

Recently, I was asked to review the book WebSphere Application Server Administration Using Jython.

First impressions are excellent – the book is thorough, first introducing the Jython language itself (which is essentially Python running on a Java Virtual Machine – and very easy to learn), then moving to talk about the wsadmin tool, which is used to execute administrative scripts or command in Jython with WebSphere. It’s worth pointing out that WebSphere currently supports two scripting languages – Jython and JACL, and Jython is the strategic direction forward for WebSphere, so it’s good that the book focuses on this (also, in my humble opinion, Jython is much easier to learn).

The book then moves on to the meat of the subject, discussing each of the four primary WebSphere administrative objects in turn. There are dedicated chapters for various important and frequently-used topics, such as security, databases, and messaging. In general, these are thorough and of high quality.

The only minor point against the book is that it covers only WebSphere Application Server, not any of the stack products that build on top of it (such as WebSphere ESB and Process Server, which is the primary focus of this blog). However, this is expected – it’s in the title – so is hardly a criticism.

Generally speaking, this is a thorough and useful technical book for anyone wanting to do scripting with WebSphere Application Server.

Disclosure: I recieved a free copy of the book in exchange for this review – that’s all.

Overriding a Web Service Endpoint in WebSphere ESB

When working with Mediation Flows in WebSphere ESB, and you have a Web Service import defined that connects out to an external Web Service, you might want to override the default endpoint. Here’s a (not exhaustive) list of ways to do that (the numbers in brackets indicate the version that the feature is available from):

  • (6.0.2+) The most flexible and long-term way: integrate with the Web Services Registry and Repository product by using the Endpoint Lookup mediation primitive. This allows you to dynamically look up service endpoints (i.e. URLs), by retrieving them from the registry based on criteria you set. The primitive, in some modes, automatically sets the /headers/SMOHeader/Target/address section of the Service Message Object (SMO), which exploits the dynamic callout capability in WebSphere ESB to override the default endpoint when the callout is performed. In other modes, multiple endpoints might be retrieved, so you would to select the appropriate one and populate that section manually.
  • (7.0+) Use the new UDDI Endpoint Lookup primitive, which works in a very similar way to the regular Endpoint Lookup primitive, but instead looks up endpoints from a UDDI registry.
  • (6.0.2+) Use the dynamic callout facilities of WebSphere ESB directly by populating the /headers/SMOHeader/Target/address section of the SMO directly. You could do this by writing your own logic in a custom mediation, for example, or you could populate it with a hardcoded value using a Message Element Setter.
  • (6.0.1+) Override the endpoint statically in the admin console after deploying the application. To do this, you’d first locate the relevant SCA module deployed in the admin console, then select the import binding you are interested in:
    Then, you can modify the endpoint accordingly:

    This might be useful if you are deploying different copies of your mediation flow to different servers, and wanted to use different endpoints in each case. Note that the methods above, which use dynamic endpoint support, will override whatever you set here, so this is only useful if you aren’t using dynamic endpoint support.

(Note: this tip applies equally to WebSphere Process Server)

Understanding SOAP Action in Mediation Modules

Questions often arise around the SOAPAction header used during Web Service interactions. Despite the name, this is an HTTP header (not a SOAP header) that is sometimes transmitted with SOAP messages to give extra information to the consumer of the service (i.e. the server) about the intention of the Web Service request. The SOAP specification describes the SOAPAction header, but although it gives some examples, leaves the exact usage open to interpretation.

Inside Mediation Modules, the header is used according to these rules:

  • If a SOAPAction header is set in the inbound SOAP request (through a Web Service export), its value will be placed into the /headers/SMOHeader/Action stanza of the Service Message Object (which is used inside the mediation flow to represent the request). Otherwise, the value in /headers/SMOHeader/Action is not set.
  • When an outbound SOAP request is performed (through a dynamic callout, not through a Web Service import), the value placed in /headers/SMOHeader/Action will be used if it is present (so you could set this value, with a Message Element Setter, for example, if you want it to be overridden). Otherwise, it is set to the namespace of your WSDL file, concatenated with the operation name being used – which is a convention frequently used for the contents of SOAPAction: e.g. http://myhost/mynamespace/myoperation.
  • When an outbound SOAP request is performed (through a Web Service import), a soapAction attribute might be specified in the <wsdl:operation>/<soap:operation> section of the Web Service Port WSDL attached to the import. If so, that value will be used as the SOAP Action.

Thanks for Matt Roberts and Jens Engelke for the help with this tip.