Sun Java System Message Queue 4.3 Developer's Guide for C Clients


The MQGetDestinationType passes back the type of the specified destination.

MQGetDestinationType (const MQDestinationHandle destinationHandle,
 MQDestinationType * destinationType);

Return Value

MQStatus. See the MQStatusIsError() function for more information.



A handle to the destination whose type you want to know.


Output parameter for the destination type; either MQ_QUEUE_DESTINATION or MQ_TOPIC_DESTINATION.

Use the MQGetDestinationType function to determine the type of a destination: queue or topic. There may be times when you do not know the type of the destination to which you are replying: for example, when you get a handle from the MQGetMessageReplyTo function. Because the semantics of queue and topic destinations differ, you need to determine the type of a destination in order to reply appropriately.

Once you have created a destination with a specified type, you cannot change the type dynamically. If you want to change the type of a destination, you need to free the destination using the MQFreeDestination() function and then to create a new destination, with the desired type, using the MQCreateDestination() or the MQCreateTemporaryDestination() function.