---
schema_version: "1"
id: 81885ae12332fbaaeaf1020b3dac567e3ca299a917d839613dc9a05f8bdd3c46
title: Accessing New Features from Legacy Modules
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/mule-sdk/latest/forward-compatibility-helper.md
canonical_url: https://docs.mulesoft.com/mule-sdk/latest/forward-compatibility-helper
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 7423c174788863d88ac0d748d6177f0fdf67384ef9147d2e1bc95e3bdd45eb28
description: MuleSoft Documentation Site
release: "1.13"
latest: true
---
---
product: Mule SDK
version: 1.13
is-latest-version: true
---

# Accessing New Features from Legacy Modules

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

The `ForwardCompatibilityHelper` interface enables modules using legacy
`org.mule.runtime.extension.api` types to access features normally exposed as implicit parameters,
such as distributed tracing, without breaking compatibility with earlier Mule runtime versions. For
new modules built entirely with `org.mule.sdk.api`, consume these features directly through implicit
parameters instead.

`ForwardCompatibilityHelper` is defined in the `org.mule.sdk:mule-sdk-compatibility-api` artifact,
in the `org.mule.sdk.compatibility.api.utils` package. This artifact supports both the legacy
`org.mule.runtime.extension.api` types and the new `org.mule.sdk.api` types, which allows
translations between them.

## Use the Compatibility Helper

Use `ForwardCompatibilityHelper` if:

- Your module uses legacy `org.mule.runtime.extension.api` types

- You want to add support for new features (like distributed tracing) without forcing users to
  upgrade their Mule Runtime

- You need to bridge between legacy API types and new SDK API types

### Inject ForwardCompatibilityHelper

To use `ForwardCompatibilityHelper`, inject it as an `Optional` in your component:

```java
import org.mule.sdk.compatibility.api.utils.ForwardCompatibilityHelper;
import javax.inject.Inject;
import java.util.Optional;

public class MyOperations {

  @Inject
  private Optional<ForwardCompatibilityHelper> forwardCompatibilityHelper;

  public void myOperation(CorrelationInfo correlationInfo) {
    if (forwardCompatibilityHelper.isPresent()) {
      // Use the helper on Mule 4.5.0+
      DistributedTraceContextManager traceManager =
          forwardCompatibilityHelper.get().getDistributedTraceContextManager(correlationInfo);
      // Use traceManager...
    } else {
      // Fallback for older runtimes where the helper is not available
    }
  }
}
```

The `Optional` field contains an instance on Mule 4.5.0 and later. On earlier Mule runtime versions,
the `Optional` field is empty.

## Available Methods

`ForwardCompatibilityHelper` provides the following methods to access the
`DistributedTraceContextManager` for distributed tracing:

<table><colgroup><col> <col></colgroup><thead><tr><th>Method</th><th>Usage</th></tr></thead><tbody><tr><td><div><div><p><code>getDistributedTraceContextManager(CorrelationInfo correlationInfo)</code></p></div></div></td><td><div><div><p>For use in operations. Accepts the legacy <code>org.mule.runtime.extension.api.runtime.parameter.CorrelationInfo</code> parameter type.</p></div></div></td></tr><tr><td><div><div><p><code>getDistributedTraceContextManager(org.mule.sdk.api.runtime.parameter.CorrelationInfo correlationInfo)</code></p></div></div></td><td><div><div><p>For use in operations. Accepts the new SDK API <code>CorrelationInfo</code> parameter type.</p></div></div></td></tr><tr><td><div><div><p><code>getDistributedTraceContextManager(SourceCallbackContext sourceCallbackContext)</code></p></div></div></td><td><div><div><p>For use in sources.</p></div></div></td></tr></tbody></table>

## See Also

- [Forward Compatibility Patterns](https://docs.mulesoft.com/mule-sdk/latest/forward-compatibility-patterns)

- [Implicit Parameters](https://docs.mulesoft.com/mule-sdk/latest/forward-compatibility-implicit-params)

- [SDK Forward Compatibility](https://docs.mulesoft.com/mule-sdk/latest/forward-compatibility)
