com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links' is unknown.

Publish to Multiple External API Stores

You can share an API to application developers who are subscribed to the API Stores of other tenants. This allows you to advertize your APIs to a wider community. Subscribers of other tenant stores can view and browse your APIs but to subscribe to them, the users must visit your (the original publisher's) store.

Capability to publish to external API Stores is not there by default. Follow the steps below to configure it. In this guide, we use two separate instances of the API Manager and we publish from one instance to the Store of the other instance.

  1. Copy the API Manager product pack to two different locations.
  2. Go to the <APIM_HOME>/repository/conf/carbon.xml file of the second instance and change its port by an offset of 1. You do this to avoid the port conflicts that occur when you run more than one WSO2 products on the same host.

    <Offset>1</Offset>

    Tip: Please check whether the Thrift port under the <ThriftClientPort> and <ThriftServerPort> elements are changed according to the port offset in the <APIM_HOME>/repository/conf/api-manager.xml file. The default Thrift port is 10397.

  3. Start both servers. Let's publish from the first instance of the API Manager to the Store of the second instance.
  4. Log in to APIM admin console of the first instance (https://<Server Host>:9443/carbon) as admin. In a multitenant environment, you must log in using the tenant's credentials.
  5. Select Browse menu under Resources.

  6. The Registry opens. Go to the /_system/governance/apimgt/externalstores/external-api-stores.xml  resource.

  7. Click the Edit as Text link and change the <ExternalAPIStores> element of each external API store that you need to publish APIs to. In this example,

    • http://localhost:9764/store  is the API Store of the second API Manager instance.
    • You publish to its super tenant's Store (admin/admin).
    • The port is 9764 as you incremented it by 1 earlier.
    • If the second API Manager instance has multiple tenants and you want to a tenant's Store, the tenant's Store URL and credentials must be given here. 
    <ExternalAPIStores>
    	<StoreURL>http://localhost:9763/store</StoreURL>
            <ExternalAPIStore id="Store1" type="wso2" className="org.wso2.carbon.apimgt.impl.publishers.WSO2APIPublisher">
                <DisplayName>Store1</DisplayName>
                <Endpoint>http://localhost:9764/store</Endpoint>
                <Username>admin</Username>
                <Password>admin</Password>
            </ExternalAPIStore>
    </ExternalAPIStores>

    In a multitenant environment, each tenant can publish to different external Stores by changing the above file in their tenant space. Also, see  API visibility and subscription on how APIs appear and are available for subscription in a multitenant environment. Note that publishing to an external Store only means that the API is advertised there. To subscribe, you must always register and log in to the original publisher's tenant Store.

    Note the following in the configuration above:

    ElementDescription

    <ExternalAPIStore id="" type="" className="">

    id: The external store identifier, which is a unique value.
    type: Type of the Store. This can be a WSO2-specific API Store or an external one.
    className: The implementation class inside the API Manager distribution.

    < StoreURL>

    URL of the API store of the current APIM deployment. This is the URL to the API in the original publisher's store. APIs that are published to external stores will be redirected to this URL.
    < DisplayName> The name of the Store that is displayed in the publisher UI.

    < Endpoint>

    URL of the API Store.
    <Username> & <Password>

    Credentials of a user who has permissions to create and publish APIs.

    Registry changes are applied dynamically. You do not need to restart the server.

  8. Log in to the API Publisher of the first instance as admin/admin and  create an API. In a multitenant environment, log in to the API Publisher using your tenant's credentials.

  9. Click on the newly created API to see a new tab called External API Stores added to the API Publisher console. Select the Store that you want to publish to (in this case, Store1) and click Save.
     Note the following:

    • You can select multiple external API stores and click Save to publish your API to them. 
    • I f the API creator updates the API after publication to external stores, either the creator or a publisher can simply push those changes to the published stores by selecting the stores and clicking Save again. 
    • If the API creator deletes the API, each external store that it is published to will receive a request to delete the API.
  10. Log in to an external API Store (in this case, http://localhost:9764/store ) and click on the API that you just published.

  11. A link appears as View Publisher Store and it directs you to the original publisher’s store (in this case, http://localhost:9763/store) through which you can subscribe to the API.

You have added multiple external stores to your registry and published your APIs to them.

com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.