Creating and Managing Kafka Applications

Kafka applications in Event Portal represent any client application that connects to a Kafka event broker to publish or subscribe to events.

For general information about working with applications, see Applications.

This section includes the following tasks:

Creating a Kafka Application

You can create applications in any application domain where you have Editor or Manager level access. When you create a Kafka application, you specify several attributes:

  • name
  • version display name, and number for the first version
  • any application or version custom attributes
  • event flows

You can create and update applications using the graph view or the component view. Solace recommends starting in the graph view and using the component view for updates and more advanced configuration. The graph view lets you work with the latest non-retired version of all events and applications in the application domain. For more information about working in the graph view, see Using the Graph View.

To create a Kafka application in the graph view, perform these steps:

  1. Log in to the PubSub+ Cloud Console if you have not done so yet. The URL to access the Cloud Console differs based on your authentication scheme. For more information, see Logging In to the PubSub+ Cloud Console.
  2. On the navigation bar, select Designer .
  3. On the Application Domains page, click the application domain that you want to add the application to.
  4. In the graph view, click Add Objects and select the Kafka tab.
  5. Click New Standard Application and then click the graph where you want to position the application.
  6. (Optional) If you want to change the appearance of the icon, click below the application name and select a color and an icon or logo, then click Apply. For more information see Customizing Object Appearance.
  7. Enter a name for the application.
  8. (Optional) If you want the application to publish an event version that shows in the graph, hover over the application and drag the arrow that appears to the event.

    Screenshot showing the action described in the previous step.

  9. (Optional) If you want the application to subscribe to an event version that shows in the graph, hover over the event and drag the arrow that appears to the application version.

    Screenshot showing the action described in the previous step.

    If you want to associate the application with a shared event from another application domain that does not appear in the graph, see Associating Shared Events in the Graph View.

    If you want to associate the application with an older version of an event, for example, if you want to link to the latest released version and there is a newer draft version, use the component view.

  10. (Optional) If you want to show a link between two applications without specifying an event flow, hover over the application you want to designate as a source and drag the arrow that appears to the application that you want to specify as a destination.

    Screenshot showing the action described in the previous step.

  11. Click the application to display its information in the Details panel.
  12. To update the application name, version, or description:
    1. In the Details panel, click
    2. Update the attributes as necessary.
    3. Click Save.
  13. To update any custom attributes:
    1. In the Custom Attributes panel, click . The Custom Attributes panel does not display if no custom attributes are available for the application.
    2. Select This Version or Application to display version or application custom attributes.
    3. Update the custom attributes as necessary.
    4. Click Save.
  14. To open the application in component view to add consumers and runtime configuration details:
    1. In the Details panel, click Open Full Application Details.
    2. Click Edit This Version.
    3. Update the application version as necessary. For more information, see Updating a Kafka Application in the Component View.
    4. Click Save & Close.

Updating a Kafka Application in the Component View

The component view includes options for applications that are not available in the graph view and allows you to manage associations with older versions of events.

