Skip to content
Kyle Knoepfel edited this page Dec 22, 2021 · 3 revisions

Version 2.0 of the decision engine supports sources that are shared among channels. This sharing ensures that all channels receive consistent data without duplicating the effort required to obtain it. In order for a source to be shared among channels, the name of a source and its corresponding configuration must be identical in the channels that use it.

Example: shared sources

Consider the configurations for channels A and B:

A.jsonnet B.jsonnet
{
  sources: {
    s1: {
      module: "my.source1",
      parameters: {
        a: 1,
        b: null,
      },
    },
    s2: {...},
  },
  transforms: {...},
  publishers: {...}
}
{
  sources: {
    s1: {
      module: "my.source1",
      parameters: {
        a: 1,
        b: null,
      },
    },
    s3: {...}
  },
  transforms: {...},
  publishers: {...}
}

In this example, because s1 is configured identically for channels A and B, it will be shared by both channels. There will thus be 3 sources altogether: s1 used by both channels A and B, s2 used by channel A, and s3 used by channel B.

Example: conflicting sources

Consider the configurations for channels A and C:

A.jsonnet C.jsonnet
{
  sources: {
    s1: {
      module: "my.source1",
      parameters: {
        a: 1,
        b: null,
      },
    },
    s2: {...},
  },
  transforms: {...},
  publishers: {...}
}
{
  sources: {
    s1: {
      module: "my.source1",
      parameters: {
        a: 2, // <=== Different
        b: null,
      },
    },
    s3: {...}
  },
  transforms: {...},
  publishers: {...}
}

In this example, although both channels A and C have an s1 source, the a parameters differ between the two. This is an unsupported situation, and one of the channels will not be loaded because of this error (an error message will be logged to the decision-engine log file).