Resource Management API

The Resource Management API provides functionality to create and manage destinations, message push listeners, and durable subscriptions.

Topics:

Service roles define what messaging resource operations users are authorized to perform in the Oracle Messaging Cloud Service instance. See About Oracle Messaging Cloud Service Roles and Users for information about roles and the privileges associated with each role.

Managing Destinations

This section provides information about managing destinations.

Topics:

Create a Destination

A user with the Messaging Administrator role can create both queues and topics. Names of queues or topics must always consist solely of letters of the Roman alphabet (a through z or A through Z), decimal digits (0 through 9), and underscores ('_'). No other characters are allowed.

Refer to the following for details:

See Create Resources for a code sample.

Delete a Destination

A user with the Messaging Administrator role can delete queues and topics.

Deleting a destination is a non-blocking operation. For more information, refer to About Destination Deletion.

Note:

Deleting a destination will permanently delete all undelivered messages currently residing on the destination. It also deletes all message push listeners on the destination.

Deleting a topic deletes all durable subscriptions on the topic.

Refer to the following for details:

List Destinations

A user with the Messaging Administrator role can list existing destinations.

Refer to the following for details:

Retrieve a Destination's Properties

A user with the Messaging Administrator role can get an existing queue or topic's properties.

Refer to the following for details:

Note that for queues, you can also retrieve the queue’s backlog size which is the number of messages currently stored in the queue.

You can call the getQueueProperties(String queueName, boolean returnBacklogStats) method on a MessagingService object to get a QueueProperties object. If the returnBacklogStats parameter is specified as true, the returned QueueProperties object will return a BacklogStats object when the getBacklogStats() method is called. The queue's current backlog count can be obtained by calling the getCurrent() method on the BacklogStats object.

Managing Message Push Listeners

This section provides information about managing message push listeners. The name of a message push listener must always consist solely of letters of the Roman alphabet (a through z or A through Z), decimal digits (0 through 9), and underscores ('_'). No other characters are allowed.

Topics:

Create a Message Push Listener

A user with the Messaging Administrator or Messaging Worker role can create message push listeners.

Refer to the following for details:

See Create Resources for a code sample.

When creating a new message push listener, a user needs to supply objects of the following classes (as needed):

  • Medium: A reference to an existing queue or topic from which the listener will receive messages. This cannot refer to a temporary queue or topic. Message push listeners cannot be created on temporary queues and topics.

  • DurableSubscription: A reference to an existing durable subscription from which to receive messages.

  • Selector: A wrapper that holds a JMS Selector expression. A JMS Selector can be used to limit the messages that a message push listener receives.

  • PushURI: A superclass to define the target to which messages are pushed. Subclasses include PushMedium, which indicates that messages should be pushed to another destination, and PushURL, which indicates that messages should be pushed to a URL.

  • FailurePolicy: A definition of the policy for the message push listener to follow if a failure is encountered when pushing to its configured target. Different failure conditions can trigger different actions defined in FailureResponse objects.

Delete a Message Push Listener

A user with the Messaging Administrator or Messaging Worker role can delete existing message push listeners.

Refer to the following for details:

List Message Push Listeners

A user with the Messaging Administrator or Messaging Worker role can list existing message push listeners. All message push listeners for a service instance are listed by default. Optionally, message push listeners for a specific queue or topic can be listed.

For more information, refer to MessagingService.getListenerNames() in Java API Reference for Oracle Messaging Cloud Service.

Retrieve a Message Push Listener's Properties

A user with the Messaging Administrator or Messaging Worker role can get the definitions of an existing message push listener.

Refer to the following for details:

Managing Durable Subscriptions

Durable subscriptions are created and deleted using standard JMS 1.1 mechanisms.

Topics:

Note that the Oracle Messaging Cloud Service Java library provides two additional createDurableSubscriber() methods that are not part of the JMS 1.1 interface. See Safe Durable Subscriptions for information about how to obtain durable subscribers safely.

List Durable Subscriptions

A user with the Messaging Administrator or Messaging Worker role can list existing durable subscriptions. Durable subscriptions can be listed for the entire service instance, a specific client ID, or a specific topic.

Refer to the following for details:

Retrieve a Durable Subscription's Properties

A user with the Messaging Administrator or Messaging Worker role can get the properties of an existing durable subscription.

For details, refer to MessagingService.getDurableSubscription() in the Java API Reference for Oracle Messaging Cloud Service.