Last Friday, I built a mainframe. It looks like this:
Well OK. That’s a very, very big exaggeration. Let me explain. I’m doing some work at the moment that involves using some Enterprise Service Bus logic with CICS and various other systems. In one particular case I needed to be able to invoke a CICS transaction across the CICS/MQ bridge. This is actually incredibly straightforward, but at the last minute I couldn’t get my queue manager connected to the host thanks to some firewall issues, so I decided to create a stub version instead.
My own “ESB of choice” is WebSphere Message Broker, and coincidentally that was what I was using to develop logic late last week. I’ve been using the product for about seven years now, on and off. The development environment for WMB enables the user to create message flows that receive data over various input protocols, and wire together various operations which transform, route or otherwise make use of the data.
All this “mainframe emulator” flow does is receive a message with a COBOL copybook formatted body; map the values into a response message (there’s some conditional logic in the map which decides whether to return an error of some kind based on the specific account number in the incoming message, to emulate different conditions); and then just reply to the ReplyToQueue specified in the input message.
Total time – about 3 minutes (OK… a bit more, as I was fiddling with the return conditions and a little bit of XPath in the mapping node). Obviously it’s not a real CICS system, but it served the purpose I needed. Since the interface to the actual CICS/MQ bridge is well-defined, it would be a simple matter of redirecting the message traffic to the real system if it was required for some other degree of testing.