Sun GlassFish Message Queue 4.4 Developer's Guide for C Clients

ProcedureTo Iterate Through a Properties Handle

  1. Start the process by calling the MQPropertiesKeyIterationStart() function.

  2. Loop using the MQPropertiesKeyIterationHasNext() function.

  3. Extract the name of each property key by calling the MQPropertiesKeyIterationGetNext() function.

  4. Determine the type of the property value for a given key by calling the MQGetPropertyType() function.

  5. Use the appropriate MQGet...Property function to find the value of the specified property key and type.

    If you know the property key, you can just use the appropriate MQGet...Property function to get its value. The code sample below illustrates how you implement these steps.


    MQStatus status;
    
    MQPropertiesHandle headersHandle = MQ_INVALID_HANDLE;
    
    MQBool redelivered;
    
    ConstMQString my_msgtype;
    
    status = (MQGetMessageHeaders(messageHandle, &headersHandle));
    
    status = (MQGetBoolProperty(headersHandle,
               MQ_REDELIVERED_HEADER_PROPERTY, &redelivered));
    
    status = MQGetStringProperty(headersHandle,
              MQ_MESSAGE_TYPE_HEADER_TYPE_PROPERTY, &my_msgtype);