Problem solve Get help with specific problems with your technologies, process and projects.

Use CTG if possible

We are investigating the use of CICS Transaction Gateway for a new application. However, we use MQ Series extensively in our organization and there is a lobby that is recommending that we use this.

Do you have any thoughts on the comparative merits and is there any significant difference in IBM's strategies for these?
I'm sure that all my chums in CICS would recommend using the CTG if at all possible. I share that view, somewhat but as you have an existing MQ infrastructure in place it might well be better to go with that.

You do not say from what environment you are intending to send a request into CICS. But, as you are talking about the CTG, I suppose you are talking about Java-initiated traffic from something like WebSphere or such.

I think the possible major consideration for you is how you want the UnitOfWork boundaries to be processed. Fully disconnected would tend towards a MQ implementation whilst more consistency would go towards the CTG. EJBs also have a consideration in this aspect as well. Programming complexity stems from this decision.

When thinking about a MQ solution, I suspect the prime consideration is where the QM exists in relation to the client including remote access. Your application design will by the very nature of MQ be asynchronous. I don't expect that you would define a special ReplyToQ just for a single flow to be returned and then poll that for the arrival of the reply and the function done in CICS would be within its own UnitOfWork. You get the MQ guarantee that a PUTted message will arrive at the other end but would have to design the CICS function so that something would always be put onto the ReplyToQ even on an Abend/Failure. The issuing client would have to know about the difference between a good reply, a failed reply, an abend reply or simply the non-arrival of a reply (a timeout and what needs to be done in the case where the reply is just late and you have decided it's never going to arrive). You will also have to think about compensation action in CICS if the issuing Cclient subsequently fails. However, as you already have MQ applications, all these decisions and techniques will already be known and solutions adopted.

Use of a CTG is potentially simpler. You can guarantee availability to a CTG and a CICS via techniques such as TCP/IP port sharing and CICS routing regions. Don't fall into the error of directing traffic directly to a CICS region for execution. Always go to a routing region which then decides where the best place for execution resides.

The UK Guide/Share Web site has some of my presentations on this topic. You can also configure things so that the issuing application does not have any awareness at all of the CTG or its location (this can be done via CTG exists). You can also have a single UnitOfWork encompassing the client and the CICS application but this is an MVS property only so recoverability and failure circumstances can be a lot easier to code than in the MQ case. You can also run your contact with CIS either asynchronously or synchronously so Synchronous access can just involve a long delay.

You should also be aware that access via the CTG uses an equivalent of an XC LINK COMMAREA(), so the data length is restricted to 32k - whereas in MQ you can have items longer than this. In the MQ case, you can also have multiple replies as against the single one for the CTG case.

So, have a think about the UnitOfWork and programming complexity issues. These will guide you down one route or another.

Robert Harris
CICS Technical Strategist -- CICS expert at Search390.com

Editor's note: Do you agree with this expert's response? If you have more to share, post it in one of our .VO7aaqqaAFk.0@/search390>discussion forums.

This was last published in August 2003

Dig Deeper on IBM system z and mainframe systems

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.