Monday, 28 November 2016

IBM MQ Exits - Good To Knows

I recently co-created a security and message exit. The main code was written in C for a linux machine. The exit was later needed for a windows machine. Here are some of the things I learnt when migrating from a linux exit to windows and reminders to myself for the future.

- Windows exits are compiled into dlls.

 - Whilst unix machines will allow you to compile C using gcc with declarations made at will throughout the code. It is integral that all these declaration are made at the start of each function for the windows platform.

- Another key thing learnt was that whilst in many examples you may see exporting functions in windows in the following form "__declspec( dllimport )" or by declaring "C extern". Being new to security exits on windows I hadn't realised that the external functions needed to be declared in a definition file or a .def in the following format.
"EXPORTS
ExitName"

- Exits names are case sensitive.

- Whilst Security Exits are needed both on the sender and receiver channels, message exits are only required on one of the channels.

It is highly recommended that anyone creating Exits have a knowledge of both MQ and the operating system/coding language being used and takes the time to understand the implications of the code being used and the security issues that may arise.

There is a useful resource on the IBM Knowledge centre for compiling exits which can be found here:
http://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q028160_.htm

No comments:

Post a Comment