Configuring Queues

A queue on an event broker acts as both a destination that clients can publish messages to and as an endpoint that clients can consume messages from. Queues may be used in a point-to-point (PTP) messaging environment, and they can have topic subscriptions so that messages published to matching topics are delivered to the queue. For general information about queues, see Topic Endpoints and Queues, and for in-depth information, see Queues.

You can divide queues into partitions to ensure that messages with similar contexts are always processed by the same consumer in an environment using dynamic microservices. For more information, see Configuring Partitioned Queues.

This topic includes the following tasks:

Creating a Queue

To create a queue using PubSub+ Broker Manager, perform these steps:

  1. Open Broker Manager. For instructions, see Using PubSub+ Broker Manager.
  2. Select Queues in the left navigation bar.
  3. Click + Queue.

    Screenshot showing the options described in the surrounding text.

  4. Enter a name for the queue and click Create.
  5. Set the following options for the queue:

    Setting Description

    Incoming

    Specifies whether messages can be written to the queue.

    Outgoing

    Specifies whether messages can be consumed from the queue.

    Access Type

    Specifies how messages are delivered when multiple consumer flows are bound to the queue.

    • Exclusive specifies that only one consumer can receive a message at any one time, while additional consumers may be connected as standby. Only the first consumer to bind can receive messages. If the first consumer disconnects, the second consumer receives data, and so on. Exclusive queues always deliver messages in the order they are received.
    • Non-Exclusive specifies that multiple consumers can bind to the queue, which enables load balancing and consumer auto-scaling. A non-exclusive queue can be non-partitioned or partitioned.
      • For a non-partitioned queue (partition count is zero), each consumer is serviced in a round-robin fashion. If a connection fails, unacknowledged messages are delivered to another consumer with the re-delivered flag set. In this way, messages can be delivered to consumers out of order.
      • For a partitioned queue (partition count is greater than zero), each consumer is delivered messages from one or more partitions. Messages are mapped to partitions based on a hash of the partition key, which is set by the publishing application. Message order is maintained within a partition, but not between partitions.
    Partition Count

    Specifies the number of partitions for the queue. For more information, see Configuring Partitioned Queues.

    This setting is available only for event broker services version 10.4 and later when the Access Type is set to Non-Exclusive.

    Messages Queued Quota

    Specifies the maximum amount of message data, in MB, that can be spooled in the queue.

    Owner

    The queue owner has full unlimited permissions for the queue. The owner can consume, delete, or modify topics in the queue. By default, users with access to PubSub+ Broker Manager have ownership privileges. You can also give ownership to client applications.

    Non-Owner Permission

    Specifies the access level given to client applications other than the queue owner:

    • No Access—Disallows all access.

    • Read Only—Clients have read-only access to messages spooled to the queue.

    • Consume—Clients can consume and delete messages from the queue.

    • Modify Topic—Clients can consume and delete messages and modify the topic or selector assigned to the queue.

    • Delete—Clients can consume and delete messages, modify the topic or selector assigned to the queue, and delete the queue.

    Maximum Consumer Count

    Specifies the maximum number of consumer flows that can bind to the queue.

  6. Click Apply.

Adding a Subscription to a Queue

Subscriptions define the topics that queues receive messages for. Queues can have multiple topic subscriptions. To add one or more topic subscriptions to a queue, perform these steps: 

  1. Open Broker Manager. For instructions, see Using PubSub+ Broker Manager.
  2. Select Queues in the left navigation bar.
  3. Click the name of the queue.
  4. Click the Subscriptions tab.
  5. Click + Subscription.
  6. Enter the topics that you want to add subscriptions for.
  7. Click Create.
  8. The subscriptions are added to the queue.

Configuring Message Delivery Options

Queues have advanced settings that define how the queue behaves in certain situations. These options include:

Setting Description

Delivery Delay

Specifies the number of seconds of delay between the message arriving in the queue and being sent to the consumer. For more information, see Delayed Delivery. The default is 0, or no delay.

Respect Message Priority

Specifies whether the queue supports priority message delivery and delivers higher priority messages first. For more information, see Message Priority.

Message Expiry

