> For the complete documentation index, see [llms.txt](https://docs.rumi.systems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rumi.systems/rumi-core/guides/developing-applications/configuring-messaging/configuring-bus-connections/loopback-binding.md).

# Loopback Binding

Configuration reference for the Loopback message bus binding.

## Overview

The Loopback binding enables message exchange between applications running in the **same process**. This binding is primarily used for unit testing where several applications may be launched in the same process for easy debugging.

When you configure a bus binding to use a loopback bus, a LoopbackBus instance is statically created on demand using the address provided by the binding. Two applications that connect to a loopback bus with the same name can exchange messages with one another.

For conceptual information about the Loopback binding, see [Loopback Binding](/rumi-core/concepts/messaging-model/loopback-binding.md).

{% hint style="warning" %}
The Loopback binding **only works within the same process**. It cannot be used for inter-process communication.
{% endhint %}

## Bus Descriptor Format

Loopback buses can be configured using a descriptor string or decomposed DDL format.

### Descriptor String

```
loopback://<busname>&prop1=val1&propN=valN
```

**Example**:

```
loopback://my-bus&topic_starts_with_channel=false&set_bus_and_channel_on_receipt=true
```

### Decomposed DDL Format

```xml
<buses>
  <bus name="my-bus">
    <provider>loopback</provider>
    <address>my-bus</address>
    <properties>
      <topic_starts_with_channel>false</topic_starts_with_channel>
      <set_bus_and_channel_on_receipt>true</set_bus_and_channel_on_receipt>
    </properties>
    <channels>
      <!-- channel configuration -->
    </channels>
  </bus>
</buses>
```

### As Descriptor (Substitution Support)

The descriptor form is useful when the descriptor name may be supplied as an external configuration property that is substituted at runtime, but defaults to loopback for testing:

```xml
<buses>
  <bus name="my-bus" descriptor="${myBusDescriptor::loopback://my-bus&topic_starts_with_channel=false}">
    <channels>
      <!-- channel configuration -->
    </channels>
  </bus>
</buses>
```

This example defaults to loopback but can be overridden at runtime with a different bus descriptor (e.g., Solace) via the `myBusDescriptor` property.

## Binding Specific Properties

The Loopback binding does not have any binding-specific properties beyond the [general bus properties](/rumi-core/guides/developing-applications/configuring-messaging/configuring-bus-connections.md) (such as `topic_starts_with_channel`, `set_bus_and_channel_on_receipt`, etc.) that apply to all message bus bindings.

## Loopback Bus Naming

When working with loopback buses, it is sometimes useful to be able to look up a loopback bus by name. Loopback buses are named using their address (and optionally their port).

If you have configured a loopback bus via `loopback://my-bus`, you can look up the bus as follows:

```java
LoopbackBus bus = LoopbackBus.getInstance("my-bus");
StringBuilder dump = new StringBuilder();
bus.dumpPendingAck(dump);
System.out.println(dump.toString());
```

{% hint style="info" %}
**Port Numbers and the Loopback Bus**

A loopback bus does not require a port to be specified in its configuration. If you do configure a loopback bus with a port, the name of the loopback bus will include the port.

For example, if you specify `loopback://my-bus:80`, the name of the bus will be `my-bus:80`. One consequence of this is that `loopback://my-bus:80` and `loopback://my-bus:90` represent 2 separate buses which cannot communicate with one another.

Other than contributing to the name of the bus, the port has no functional significance.
{% endhint %}

## See Also

* [Loopback Binding](/rumi-core/concepts/messaging-model/loopback-binding.md) - Conceptual overview
* [Configuring Bus Connections](/rumi-core/guides/developing-applications/configuring-messaging/configuring-bus-connections.md) - General bus configuration
