As of April 10, 2026, Dataplex Universal Catalog is now called Knowledge Catalog. The API, client library, CLI, and IAM names remain unchanged. For more information, seeIntroducing the Google Cloud Knowledge Catalog.
Receive notifications with metadata change feedsStay organized with collectionsSave and categorize content based on your preferences.
This document describes how to configure Knowledge Catalog (formerly Dataplex Universal Catalog) metadata change
feeds to receive notifications through Pub/Sub when metadata
within Knowledge Catalog is created, updated, or deleted.
To enable APIs, you need the Service Usage Admin IAM
role (roles/serviceusage.serviceUsageAdmin), which
contains theserviceusage.services.enablepermission.Learn how to grant
roles.
PROJECT_ID: your project ID where the Dataplex API is enabled
LOCATION: the location where the job runs—for example,us-central1,europe-west3, orasia-south1
Required roles and permissions
To configure metadata change feeds, ensure that you and theKnowledge Catalog
service accounthave the
required IAM roles and permissions.
User roles and permissions
To get the permissions that
you need to export metadata and access metadata change feeds messages,
ask your administrator to grant you the
following IAM roles on the project or organization:
These predefined roles contain
the permissions required to export metadata and access metadata change feeds messages. To see the exact permissions that are
required, expand theRequired permissionssection:
Required permissions
The following permissions are required to export metadata and access metadata change feeds messages:
Export metadata:
dataplex.metadataFeeds.createon the project
dataplex.entryGroups.exporton the resource defining the scope of the feed (Organization, Project, or Entry Group)
Knowledge Catalog service account roles and permissions
To ensure that the Knowledge Catalog service account has the necessary
permission to publish metadata change feeds messages,
ask your administrator to grant the
Pub/Sub Publisher (roles/pubsub.publisher) and Pub/Sub Viewer (roles/pubsub.viewer)
IAM role to the Knowledge Catalog service account on the Pub/Sub topic.For more information about granting roles, seeManage access to projects, folders, and organizations.
This predefined role contains thepubsub.topics.publishandpubsub.topics.getpermission,
which is required to
publish metadata change feeds messages.
Your administrator might also be able to give the Knowledge Catalog service account
this permission
withcustom rolesor
otherpredefined roles.
Grant permissions to the Knowledge Catalog service account
The service agent in Knowledge Catalog is created when you enable the
Dataplex API. You can identify the service agent by its email ID:
Here,PROJECT_NUMBERis the project
number of the project where you enabled the Dataplex API.
The Knowledge Catalog service account
requires the ability to publish messages to your Pub/Sub topic
and retrieve topic metadata.
To grant these permissions, give the service account thePub/Sub Publisher role(roles/pubsub.publisher) and thePub/Sub Viewer role(roles/pubsub.viewer) on the Pub/Sub topic:
To control which changes generate notifications, you can configure a metadata
change feed to monitor specific resources. You do this by specifying a scope,
such as your entire organization, specific projects, or specific entry groups.
While scope lets you definewhichresources to monitor, you can use filters to
further refinewhenKnowledge Catalog sends notifications.
//go:build examplespackagemainimport("context"dataplex"cloud.google.com/go/dataplex/apiv1"dataplexpb"cloud.google.com/go/dataplex/apiv1/dataplexpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataplex.NewCatalogClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataplexpb.CreateMetadataFeedRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#CreateMetadataFeedRequest.}op,err:=c.CreateMetadataFeed(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}
importcom.google.cloud.dataplex.v1.CatalogServiceClient;importcom.google.cloud.dataplex.v1.CreateMetadataFeedRequest;importcom.google.cloud.dataplex.v1.LocationName;importcom.google.cloud.dataplex.v1.MetadataFeed;publicclassSyncCreateMetadataFeed{publicstaticvoidmain(String[]args)throwsException{syncCreateMetadataFeed();}publicstaticvoidsyncCreateMetadataFeed()throwsException{// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_librarytry(CatalogServiceClientcatalogServiceClient=CatalogServiceClient.create()){CreateMetadataFeedRequestrequest=CreateMetadataFeedRequest.newBuilder().setParent(LocationName.of("[PROJECT]","[LOCATION]").toString()).setMetadataFeed(MetadataFeed.newBuilder().build()).setMetadataFeedId("metadataFeedId1633421160").setValidateOnly(true).build();MetadataFeedresponse=catalogServiceClient.createMetadataFeedAsync(request).get();}}}
/*** This snippet has been automatically generated and should be regarded as a code template only.* It will require modifications to work.* It may require correct/in-range values for request initialization.* TODO(developer): Uncomment these variables before running the sample.*//*** Required. The resource name of the parent location, in the format* `projects/{project_id_or_number}/locations/{location_id}`*/// const parent = 'abc123'/*** Required. The metadata job resource.*/// const metadataFeed = {}/*** Optional. The metadata job ID. If not provided, a unique ID is generated* with the prefix `metadata-job-`.*/// const metadataFeedId = 'abc123'/*** Optional. The service validates the request without performing any* mutations. The default is false.*/// const validateOnly = true// Imports the Dataplex libraryconst{CatalogServiceClient}=require('@google-cloud/dataplex').v1;// Instantiates a clientconstdataplexClient=newCatalogServiceClient();asyncfunctioncallCreateMetadataFeed(){// Construct requestconstrequest={parent,metadataFeed,};// Run requestconst[operation]=awaitdataplexClient.createMetadataFeed(request);const[response]=awaitoperation.promise();console.log(response);}callCreateMetadataFeed();
# This snippet has been automatically generated and should be regarded as a# code template only.# It will require modifications to work:# - It may require correct/in-range values for request initialization.# - It may require specifying regional endpoints when creating the service# client as shown in:# https://googleapis.dev/python/google-api-core/latest/client_options.htmlfromgoogle.cloudimportdataplex_v1defsample_create_metadata_feed():# Create a clientclient=dataplex_v1.CatalogServiceClient()# Initialize request argument(s)metadata_feed=dataplex_v1.MetadataFeed()metadata_feed.pubsub_topic="pubsub_topic_value"request=dataplex_v1.CreateMetadataFeedRequest(parent="parent_value",metadata_feed=metadata_feed,)# Make the requestoperation=client.create_metadata_feed(request=request)print("Waiting for operation to complete...")response=operation.result()# Handle the responseprint(response)
You can delete a metadata change feed if you no longer need to receive
notifications.
Deleting a metadata change feed stops the feed from publishing new metadata
changes to your Pub/Sub topic. However, it doesn't delete the
topic or the subscription associated with the feed. You must delete them
manually if they're no longer needed.
Before you delete the feed or the subscription, ensure that your subscriber
applications have processed all outstanding messages in the
Pub/Sub subscription.
After you configure a metadata change feed, Knowledge Catalog publishes
messages to the specified Pub/Sub topic when metadata changes
occur. To consume these messages, create a Pub/Sub subscription
to the topic.
For example, you can create a pull subscription and use the Google Cloud CLI
to view messages:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-06-25 UTC."],[],[]]