Configuring Queues in a SOW
This section outlines the configuration parameters for queues. AMPS provides three distinct types of queues, each designed for specific use cases: Queue
, LocalQueue
, and GroupLocalQueue
.
Defining Queue Replication Type
Queues are defined within the SOW
element using the tags Queue
, LocalQueue
, or GroupLocalQueue
. The tag that encloses a queue definition specifies the queue replication type. Full details can be found in the Queue Replication Types section.
To summarize:
Queue
tag: Defines a distributed queue. The queue may be consumed from any instance hosting the queue, and all instances that accept publishes for queue messages must host the queue.LocalQueue
tag: Defines a queue limited to the local instance only. This queue is independent of any other instance.GroupLocalQueue
tag: Defines a queue restricted to a subset of instances in a replicated set, typically all within the same group. This queue is hosted by some, but not all, instances in the replicated fabric.
AMPS accepts QueueDefinition
as a synonym for Queue
.
Queue Configuration
Described below are the configuration items that apply to queues regardless of whether they are fully distributed, local, or distributed within a replication group. Expand each item for more details.
Managing Queue Metadata
Described below are the configuration items for managing queue metadata. Expand each item for more details.
Group Local Queue Configuration
When a queue is defined as a GroupLocalQueue
the following configuration item must be provided in addition to the mandatory elements above. Expand the item for more details.
When a queue is defined as a GroupLocalQueue
, the following optional configuration element may be provided. Expand the item for more details.
The following configuration snippet shows one way to configure a queue:
<!-- Notice that the topics to use for the queue (ORDERS_.*) must be
recorded in a transaction log. -->
<SOW>
<Queue>
<Name>MQ</Name>
<MessageType>json</MessageType>
<UnderlyingTopic>ORDERS_.*</UnderlyingTopic>
<DefaultPublishTarget>ORDERS_DIRECT</DefaultPublishTarget>
<LeasePeriod>60s</LeasePeriod>
<Expiration>1d</Expiration>
<MaxBacklog>3</MaxBacklog>
</Queue>
</SOW>
The following configuration snippet shows the configuration for a GroupLocalQueue
. Any instance of the queue in the group named CONSUME_INSTANCES
or that uses the GroupLocalQueueDomain
tag of CONSUME_INSTANCES
will be treated as an instance of the same queue.
<SOW>
<GroupLocalQueue>
<Name>GroupQueue</Name>
<MessageType>json</MessageType>
<UnderlyingTopic>ORDERS_.*</UnderlyingTopic>
<DefaultPublishTarget>ORDERS_DIRECT</DefaultPublishTarget>
<GroupLocalQueueDomain>CONSUME_INSTANCES</GroupLocalQueueDomain>
</GroupLocalQueue>
</SOW>
Last updated