To update an application version in the component view, perform these steps:

  1. On the navigation bar, select Designer .
  2. On the Application Domains page, click the application domain that contains the application you want to update.
  3. Click Components  to switch to the component view.
  4. Select the Applications tab and then click the name of the application you want to update.
  5. Perform one of the following actions:
    • In the Versions list, click More Actions for the version that you want to update and select Edit. Any changes you make update that version of the application. You can edit an application version only if it is in Draft state.
    • In the Versions list, click More Actions for the version that you want to update and select Duplicate. All properties of the existing version are copied into a new version. By default, the new version number is incremented by 0.0.1. You can change the version number to any number not already in use.
  6. (Optional) In the Version field, update the semantic version value for the application.
  7. (Optional) Update the Version Name.
  8. (Optional) Update the Description. The Description field supports Markdown. Click toggle preview  to preview the rendered text.
  9. To select events that the application publishes or intends to subscribe to, perform these steps:
    1. In the Event Flows section, select Events.
    2. Click Manage Events.
    3. In the Application Domain list, select the application domain that contains the event to publish or subscribe to. By default, the list shows events in the current application domain. You can select a different application domain, or you can remove the filter to show shared events in all application domains that you have access to.
    4. (Optional) In the Display list, select whether the a modeled event mesh and environment to list only event versions published in the selected modeled event mesh.
    5. Expand an event to see the list of event versions.
    6. To declare an intent to subscribe to the event, select Sub for the version that you want the application to subscribe to.
    7. To publish the event, select Pub for the version of each event that you want the application to publish.
    8. When you are finished selecting events, click Close  .
  10. If you want to generate consumers for the subscribed events you selected, click Auto-Create.
  11. (Optional) Configure one or more Kafka consumer for the application. For each consumer that you want to configure, perform the following steps:
    1. Add or update a Name for the Kafka consumer.
    2. To add a topic subscription to the consumer, click Add Subscriptions and enter the topic for the consumer to subscribe to. You can select a topic address for a declared subscribed event to create a subscription, or you can type a topic address.

      When you enter a topic subscription, a Preview of Attracted Events shows all event versions with a matching topic address that are published by an application version that has been added to at least one modeled event mesh.

  12. Click Save Version or Save & Close.
  13. If the application has one or more consumers that attract events that you have not declared an intent to subscribe to, a list of Additional Attracted Events by Consumer Subscriptions displays below the consumers. You may need to declare additional events, or you may have consumer subscriptions with wildcards that attract more events than you intended. Review your subscriptions to make sure they behave as expected.

Promoting a Kafka Application to an Environment

Environments in PubSub+ Cloud represent the operational environments within your organization. In Event Portal, you create modeled event meshes within environments to represent event flows through one or more operational event brokers. When you add an application to an environment, you promote a version of the application to a model event broker in a modeled event mesh. For more information, see Promoting Applications to Environments.

To promote a Kafka application to an environment, perform these steps:

  1. On the navigation bar, select Designer .
  2. On the Application Domains page, click the application domain that contains the application.
  3. In the graph view, click the application.
  4. In the application detail panel that appears, click Open Full Application Details.
  5. On the Application page, select the Runtime tab.
  6. In the Version list, select the version of the application that you want to add.
  7. In the Event Brokers list, select the event broker that you want to add the application to. If another version of the application is already associated with the event broker, the version you selected replaces the currently associated version on the event broker.
  8. Click Add Application.
  9. (Optional) If there is a mismatch between a declared event version that the application intends to subscribe to and the consumers set up for the application, or if no application in the environment publishes a declared subscribed event, click View Mismatches and perform one of the following steps:
    • Click Edit Application to open the application version in a new tab and fix one or more mismatches. Mismatches can include:

      MismatchDescriptionResolutions

      Subscription Attracts a Different Event Version

      A consumer subscription in the application attracts a different version of an event than the declared event version that the application intends to subscribe to.

      Verify which version of the event the consumer needs to subscribe to and perform one of the following actions:

      • Update the consumer subscription.
      • Update the version of the declared event that the application version references.
      • Add an application that publishes the event version to the modeled event mesh.

      Event Not Published in Modeled Event Mesh

      The application has a declared event version that it intends to subscribe to but no application in the modeled event mesh publishes that event.

      Add an application that publishes the event version to the same modeled event mesh.

      Event Has No Matching Subscription

      The application has a declared event version that it intends to subscribe to, but does not have a consumer with a matching subscription to attract the event version.

      Perform any of the following actions:

      • Subscribe to the event version with an existing consumer.
      • Add a new consumer to the application that subscribes to the event version.
      • Remove the event version from the list of events the application intends to subscribe to.

      Subscription Attracts Additional Events

      The application has a consumer subscription that attracts an event that is not one of the declared event versions that the application intends to subscribe to.

      Perform one of the following actions:

      • Update the application version to declare the intent to subscribe to the additional event version
      • Update the consumer subscription if it is attracting an unintended event.

      When an application has one or more consumers that attract events without a declared intent, a list of the additional consumed events displays below the consumers on the application page.

      Event Has No Topic Address

      A declared event version that the application intends to subscribe to does not have a topic address.

      Add a topic address to the declared event version.

    • Click Close to return to the Add to Environment dialog box and fix the discrepancy later.
  10. Click Add.
  11. Event Portal adds the application version to the event broker and displays the details.

  12. Screenshot showing the feature described in the surrounding text.

