Subscribed topics not available with API Connect subscription credentials

Symptoms

A Kafka client can connect to topics as event endpoints through Event Endpoint Management by using API Connect application credentials. However, the client can only interact with one of the topics that the application is subscribed to. The client returns an unknown topic error message similar to the following if it attempts to connect to any of the other topics.

Waiting for group rebalance
ERROR: Topic topic-name [0] error: Subscribed topic not available: topic-name: Broker: Unknown topic or partition

Causes

Topics can be socialized through Event Endpoint Management, and made available in the Developer Portal in IBM API Connect. Topics are added to the API Manager catalog as event sources by exporting the AsyncAPI documents and publishing them to products. An API Connect application is created and subscribes to these products.

The unknown topic error message occurs when more than one API is published to a single product and an application is subscribed to that product. This error can also occur when the application is subscribed to multiple products.

As a result, the single application is subscribed to multiple event source options in Event Endpoint Management. This causes the Event Gateway to incorrectly handle requests to those options. It will only process one of the requests successfully, even if the options are being accessed from different consumers, or if one request is for producing and the other for consuming.

Resolving the problem

Verify you can publish the AsyncAPI documents to separate products in the API Connect catalog. In addition, ensure that only one API Connect application is subscribed to a single product. This means that your clients will use unique API Connect credentials to interact with each topic.