> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Replacing channelparameters Spring beans

The `ChannelParameters` objects are used to describe and construct the message channels.
The ChannelParameters contain information about the source file names, file formats, and how they are processed when loading into the datastore.

The `ChannelParameters` objects are defined as Spring beans and can be customized by adding new beans.
These new beans can either create new ChannelParameters or replace existing ones.

The beans are identified by one of three annotations depending on which source they belong to:

| Configuration Class        | Annotation                                        |
| -------------------------- | ------------------------------------------------- |
| ASourceConfig              | `@SourceConfigChannelParametersBean`              |
| AConfigurationSourceConfig | `@ConfigurationSourceConfigChannelParametersBean` |
| ASensiSourceConfig         | `@SensiSourceConfigChannelParametersBean`         |

For example the "sbmDeltaChannelParameter" bean is defined using:

```java theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
	@Autowired
	ASensiSourceConfig sensiSourceConfig;

	@SensiSourceConfigChannelParametersBean
    @Qualifier(SP_QUALIFIER__SBM_DELTA_CHANNEL_PARAMETER)
    @ConditionalOnInMemoryDatabase
    public ACSVSourceConfig.ChannelParameters sbmDeltaChannelParameter() {
		return sensiSourceConfig.channelParametersBuilder(SbmDeltaFileConstants.TOPIC_SENSITIVITIES, SADatastoreConfig.SA_SENSITIVITIES_STORE_NAME, FRTBDataLoadConstants.SB_DELTA_SENSITIVITIES_FILE_PATTERN)
		.fileColumns(SbmDeltaFileConstants.ALL_FIELDS)
		.calculators(sensiSourceConfig.createDeltaCalculators())
		.tuplePublisherFactory(sensiSourceConfig::createSbmDeltaTuplePublisher).build();
	}
```

### Replacing existing ChannelParameters beans

To replace an existing ChannelParameters bean, a new bean is created with the same qualifier. The `@Primary` annotation will ensure that the new bean is
created instead of the old one.

It is often useful to use the old ChannelParameters' fields to fill fields which are unchanged by passing the old bean as a parameter of our new ChannelParameter.

For example, to replace the "sbmDeltaChannelParameter" bean above:

```java theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
    @SensiSourceConfigChannelParametersBean
    @Qualifier(SP_QUALIFIER__SBM_DELTA_CHANNEL_PARAMETER)
    @ConditionalOnInMemoryDatabase
    @Primary
    public ACSVSourceConfig.ChannelParameters customSbmDeltaChannelParameter(ACSVSourceConfig.ChannelParameters sbmDeltaChannelParameter) {
    	return sbmDeltaChannelParameter.toBuilder()
        /* ... */
        .build();
    }
```

With the existence of this bean, the original bean (`sbmDeltaChannelParameter`) will not be created.

### Creating new ChannelParameters beans

New ChannelParameters can be created and will be picked up automatically.
Like the beans defined in `ASourceConfig`, `ASensiSourceConfig`, and `AConfigurationSourceConfig`, these beans should use one of the three annotations above and also provide a qualifier.
For example, to load a custom file into a custom store:

```java theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
	@Autowired
	ASourceConfig sourceConfig;

	@SourceConfigChannelParametersBean
	@Qualifier(SP_QUALIFIER__CUSTOM_STORE_CHANNEL_PARAMETER)
	public ACSVSourceConfig.ChannelParameters customStoreChannelParameter() {
		return sourceConfig.channelParametersBuilder("custom-topic", "custom_store", "custom.file-pattern")
        /* ... */
        .build();
	}
```

### ChannelParameters fields

The ChannelParameters beans contain the following fields:

| Field                 | Description                                              | Mandatory |
| --------------------- | -------------------------------------------------------- | --------- |
| storeName             | Store that will be loaded                                | true      |
| topic                 | Topic name                                               | true      |
| filePatternTopicProp  | File pattern property                                    | true      |
| fileColumns           | The list of columns in the file                          |           |
| riskClass             | Risk class                                               |           |
| fileScanParameters    | File scan parameter                                      |           |
| calculators           | List of column calculators                               |           |
| tuplePublisherFactory | Tuple publisher in form of a function                    |           |
| accumulate            | Set to `true` to accumulate all tuples before publishing |           |
| fileSeparator         | File separator                                           |           |

### Available ChannelParameters Qualifiers

Below are all the qualifiers of existing ChannelParameters beans.