Filtering the Event Broker List

You can filter the list of event brokers on the Runtime tab to view the event brokers that an application can be added to or that an application or specific version has already been added to.

To filter the list of event brokers, on the Runtime tab for an application, select an option from the Filter by version list:

  • All Application Versions—displays all model event brokers that any version of the application has been added to.
  • Version number—displays all model event brokers that the selected version of the application has been added to.
  • No Version Added— displays all model event brokers that no version of the application has been added to.

Removing an Application From an Environment

You can remove an application version from a modeled event broker if it is no longer needed. If you want to change the version of an application you can just add the new version and the previously associated version is automatically removed. You don't need to remove it manually.

To remove an application version from a modeled event broker, perform these steps:

  1. On the Runtime tab for an application, click More Actions for the event broker that you want to remove the application from and select Remove Application.
  2. Click Remove.

Downloading an AsyncAPI Document for an Application

An AsyncAPI document is a JSON or YAML file generated according to the AsyncAPI Specification. For more information, see the AsyncAPI Initiative. You can give the AsyncAPI document to application developers to help them create the actual applications that are part of your event-driven architecture (EDA).

You can download an AsyncAPI document for an application with or without server details and operation bindings for an event broker that the application is associated with.

To download an AsyncAPI document for an application, perform these steps:

  1. On the Application Domains page, click the name of the application domain that contains the application.
  2. In the graph view, click the application that you want to download the AsyncAPI document for.
  3. In the Details panel, click Open Full Application Details.
  4. In the Version list, select the version that you want to download the AsyncAPI document for.
  5. In the version details, click More Actions  and select Download Async API.

    Alternatively, select the Runtime tab for the application, click More Actions  for an associated event broker, and then select Download Async API.

  6. If you opened the Download Async API dialog from the Details tab and want to include server details and operation bindings for an event broker that you have added the application to, select the event broker from the Event Broker Context list.

    If you opened the Download Async API dialog from the Runtime tab, you have already selected the event broker.

  7. (Optional) To specify the details to include in the AsyncAPI document, click Advanced Options and select one or more of the following options:

    Option Description

    Declared subscribed events

    Events that the application has a declared intent to subscribe to in the application event flow.

    This option is selected by default if you do not select an event broker.

    This option is not selected by default if you select an event broker.

    Operation bindings on declared subscribed events

    Protocol-specific information for the declared subscribed events. For more information about bindings, see the AsyncAPI Documentation.

    This option is selected by default if you do not select an event broker.

    This option is available only if Declared subscribed events is selected.

    Attracted events

    Events attracted to the application by a consumer topic subscription.

    This option is selected by default if you select an event broker.

    This option is not available if you do not select an event broker.

    Operation bindings on attracted events

    Protocol-specific information for attracted events.

    This option is selected by default if you select an event broker.

    This option is available only if Attracted events is selected.

    Servers

    Connection information for the event broker.

    This option is selected by default if you select an event broker.

    This option is not available if you don't select an event broker.

    Server bindings

    Protocol-specific information related to the event broker connection.

    This option is selected by default if you select an event broker.

    This option is available only if Servers is selected.

  8. Select JSON or YAML file format.
  9. If you want to exclude any Event Portal extensions from the AsyncAPI document, in the Document Extensions list, select the extensions that you want to exclude. You can exclude:
    • Event Portal version ID extensions for all objects
    • Event Portal parent ID extensions for all objects
    • all Event Portal extensions
  10. (Optional) Select at least one naming strategy to apply to prevent naming conflicts. All objects are renamed with the chosen naming strategy to ensure objects with the same name can be differentiated in the file:
    • Prepend application domain names—use this option when the file contains events or schemas with the same name.
    • Append major version number—use this option when the file contains more than one object version of the same name.

    Applying a naming strategy does not update the names of referenced schemas within the schema content. If a schema is renamed, you need to update the references to that schema name in any other schemas that reference it. You can update the reference in Designer and regenerate the AsyncAPI document or update the references in the API document each time you generate it.

  11. Click Download.

    If any naming conflicts exist that are not resolved by a selected naming strategy, a dialog describes the conflict to help you resolve it.