Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The difference between a global extension and a per-API extension is simply in the name given to the sequence that you use to create it.

Creating global extensions
Anchor
GlobalExtension
GlobalExtension

Given below is the naming pattern of the sequence to follow when creating a global extension sequence.

...

To test the code, copy it to an XML file (e.g., global_ext.xml) and save the file in the <APIM_HOME>/repository/deployment/server/synapse-configs/default/sequences directory. The above sequence prints a log message on the console on every API invocation.

Creating per-API extensions
Anchor
APIExtension
APIExtension

Given below is the naming pattern to follow when creating a per-API extension sequence.

...

The above sequence prints a log message on the console whenever the TwitterSearch API is invoked. 

Invoking the extension sequences

When an API is published, a file with its synapse configuration gets created on the API Gateway. If you inspect the synapse configuration of an API, you will see a set of handlers as shown in the following example:

...