1. Coming Soon
  2. Features

Functions on Cloud Overview

Functions on Cloud Overview

Apache Pulsar Functions are lightweight functions that consume messages from Pulsar topics, apply custom processing logic, and publish the results of the computation to other topics. With the initial release of this feature, you deploy your functions through the command line to StreamNative Cloud. You can also monitor your functions on the StreamNative Cloud Console, which visually displays all of your functions and their current state.

Pulsar Functions are designed to perform lightweight stream processing. They are best for basic use cases that do not require the complexity of a full stream processing engine.

  • Simple per-message transformations for normalization, cleanup, or enriching with metadata.
  • Simple aggregations like sums, counts, or averages for a single stream (over a short time period) and where duplicates are tolerated.
  • Chained sequences of transformations on data in a single topic.

This feature is currently in beta. If you want to try it out, submit a ticket to the support team.

Prepare your environment

You need to prepare your environment before you can deploy a function to StreamNative Cloud. If you have already configured your .snctl/config file with your organization information, you don't need the -n <organization-namespace> parameter in the command in step 2. For more information, see set snctl configuration.

  1. Create a new service account with the Super Admin privilege on the StreamNative Cloud Console for running Pulsar Functions. For more information, see work with service accounts.

  2. On a terminal window, use snctl to create ServiceAccountBinding. Use the service account name you created in Step 1.

       snctl create serviceaccountbinding function-demo —-service-acount-name <name> —-pool-member <pool member> -n <organization-namespace>
  3. Return to the Service Accounts page on StreamNative Cloud Console, and download the Key File on the service account you created in Step 1.

  4. Set up the pulsar-admin tool. For more information, see Connect to cluster through pulsar-admin.

You can now work with functions on StreamNative Cloud.

Work with Functions

For this release of StreamNative Cloud, you deploy Pulsar Functions through the CLI. After you have deployed a function, you can view it on the StreamNative Cloud Console.

View the function status on StreamNative Cloud Console

After you have successfully deployed a function, you can check its status, logs, and any exceptions on StreamNative Cloud Console.

The Functions option in the Resources section is only available if you have configured your environment and deployed at least one function.

  1. Go to StreamNative Cloud Console.

  2. In the Resources area, click Functions.

  3. Click the status of the function you just deployed to view the details page. In the figure below, the status is Running.

    image of the functions detail page

  4. On the functions detail page, click Logs to view a real-time log of the running function you selected. Click Exceptions to view any exceptions.

    image of the functions detail page