skip to main content
OpenEdge Development: ADM Reference
Messaging Objects and Their Methods and Properties : Methods for consumer messaging objects
 
Methods for consumer messaging objects
This section lists and describes methods for consumer Messaging objects.
assignUnsubscribe
Set the value for the unsubscribe-on-close flag for a persistent subscription. You use this function when you want an application to prompt users at log off whether they want to cancel a subscription that would otherwise persist into the next session.
Location: consumer.p
Parameters:  
INPUT pcDestination AS CHARACTER
INPUT pcSubscription AS CHARACTER
INPUT plUnsubscribe AS LOGICAL
Notes: None
createConsumers
Procedure that creates message consumers for normal message retrieval, shutdown message retrieval, and error handling.
Location: consumer.p
Parameters: None
Note: A message consumer for normal message delivery is created for each destination temp-table record. A message consumer is created to receive a shutdown message if the ShutDown property has a value. And a message consumer is created to handle errors.
defineDestination
Creates a tDestination temp-table record for use by createConsumers( ) for creating message consumers.
Location: consumer.p
Parameters:  
INPUT pcDestination AS CHARACTER
INPUT pcColumns AS CHARACTER
INPUT pcValues AS CHARACTER
Returns: LOGICAL
Note: This can be called from an override of processDestinations( ) to explicitly create tDestination temp-table records rather than using instance properties.
destroyObject
The message consumer’s version of destroyObject, this procedure deletes the message consumers and cancels any durable subscriptions that need to be cancelled.
Location: consumer.p
Parameters: None
Notes: None
errorHandler
The SmartConsumer’s version of initializeObject, this procedure fetches messages to get and display from the SUPER version of ErrorHandler.
Location: consumer.p
Parameters:  
INPUT phMessage AS HANDLE
INPUT phMessageConsumer AS HANDLE
OUTPUT phReply AS HANDLE
Notes: None
initializeObject
Procedure that is a SmartMessageConsumer version of initializeObject.
Location: consumer.p
Parameters: None
Note: This redirects output to a log file when running in batch mode. If a JMS Session is started without errors, processDestinations is run to get the destinations needed for creating message consumers. When running in batch mode, startWaitFor is invoked to start the Adapter’s waitForMessages.
messageHandler
This procedure runs when a message is received and handles the incoming message by calling appropriate procedures in its INMESSAGE-TARGET.
Location: consumer.p
Parameters:  
INPUT phMessage AS HANDLE
INPUT phMessageConsumer AS HANDLE
OUTPUT phReply AS HANDLE
Notes: None
processDestinations
Procedure that creates tDestination temp-table records from the Destinations, Subscriptions, and Selectors property values.
Location: consumer.p
Parameters: None
Note: createConsumers() uses tDestination temp-table records when creating the consumers that will monitor the individual destinations. You can override this with a version of processDestinations() that creates its own tDestination temp-table records rather than using the property values.
startWaitFor
Procedure that starts watching for messages when in batch mode.
Location: consumer.p
Parameters: None
Note: This is called from initializeObject when SESSION:BATCH-MODE = YES. It should not be called if the consumer is running in an interactive environment because it blocks user input.
stopHandler
Procedure that clears the Waiting property to shut down the Consumer object.
Location: consumer.p
Parameters:  
INPUT phMessage AS HANDLE
INPUT phMessageConsumer AS HANDLE
OUTPUT phReply AS HANDLE
Note: The stopHandler() routine is used to handle a ShutDown message, typically when in batch mode.