---
schema_version: "1"
id: cb283125eca7ea035349e04919fb6a753a2dbbe7560a12ccccd7574f0ebeaaf6
title: MUnit Queue Event Processors
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/munit/latest/queue-processors.md
canonical_url: https://docs.mulesoft.com/munit/latest/queue-processors
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 20899a5e42fc383f5ef5e21821650f6de0837527b83c4af7a70eed1654dfd4e4
description: MuleSoft Documentation Site
release: "3.7"
latest: true
---
---
product: MUnit
version: 3.7
is-latest-version: true
keywords: munit, testing, unit testing, queue
---

# MUnit Queue Event Processors

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

![logo acb active](/mulesoft/current/en-us/_/img/icons/anypoint-code-builder.svg "Anypoint Code Builder")Anypoint Code
Builder

![logo studio active](/mulesoft/current/en-us/_/img/icons/studio.svg "Anypoint Studio")Anypoint Studio

MUnit Queue event processors manage temporary in-memory queues during MUnit test runs, letting you
enqueue and dequeue values to test asynchronous flows. All queues are cleared automatically when
each test ends.

## Queue

Adds the value to the queue. If not specified, the value is taken from the `payload`.

```xml
<munit-tools:queue>
    <munit-tools:value>#[1]</munit-tools:value>
</munit-tools:queue>
```

You can specify the queue’s name to which the value should be added. If not specified, the default
queue will be used.

```xml
<munit-tools:queue queueName="CUSTOM_QUEUE_1">
    <munit-tools:value>#[1]</munit-tools:value>
</munit-tools:queue>
```

## Dequeue

Removes the last element of the queue, if the queue is empty, it waits until an element is queued.

```xml
<munit-tools:dequeue/>
```

You can specify a timeout when waiting for an element to be queued:

```xml
<munit-tools:dequeue timeout="1000" timeoutUnit="SECONDS"/>
```

Like the queue operation, you can specify the queue’s name from which to dequeue. If not specified,
the default queue will be used.

```xml
<munit-tools:dequeue queueName="CUSTOM_QUEUE_1"/>
```

## Queue Size

Function that obtains the queue size.

```xml
<munit-tools:assert-that expression="#[MunitTools::queueSize()]" is="#[MunitTools::equalTo(2)]" />
```

Like the other operations, you can specify the queue from which to the get the size. If not
specified, the default queue will be used.

```xml
<munit-tools:assert-that expression="#[MunitTools::queueSize('CUSTOM_QUEUE_1')]" is="#[MunitTools::equalTo(2)]" />
```