| Topic Name                              | Qualifier                                          | Configuration Class        | Conditional                         |
| --------------------------------------- | -------------------------------------------------- | -------------------------- | ----------------------------------- |
| “FXRates”                               | “fxStoreChannelParameter”                          | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “FXHistorical”                          | “fxHistoricalChannelParameter”                     | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “Scenarios”                             | “scenarioChannelParameter”                         | ASourceConfig              |                                     |
| “LegalEntityAttributes”                 | “legalEntityAttributesChannelParameter”            | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “EquityBuckets”                         | “equityBucketsChannelParameter”                    | ASourceConfig              |                                     |
| “CommodityBuckets”                      | “commodityBucketsChannelParameter”                 | ASourceConfig              |                                     |
| “DrcSecNonCtpBuckets”                   | “drcSecNonCtpBucketsChannelParameter”              | ASourceConfig              |                                     |
| “EQUITY\_BUCKET\_DESCRIPTION”           | “equityBucketsDescriptionChannelParameter”         | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “IMARiskFactors”                        | “imaRiskFactorsChannelParameter”                   | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “IMARiskFactorsHistorical”              | “imaRiskFactorsHistoricalChannelParameter”         | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “PLScenarios”                           | “plScenarioStoreChannelParameter”                  | ASourceConfig              |                                     |
| “PLSummaryScenarios”                    | “plSummaryScenarioStoreChannelParameter”           | ASourceConfig              |                                     |
| “DRCScenarios”                          | “drcScenarioChannelParameter”                      | ASourceConfig              |                                     |
| “CSR\_BUCKET\_DESCRIPTION\_NONSEC”      | “csRNSBucketDescriptionChannelParameter”           | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “CSR\_BUCKET\_DESCRIPTION\_SECNONCTP”   | “csrSecNonCtpBucketsDescriptionChannelParameter”   | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “CSR\_BUCKET\_DESCRIPTION\_SECCTP”      | “csrSecCtpBucketDescriptionChannelParameter”       | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “StressCalibrationScenarios”            | “stressCalibrationChannelParameter”                | ASourceConfig              |                                     |
| “FXRates”                               | “fxLocalCloneChannelParameter”                     | ASourceConfig              | `@ConditionalOnDirectQueryDatabase` |
| “BookParentChild”                       | “bookParentChildChannelParameter”                  | ASourceConfig              |                                     |
| “LegalEntityParentChild”                | “legalEntityParentChildChannelParameter”           | ASourceConfig              |                                     |
| “RiskFactorDescriptionOverrides”        | “riskFactorDescriptionChannelParameter”            | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “UnderlyingDescriptionOverrides”        | “underlyingDescriptionOverridesChannelParameter”   | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “ObligorOverrides”                      | “obligorOverridesChannelParameter”                 | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “TrancheOverrides”                      | “trancheOverridesChannelParameter”                 | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “RRAOOverrides”                         | “rraoOverridesChannelParameter”                    | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “LegalEntityImports”                    | “inMemoryLegalEntityImportsChannelParameter”       | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “LegalEntityImports”                    | “onDirectQueryLegalEntityImportsChannelParameter”  | ASourceConfig              | `@ConditionalOnDirectQueryDatabase` |
| “PLTrades”                              | “plChannelParameter”                               | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “PLSummary”                             | “plSummaryChannelParameter”                        | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “DRC\_SCENARIO\_COUNT”                  | “drcScenarioCountChannelParameter”                 | ASourceConfig              |                                     |
| “Trade\_Attributes”                     | “tradeAttributesChannelParameter”                  | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “DRC”                                   | “drcChannelParameter”                              | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “DRC”                                   | “drcTradeChannelParameter”                         | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “DRC\_NONLINEAR\_RECOVERY”              | “drcNonLinearRecoveryChannelParameter”             | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “IMA\_Trades”                           | “imaTradesChannelParameter”                        | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “IMA\_Summary”                          | “imaSummaryChannelParameter”                       | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “IMA\_DRC\_Summary”                     | “imaDrcSummaryChannelParameter”                    | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “StressCalibration\_Trades”             | “stressCalibrationTradesChannelParameter”          | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “EsScenarioFxRates”                     | “esScenariofxStoreChannelParameter”                | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “EsScenarioFxHistorical”                | “esScenariofxHistoricalChannelParameter”           | ASourceConfig              | `@ConditionalOnInMemoryDatabase`    |
| “EsScenarioFxRates”                     | “esScenarioFxLocalCloneChannelParameter”           | ASourceConfig              | `@ConditionalOnDirectQueryDatabase` |
| “SeniorityDescription”                  | “seniorityDescriptionChannelParameter”             | AConfigurationSourceConfig | `@ConditionalOnInMemoryDatabase`    |
| “CommodityBucketRiskWeights”            | “commodityBucketsRiskWeightChannelParameter”       | AConfigurationSourceConfig |                                     |
| “CommodityIntraBucketCorrelations”      | “commodityIntraBucketCorrelationsChannelParameter” | AConfigurationSourceConfig |                                     |
| “DRCWeight”                             | “drcWeightChannelParameter”                        | AConfigurationSourceConfig |                                     |
| “EquityBucketsRiskWeight”               | “equityBucketsRiskWeightChannelParameter”          | AConfigurationSourceConfig |                                     |
| “ERBARiskWeight”                        | “erbaRiskWeightChannelParameter”                   | AConfigurationSourceConfig |                                     |
| “FRTBParameters”                        | “frtbParametersChannelParameter”                   | AConfigurationSourceConfig |                                     |
| “Calendar”                              | “calendarChannelParameter”                         | AConfigurationSourceConfig |                                     |
| “FXDeltaSpecialCrosses”                 | “fxDeltaSpecialCrossesChannelParameter”            | AConfigurationSourceConfig |                                     |
| “GIRRDeltaWeighting”                    | “girrDeltaWeightingChannelParameter”               | AConfigurationSourceConfig |                                     |
| “GIRRMajorCurrency”                     | “girrMajorCurrencyChannelParameter”                | AConfigurationSourceConfig |                                     |
| “InstrumentToLGD”                       | “instrumentToLgdChannelParameter”                  | AConfigurationSourceConfig |                                     |
| “LiquidityHorizons”                     | “liquidityHorizonsChannelParameter”                | AConfigurationSourceConfig |                                     |
| “ObligorToRiskWeight”                   | “obligorToRiskWeightChannelParameter”              | AConfigurationSourceConfig |                                     |
| “OptionResidualMaturityVertices”        | “optionResidualMaturityVerticesChannelParameter”   | AConfigurationSourceConfig |                                     |
| “ParameterSet”                          | “parameterSetChannelParameter”                     | AConfigurationSourceConfig |                                     |
| “VegaRiskWeights”                       | “vegaLiquidityHorizonsChannelParameter”            | AConfigurationSourceConfig |                                     |
| “Vertices”                              | “verticesChannelParameter”                         | AConfigurationSourceConfig |                                     |
| “FXRiskWeightOverrides”                 | “fxRiskWeightOverridesChannelParameter”            | AConfigurationSourceConfig |                                     |
| “GIRRCorrelationOverrides”              | “girrCorrelationOverridesChannelParameter”         | AConfigurationSourceConfig |                                     |
| “SensitivityScaling”                    | “sensitivityScalingChannelParameter”               | AConfigurationSourceConfig |                                     |
| “CSR\_BUCKET\_NONSEC”                   | “csrNsBucketsChannelParameter”                     | AConfigurationSourceConfig |                                     |
| “CSR\_BUCKET\_SECNONCTP”                | “csrSecNonCtpBucketsChannelParameter”              | AConfigurationSourceConfig |                                     |
| “CSR\_BUCKET\_SECCTP”                   | “csrSecCtpBucketsChannelParameter”                 | AConfigurationSourceConfig |                                     |
| “CSR\_BUCKET\_RISK\_WEIGHTS\_NONSEC”    | “csrNsBucketsRiskWeightChannelParameter”           | AConfigurationSourceConfig |                                     |
| “CSR\_BUCKET\_RISK\_WEIGHTS\_SECNONCTP” | “csrSecNonCtpBucketsRiskWeightChannelParameter”    | AConfigurationSourceConfig |                                     |
| “CSR\_BUCKET\_RISK\_WEIGHTS\_SECCTP”    | “csrSecCtpBucketsRiskWeightChannelParameter”       | AConfigurationSourceConfig |                                     |
| “CSR\_Bucket\_Correlations\_NONSEC”     | “csrNsBucketsCorrelationsChannelParameter”         | AConfigurationSourceConfig |                                     |
| “CSRNonSecHighRatings”                  | “csrNonSecHighRatingsChannelParameter”             | AConfigurationSourceConfig |                                     |
| “IMAMultiplier”                         | “imaMultipleChannelParameter”                      | AConfigurationSourceConfig |                                     |
| “SBM\_Delta\_Sensi”                     | “sbmDeltaChannelParameter”                         | ASensiSourceConfig         | `@ConditionalOnInMemoryDatabase`    |
| “SBM\_Delta\_Sensi\_Summary”            | “summarySbmDeltaChannelParameter”                  | ASensiSourceConfig         | `@OnInMemoryDatabase`               |
| “SBM\_Vega\_Sensi”                      | “sbmVegaChannelParameter”                          | ASensiSourceConfig         | `@ConditionalOnInMemoryDatabase`    |
| “SBM\_Vega\_Sensi\_Summary”             | “summarySbmVegaChannelParameter”                   | ASensiSourceConfig         | `@OnInMemoryDatabase`               |
| “SBM\_Curvature\_Sensi”                 | “sbmCurvatureChannelParameter”                     | ASensiSourceConfig         | `@OnInMemoryDatabase`               |
| “SBM\_Curvature\_Sensi\_Summary”        | “summarySbmCurvatureChannelParameter”              | ASensiSourceConfig         | `@ConditionalOnInMemoryDatabase`    |
| “CRIF”                                  | “crifChannelParameter”                             | ASensiSourceConfig         | `@ConditionalOnInMemoryDatabase`    |
| “SBM\_Update\_Optionality”              | “updateOptionalityChannelParameter”                | ASensiSourceConfig         | `@ConditionalOnInMemoryDatabase`    |
