Creating and updating a queue by using REST Administration APIs

System administrators can create and update queues by using REST Administration APIs.

You can create and update a queue by using REST Administration APIs, or by using the Amlen WebUI. For more information about using the Amlen WebUI to create or update a queue, see Configuring queues by using the Amlen WebUI.

For more information about the components of a queue, see Configuring message queues.

  1. To create or update a message queue, use the Eclipse Amlen REST API POST method with the following Eclipse Amlen configuration URI:

    http://<admin-endpoint-IP:Port>/ima/v1/configuration/

  2. Provide Queue object configuration data in the payload of the POST method by using the following schema. Content-type is set to application/json. Ensure that capitalization and double quotation marks are used as shown.
    
    {    
      "Queue": {
        "<NameOfQueue>": {
          "Description": "string",
          "AllowSend": true|false,
          "ConcurrentConsumers": true|false,
          "MaxMessages": integer
         } 
       }
    }
    Where:
    NameOfQueue
    Required.
    Specifies a name for the queue.
    The name must not have leading or trailing spaces and cannot contain control characters, commas, double quotation marks, backslashes, or equal signs. The first character must not be a number or any of the following special characters:
    ! # $ % & ' ( ) * + - . / : ; < > ? @
    The name cannot be the same as another queue.
    Description
    Specifies a description of the queue.
    If you do not want a description, omit "Description":"description".
    AllowSend=true|false
    Specifies whether JMS applications can send messages to the queue. It does not stop applications from receiving messages from the queue.
    The default value is true.
    ConcurrentConsumers=true|false
    Specifies whether multiple consumers are allowed to use the queue at the same time.
    The default value is true.
    MaxMessages
    Specifies the maximum number of messages that can be put on the queue. This value is a guideline, rather than an absolute limit. If the system is running under stress, then the number of buffered messages on a queue might be slightly higher than the MaxMessages value.
    This value can be any number in the range 1-20000000.
    The default value is 5000.
The following example demonstrates creating a queue named testQ by using cURL. The queue uses the default values for AllowSend and ConcurrentConsumers, and sets MaxMessages to 1000:

curl -X POST\
   -H 'Content-Type: application/json' \
   -d '{
     "Queue": {
	"testQ": {
	"MaxMessages": 1000
      }
     }
    }
  ' \
http://127.0.0.1:9089/ima/v1/configuration/
The following shows an example response to the POST method.

{        
  "Version": "v1",
  "Code": "CWLNA6011",
  "Message": "The requested configuration change has completed successfully."
}