# Using the Oracle Messaging Cloud Service

Oracle Messaging Cloud Service allow you to:

- Send and receive messages through JMS and RESTful Web Service.

- Use point-to-point communication with queues.

- Publish and subscribe using topics.

For more information about the Oracle Messaging Cloud Service see, `http://cloud.oracle.com/messaging`.

## How to Log In to Oracle Messaging Cloud Service

You can create a connection to Oracle Messaging Cloud Service from the Oracle Cloud view, described in How to Create an Oracle Cloud Connection.

After validating credentials, you are logged in to Oracle Messaging Cloud Service from OEPE. After you log in, the Oracle Developer Cloud Service and its associated Oracle Cloud Messaging Service are displayed in the Oracle Cloud view, as shown in Figure: Oracle Cloud Messaging Service Elements.

Oracle Cloud Messaging Service Elements

## How to Use Oracle Messaging Cloud Services

Information is transmitted between clients as messages. At the sending client, a producer sends a message to a destination. At the receiving client, a consumer retrieves the message from the destination.

The Oracle Cloud view displays the messaging elements:

- Queues. Messages sent to a queue are received by one and only one consumer.

- Topics. Messages sent to a topic may be received by multiple consumers or none.

  Queues and topics are types of destination.

- Message Push Listeners. Messages sent to a destination can be pushed to either another destination or to a user-defined URL through message push listeners.

- Durable Subscriptions store all messages sent to a topic. They ensure that a publish/subscribe application receives all sent messages, even if there is no client currently connected to the topic.

The options available from context menu are:

- New to create a new queue, topic, message push listener, or durable subscription.

- Delete which deletes the selected element.

- Send Message (Queue) which opens a dialog that allows you to send a test message to the selected queue.

- Properties (Message Push Listeners and Durable Subscriptions) which displays a read-only view of the listener or durable subscription.

- Refresh (Queue and Durable Subscriptions) refreshes the list.

## How to Create and Send a Message

To create a message to be sent to a destination for one consumer:

1. Right-click Queue and choose New.

2. In the Create New Queue dialog, enter a name for the queue and click OK.

3. Right-click the queue and choose Send Message. In the Send Message to a Queue dialog, enter the content of the message and click OK.

To create a message to be sent to a destination for many consumers or none:

1. Right-click Topic and choose New.

2. In the Create New Topic dialog, enter a name for the topic and click OK.

3. Right-click the topic and choose Publish Message. In the Publish Message to a Topic dialog, enter the content of the message and click OK.

## How to Create a Message Push Listener

Message Push Listeners are used to push messages to another destination or to a user-defined URL.

To create a Message Push Listeners:

1. Right-click Message Push Listeners and choose New.

2. In the New Message Push Listener dialog:

   - Enter a name.

   - Specify the source of the messages: Queue, Topic, Durable Subscription, or None, and enter the name for the source. If you choose Durable Subscription, enter the Client ID.

   - Specify the target for the messages: Queue, Topic, or Push URL. Enter a name for Queue or Topic. If you choose Push URL, enter details of the Push URL:

     - User name.

     - Password for authentication to the URL.

     - Verification token that needs to be returned by the Push URL service

     - A list of name/value pairs that will be sent to the URL as HTTP headers.

3. Click Finish.

## How to Create a Durable Subscription

Durable Subscriptions store all messages sent to a topic.

To create a Durable Subscription:

1. Right-click Durable Subscriptions and choose New.

2. In the New Durable Subscription Listener dialog:

   - Enter a name.

   - Specify the Client ID.

   - Enter the topic name, or click and choose the topic name from the Topic Name dialog. You can limit the topics visible by entering a string in the search field at the top.

3. Click Finish.