Add Custom MDCs

Custom MATRIXX Data Containers (MDCs) that you create during MATRIXX Engine configuration are defined in the /opt/mtx/conf/mdc_config_custom.xml file. You must add these custom MDC definitions and any custom REST API MDCs to the extension project.

About this task

Adding the custom RS Gateway MDC objects to the extension project ensures they are auto-generated when you build the project. In the following task, project_name is the name of the project that you created during installation.
Important: A custom MDC file can be loaded in My MATRIXX or be saved in /opt/mtx/conf/mdc_config_custom.xml, but not both. If there is no file in /opt/mtx/conf/mdc_config_custom.xml, you should export the file from My MATRIXX.

Procedure

  1. Define custom MDCs in the /opt/mtx/conf/mdc_config_custom.xml file.
    Create the ConfigMap with Helm using the mymatrixx.configuration.container.configmap configuration option. All keys in this option represent files to create. The following shows how to define an mdc_config_custom.xml file for My MATRIXX.
    mymatrixx:
      configuration:
        container:
          configmap:
             mdc_config_custom.xml: |-
              <?xml version="1.0" encoding="iso-8859-1"?>
              # Rest of the contents of the file
  2. Edit the file projects/project_name/src/main/resources/extension-rest-mdc.xml file and add any custom REST MDCs to the file.
    For example, add the request/response MDC definitions for a custom demo subscriber query.
    <container id="DemoRequestSubscriberQuery">
        <created_schema_version>5100</created_schema_version>
        <doc_description>Request to cancel add-ons</doc_description>
        <base_container id="5100">MtxRequestSubscriberQuery</base_container>
        <storage_size>large</storage_size>
      </container>
    
      <container id="DemoResponseSubscriberQuery">
        <created_schema_version>5100</created_schema_version>
        <doc_description>Request to cancel add-ons</doc_description>
        <base_container id="5100">MtxResponseSubscriber</base_container>
        <storage_size>large</storage_size>
      </container>
    

    These request and response objects are used in the Demo Subscriber Query API provided in the archetype. This API converts the Demo object into an MtxRequestSubscriberQuery object and forwards the request.

    Note: If you use the MDCs only for the extension project, add them to the extension-rest-mdc.xml file. It is not necessary to add them to the mdc_config_custom.xml file.
  3. In the extension-rest-mdc.xml file, define a container_relationship between the request and response MDCs created in step 3.
    Add the container_relationship XML node if it does not already exist. Then, inside that node, define a relationship_id:
    <container_relationship id='op_return_type'>
        ...
            <relationship id='DemoRequestSubscriberQuery'>
                <target_container>DemoResponseSubscriberQuery</target_container>
            </relationship>
        ...
    </container_relationship>
  4. Save the files.