# Configure container usage in Liberator

Here’s an example of how to configure Liberator to handle subscription requests for a [container](../datasource/datasource-containers.md).

## Simple configuration

This configuration follows the architectural example shown in [How containers work](../datasource/datasource-how-containers-work.md). Requests for the container `/CTR/FI/ALL` are routed to an [Integration Adapter](../platform-architecture/putting-data-into-the-platform.md) called **FIDataSource** that supplies both the container and the data that populates it.

```
xref:../datasource/datasource-datasource-peers-configuration-part-1.md#add-peer[add-peer]
   remote-name  FIDataSource
   xref:../datasource/datasource-datasource-peers-configuration-part-1.md#remote-label[remote-label] FIDataSource
   remote-type  active       
end-peer

xref:../datasource/datasource-data-services-configuration.md#add-data-service[add-data-service]
   xref:../datasource/datasource-data-services-configuration.md#service-name[service-name]         ContainersFI
   xref:../datasource/datasource-data-services-configuration.md#include-pattern[include-pattern]      ^/CTR/FI/
   add-source-group
      required          TRUE
      xref:../datasource/datasource-data-services-configuration.md#add-priority[add-priority]
         xref:../datasource/datasource-data-services-configuration.md#remote-label[remote-label]   FIDataSource
      end-priority
   end-source-group
end-data-service

add-data-service
   xref:../datasource/datasource-data-services-configuration.md#service-name[service-name]         InstrumentsFI
   xref:../datasource/datasource-data-services-configuration.md#include-pattern[include-pattern]      ^/FI/
   add-source-group
      required          TRUE
      xref:../datasource/datasource-data-services-configuration.md#add-priority[add-priority]
         xref:../datasource/datasource-data-services-configuration.md#remote-label[remote-label]   FIDataSource
      end-priority
   end-source-group
end-data-service
```

The first [`add-data-service`](../datasource/datasource-data-services-configuration.md#add-data-service) item (service `ContainersFI)` deals with subscriptions to the container. The container subject `/CTR/FI/ALL` matches the `[include-pattern](../datasource/datasource-data-services-configuration.md#include-pattern) ^/CTR/FI/`, so the required data service is `ContainersFI`. The data service definition has a single [`add-priority`](../datasource/datasource-data-services-configuration.md#add-priority) item with the `[remote-label](../datasource/datasource-data-services-configuration.md#remote-label) FIDataSource`, which directs the Liberator to the Integration Adapter called **FIDataSource.** FIDataDource is defined in the [`add-peer`](../datasource/datasource-datasource-peers-configuration-part-1.md#add-peer) item with the matching [`remote-label`](../datasource/datasource-datasource-peers-configuration-part-1.md#remote-label) called `FIDataSource`. So the Liberator sends a subscription request for the container `/CTR/FI/ALL` to the FIDataSource Integration Adapter.

The second [`add-data-service`](../datasource/datasource-data-services-configuration.md#add-data-service) item (service `InstrumentsFI`) deals with subscriptions for the data in the container. For example, a request for the container element with subject `/FI/A`, matches the `[include-pattern](../datasource/datasource-data-services-configuration.md#include-pattern) ^/FI/`, so the data service that can supply the data for the subject `/FI/A` is `InstrumentsFI`. The data service definition has a single [`add-priority`](../datasource/datasource-data-services-configuration.md#add-priority) item with the `[remote-label](../datasource/datasource-data-services-configuration.md#remote-label) FIDataSource`, so this directs the Liberator to the FIDataSource Integration Adapter as the source of the container’s data.

**📌 NOTE**\
For simplicity, this example configuration doesn’t include [failover](../platform-architecture/failover.md) within the data services, which you would most likely need in a production deployment. For example, see How can I... [Set up server failover capability](../deployment-framework/cdf-set-up-server-failover-capability.md) in the [Deployment Framework](../deployment-framework/index.md) pages.

**📌 NOTE**\
For an example of a more complex container-related configuration, see How Can I... [Obtain container data from several sources](../datasource/datasource-obtain-container-data-from-several-sources.md)

## Mapping containers

You can map the name of a container within Liberator in the same way as other subject names (see [Object mapping](liberator-object-mapping.md)). For example, a client request for the container `/CTR/FI/ALL` could be mapped to a request for `/CTR/FI/ALL/<tier>`, where `<tier>` is the price tier for the requesting user. When the mapped request is passed to the DataSource application that supplies the container, the DataSource application can respond by populating the container with just the instruments that can be traded within the indicated price tier.

In this example, the mapping would typically be done by a [Liberator Auth module](liberator-user-authentication-and-permissioning.md) that determines users' price tiers. You can also set up simple mappings in Liberator using the [`object-map`](liberator-object-configuration-part-2.md#object-map) configuration item.

---

**See also:**

* [Container features and concepts](../datasource/datasource-containers.md)
* [How containers work](../datasource/datasource-how-containers-work.md)
* Filtering and sorting containers using [Transformer’s Refiner Service blade](../transformer/transformer-refiner-overview.md)
* How can I... [Create containers in an Integration Adapter](../datasource/datasource-create-containers-in-an-integration-adapter.md)
* How can I... [Obtain container data from several sources](../datasource/datasource-obtain-container-data-from-several-sources.md)
* How can I... [Obtain a container snapshot in a CSV or XLSX file](liberator-obtain-a-container-snapshot-in-a-csv-or-xlsx-file.md)
* Reference: [DataSource peers configuration](../datasource/datasource-datasource-peers-configuration-part-1.md)
* Reference: [Data services configuration](../datasource/datasource-data-services-configuration.md)
* Reference: [Object configuration](liberator-object-configuration-part-1.md)
