This function is used to create a queue (message queue entity) in a message broker supporting the AMQP v0.9.1 protocol. This API was validated with RabbitMQ open source message broker software (https://www.rabbitmq.com/).
This function is executed using a configuration file (in YAML format in Windows or Java environments, or in XML format in AS/400 environments), defining the detailed configuration of the handled Adelia logical broker.
A queue is defined by a unique name. Therefore, two queues with the same name but different characteristics cannot be created. A queue can be connected to several exchanges.
A queue can also be connected to the same exchange several times by using different routing keys.
Scope
Cloud client
Java server
Java client
Web client
- Windows client
- Windows server
- AS/400 server
Parameters
ALPHA(n) |
AdeliaLogicalBroker |
Adelia logical broker name. Its parameters (broker, port, etc.) are defined in the AdeliaLogicalBrokersConfig.yaml configuration file. |
ALPHA(n) |
QueueName |
Name of the queue the message will be stored in. |
BOOL |
Durable |
A durable queue is automatically recreated when the message broker restarts. |
BOOL |
AutoDelete |
If the value is *TRUE, the queue which had at least one message consumer client will be deleted when deregistering the last consumer client. |
BOOL |
Exclusive |
An exclusive client is used by a single connection and will be deleted when this connection is closed. |
IMAGE or ALPHA | QueueArguments | Additional parameters used to specify the queue to be created. This parameter must be in JSON format in the form of an object. Its attributes can be:
|
IMAGE or ALPHA |
QueueBinding |
Information about the binding between this queue and other exchanges. This parameter must be in JSON format in the form of an object list. Each object represents a configuration for the binding between this queue and another exchange. Its attributes can be:
|
NUM_BIN_2 |
ReturnCode |
Return code: 0: Successful execution. -1: The QueueArguments parameter is the wrong Adelia type. -2: The QueueBinding parameter is the wrong Adelia type. -3: The AdeliaLogicalBroker parameter must not be empty. -4: The QueueName parameter must not be empty. -5: Error during syntax analysis of the QueueArguments parameter. -6: Error during the JSON transformation of the QueueArguments parameter. -7: Error when reading the QueueArguments parameter. -8: Error during syntax analysis of the QueueBinding parameter. -9: Error during the JSON transformation of the QueueBinding parameter. -10: Error when reading the QueueBinding parameter. -11: Configuration not loaded. No logical broker defined (.YAML file not defined, found or loaded). -12: No configuration defined in the .YAML file for the specified Adelia logical broker. -13: Error when creating the message broker client. -14: Error when creating the entities (exchanges, queues, bindings) defined in the AdeliaLogicalBroker logical broker configuration. 40: Error when declaring the queue in the message broker. 50: Error when declaring bindings between this queue and the exchanges. |
Example 1
myQueue = 'queue1'
* Creation of a non-durable, non-exclusive queue with automatic deletion which is connected by default to the default exchange called "
CALL_DLL 'VaToolBx' 'VaToolBxAMQPCreateQueue 'myLogicalBroker' myQueue *FALSE *TRUE *FALSE *BLANK *BLANK myReturnCode
Example 2
myQueue = 'queue1'
myQueueBinding = [{"exchange": "directExchange1", "routingKey": "routeOne"}, {"exchange": "topicExchange1", "routingKey": "topicOne.*"}]
* Creation of a queue connected to the directExchange1 exchange with the ' routeOne ' routing key connected to the Exchange1 topic exchange with the routing key ' topicOne .* '
CALL_DLL 'VaToolBx' 'VaToolBxAMQPCreateQueue' 'myLogicalBroker' myQueue *FALSE *TRUE *FALSE *BLANK myQueueBinding myReturnCode
List of VaToolBx DLL functions by theme