Specifies whether messages that have not been delivered to the consumer expire at the end of the message time-to-live (TTL). If a message is not consumed and its TTL time is reached, the message is discarded or moved to a dead message queue (DMQ). Message expiry has two settings:

  • Respect TTL—specifies whether the queue acts on TTL values set for either the queue or by the message publisher.

  • Maximum TTL—specifies the TTL that the queue applies to messages when the message arrives in the queue. A value of 0 means that the queue does not impose a limit.

Messages can also have a publisher-supplied TTL, which indicates how long the publisher considers a message to be valid. This differs from the maximum TTL for the queue in that the publisher TTL expiration starts when a message is published and counts down as the message passes through the network. If a message has both a publisher-assigned TTL and a queue-assigned maximum TTL, the event broker uses the minimum of the two TTL values when the message is in the queue.

Redelivery

Specifies the options for message redelivery attempts if the message is not delivered to the consumer on the first attempt.

Disabling message redelivery and enabling delayed redelivery are a Controlled Availability (CA) features. Please contact Solace to find out if those feature are supported for your use case.

Redelivery has the following settings:

  • Try Forever—specifies that the queue attempts to deliver the message to the consumer until delivery is successful. This is the default.

  • Maximum Redelivery Count—specifies the maximum number of times the queue attempts to deliver the message to the consumer. This value is respected only if Try Forever is not selected. If the message is not delivered successfully after the specified number of attempts, the message is discarded or is moved to a dead message queue (DMQ).

  • Delayed Redelivery—specifies whether the queue waits between message redelivery attempts. This option is disabled by default.

  • Initial Delay— if Delayed Redelivery is selected, specifies the delay in milliseconds before the first redelivery attempt. The default is 1000 milliseconds (one second).

  • Multiplier— if Delayed Redelivery is selected, specifies the multiplier for each subsequent delay. For example, if the Initial Delay is 1000 milliseconds (one second), and the multiplier is 2.00, the queue waits for two second before the second redelivery attempt, four seconds, before the following attempt, and so on until the Maximum Delay is reached. You can set a value between 1.00 and 5.00.

  • Maximum Delay— if Delayed Redelivery is selected and the Multiplier is set to a value greater than 1.00, specifies the maximum delay in milliseconds.

DMQ Name

The name of the dead message queue (DMQ) used by this queue. The default is #DEAD_MSG_QUEUE. Solace recommends using a separate DMQ for each queue and topic endpoint that requires one and setting the DMQ name to the name of the queue, followed by "_dmq", for example MyQueue_dmq.

A DMQ collects undelivered messages that would otherwise be discarded from the queue because the Maximum TTL or Maximum Redelivery Count has been reached.

Messages are sent to a DMQ only if the publisher specifies that the message is DMQ-eligible and if a queue with the specified DMQ name exists on the same event broker service. For more information, see Configuring Dead Message Queues.

To configure advanced queue settings perform these steps:

  1. Open Broker Manager. For instructions, see Using PubSub+ Broker Manager.
  2. Select Queues in the left navigation bar.
  3. Click the name of the queue.

  4. Click Edit .

    Screenshot showing the options described in the surrounding text.

  5. Click Show Advanced Settings.

    Screenshot showing the options described in the surrounding text.

  6. (Optional) To set a delivery delay, enter a value in the Delivery Delay (sec) field.
  7. (Optional) To respect message priorities set by the publisher, click the Respect Message Priority toggle to enable it.
  8. (Optional) To respect message expiry limits set by the publisher and the queue, click the Respect TTL toggle to enable it and, optionally, set a value in the Maximum TTL (sec) field. A value of 0 for the Maximum TTL means that the queue does not impose a maximum TTL but may still respect a TTL set by the publisher.
  9. (Optional) To set a limit on the number of redelivery attempts, click the Try Forever toggle to disable it and then set the redelivery options you require.
  10. (Optional) If you want messages that have reached the Maximum TTL or Maximum Redelivery Count to be sent to a DMQ rather than discarded, specify the name of another queue on your event broker service as the DMQ Name. For more information see Configuring Queues.
  11. When you have finished configuring the queue, click Apply.