---
schema_version: "1"
id: b7d14592d159cc68c39ed7331783216d9c83d6e8c154e3e8d1534a915be6150f
title: Dynamic Ports
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/munit/3.6/dynamic-ports.md
canonical_url: https://docs.mulesoft.com/munit/3.6/dynamic-ports
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 71b39706e796a338fa5b82d0ef377f08399c4d42bc0a64f6df61a55e00fa1ce2
description: MuleSoft Documentation Site
release: "3.6"
latest: false
---
---
product: MUnit
version: 3.6
---

# Dynamic Ports

> 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

The Dynamic Ports global element allows you to bind a free port to a property. It searches for a
free port available and can be narrowed to a specific range.

For example, a dynamic port would look something like this:

```xml
<munit:dynamic-port propertyName="a.dynamic.port"/>
```

And it can be used in the http configuration:

```xml
<http:request-config name="httpRequestConfig">
    <http:request-connection host="localhost" port="${a.dynamic.port}"/>
</http:request-config>
```

Additionally you can set min and max values from where to get the port:

```xml
<munit:dynamic-port propertyName="a.dynamic.port" min="6000" max="7000"/>
```

## See Also

- [Dynamic Directories](https://docs.mulesoft.com/munit/3.6/dynamic-directories)

- [Storage Event Processors](https://docs.mulesoft.com/munit/3.6/storage-event-processors)
