The Enterprise Message API assigns all opened items or instruments a unique numeric identifier (e.g. UInt64), called a handle, which is returned by the OmmConsumer::registerClient() call. A handle is valid as long as its associated item stays open. Holding onto these handles is important only to applications that want to modify or close particular items, or use the items’ streams for sending PostMsg or GenericMsg messages to the connected server. Applications that just open and watch several items until they exit do not need to store item handles.
While opening an item, on the call to the OmmConsumer::registerClient() method, an application can pass an item closure or an application-assigned numeric value. The Enterprise Message API will maintain the association of the item to its closure as long as the item stays open.
Respective closures and handles are returned to the application in an OmmConsumerEvent object on each item callback method.