Iterators

An iterator encapsulates a list of objects and a cursor that maintains the current position in the list. The concept of an Iterator, as available in IBM® MQ Message Service Client (XMS) for C/C++, is implemented by using IEnumerator interface in IBM MQ Message Service Client (XMS) for .NET.

When an iterator is created, the position of the cursor is before the first object. An application uses an iterator to retrieve each object in turn.

The Iterator class of IBM MQ Message Service Client (XMS) for C/C++ is equivalent to the Enumerator class in Java. IBM MQ Message Service Client (XMS) for .NET is similar to Java and uses an IEnumerator interface.

An application can use an IEnumerator to perform the following tasks:
  • To get the properties of a message
  • To get the name-value pairs in the body of a map message
  • To browse the messages on a queue
  • To get the names of the JMS defined message properties supported by a connection