Loopback Binding

The Loopback binding enables in-process message exchange between Talon microservices for testing and development.

Overview

The platform's Loopback binding can be used to send messages to other applications running in the same process, not across different processes. This binding is often used for unit testing in which 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 may exchange messages with one another.

For configuration details, see Loopback Binding Configuration.

Loopback Bus Topic Format

Loopback bus topics can be specified hierarchically with each level in the topic separated by a / character. A valid loopback topic may start with a /, but it is not required.

Example topics:

  • orders/events

  • /market-data/trades

  • alerts/critical/region1

Wildcard Topics

The loopback bus supports 2 wildcard character sequences that can be used in channel filters to match multiple sending topics. Wildcards are not applied to sent topics (treated as literals).

The Loopback binding preserves these wildcards when nv.sma.cleanchannelfilter=true:

Wildcard
Description
Example

*

Matches 0 or more characters within a topic level

orders/gin matches: - orders/gin - orders/begin - orders/ginseng - orders/beginning Does not match: - orders - orders/in

...

Matches multiple topic levels. Must be used as the last level in a topic filter string.

orders/... matches: - orders/events/MSFT - orders/updates/APPL - orders/cancels/US/IBM Does not match: - orders - order-updates

Use Cases

The Loopback binding is primarily used for:

  • Unit Testing - Test multiple microservices in a single process without requiring external message infrastructure

  • Development - Simplify debugging by running multiple applications in the same JVM

  • Integration Testing - Test microservice interactions without network dependencies

  • Configuration Flexibility - Use property substitution to default to loopback for testing but switch to production message buses at runtime

See Also

Last updated