RESTEasyMOMTopics

The RESTFul Interface for Topics

 

send

POST /topics/{topic-name}?persistent=[true|false]&priority=[0-9+]&timeToLive=[0-9+]

 

Response is 204 NO-CONTENT on success.  All query parameters optional

 

Dedicated Topic Receivers

Dedicated topic receivers are JMS message consumers attached to a specific session.

 

Create a dedicated receiver that you can pull from.

 

PUT /topics/{topic-name}/receivers/{receiver-id}

If you pass an ACCEPT header this will create a JMS selector that filters message for only a specific media type.  So, if you pass an ACCEPT header of 'application/xml' this receiver will only get message of CONTENT-TYPE 'application/xml'

 

 

Delete a dedicated receiver

DELETE /topics/{topic-name}/receivers/{receiver-id} 

 

Get the current message that is in the receiver's buffer.  This does not consume/acknowledge the message

 

GET /topics/{topic-name}/receivers/{receiver-id}/head?wait=[0-9+]

 

Acknowledge the current message that is in the receiver buffer.

 

DELETE /topics/{topic-name}/receivers/{receiver-id}/head

 

FYI, this is idempotent still!

 

get and acknowledge from the receiver at the same time

POST /topics/{topic-name}/receivers/{receiver-id}/head

 

 

 

Topic Message listeners

You can register a URI to post to when a message is sent to this dedicated topic listener.  This registers a MessageListener with the queue.  When the message is received, on the server, it send the message to the registered URI.

 

Create a message listener

 

PUT /topics/{topic-name}/listeners/{listener-id}

You must send a string that is the URI you want to send the message to.  The content-type can be anything, "text/plain" or whatever.

 

If you pass an ACCEPT header this will create a JMS selector that filters message for only a specific media type.  So, if you pass an ACCEPT header of 'application/xml' this receiver will only get message of CONTENT-TYPE 'application/xml'

 

Delete the listener

DELETE /topics/{topic-name}/receivers/{receiver-id}