# Name mapping configuration

This DataSource configuration item defines how a DataSource application can map namespaces

## add-pattern

`add-pattern` specifies a pattern that maps the namespace of subscription request subjects received by the DataSource application to a different namespace, typically for onward transmission. For example, an Integration Adapter receiving requests for subjects of the form `/FX/<currency-pair>` forward these requests to an external pricing system. The pricing system expects the subjects it receives to have the form `/FXPRICE/<currency-pair>`; you can use `add-pattern` to map such subjects from the one format to the other, as shown in the [first example](#example-1) below.

**Use in:** C, Java

**Syntax:** `add-pattern <backend-pattern> <caplin-platform-pattern>`

**Type:** array of strings

**Default value:** +[none]+

**<a name="example-1"></a>Example:**

```
add-pattern /FXPRICE/* /FX/*
```

The `*` is a wildcard character that means match zero or more characters.

Assume the Integration Adapter referred to above receives a subscription request for the subject `FX/EURUSD`. The subject matches the right hand pattern `/FX/{asterisk}` (because the string `EURUSD` matches the `{asterisk}` in the pattern). The Integration Adapter therefore changes the subject according to the left hand pattern `/FXPRICE/{asterisk}` into `/FXPRICE/EURUSD` It then sends a request for `/FXPRICE/EURUSD` to the external pricing system.

**📌 NOTE**\
You can only put the * wildcard at the beginning or end of a pattern string. For example, `add-pattern /FX/E*R /FXPRICE/E*R` isn’t valid.
