Configuring MQ on iSeries
Code Sample 6 shows an example of MQClose, which closes an open queue. Specify the queue manager handle HConn, the queue handle HinObj and an options field. Again, check the returned "Reason" for errors.
The MQDisc call, used to disconnect from the queue manager, is shown in Code Sample 7. This is a simple call that specifies the handle from the MQConn call and checks the Reason code after the call completes.
The C client code that runs on the Windows 2000 system doesnt differ much-one of MQs advantages. Code Sample 8 shows an example of the MQOpen call in C. It looks similar to the RPG, doesn't it? MQ uses the same APIs regardless of the platform on which it runs. Sure, the syntax may differ and the method of including the structures and prototypes is language-dependent, but the API calls are the same with the same name, prototype definitions and field names.
The Middleware Solution
MQ is a strong and robust solution to middleware problems. Whenever a need for connectivity arises, especially between different platforms, I always see if MQ can solve it. The reliability, flexibility, ease of configuration and programming make MQ an excellent choice for connectivity and system integration issues.
This article provided an overview of MQ and its components, and gave a glimpse at the type of programming needed for an MQ solution. Examine your requirements-do you have a need for connectivity that requires guaranteed delivery, store and forward processing, once-only delivery and is easy to implement? If so, take a look at MQ-you'll be glad you did.
Search our new 2013 Buyer's Guide.
Web Exclusive | How to enable IBM i for management by IBM Systems Director
Cover Story | IBM eServer line delivers on the promise of virtualization