Skip to main content
Version: v1.40.0

GCP PubSub

Overview​

Export evaluation data inside a GCP PubSub topic.
info

Google Cloud PubSub is an exporter of type queue, it means that it send events as soon as he receives them it does not work in bulk but in near real time.

Configure the relay proxy​

To configure your relay proxy to use the Google Cloud PubSub exporter, you need to add the following configuration to your relay proxy configuration file:

goff-proxy.yaml
# ...
exporter:
kind: pubsub
projectID: "my-project-id"
topic: "goff-feature-events"
# ...
Field nameMandatoryTypeDefaultDescription
kindstringnoneValue should be pubsub.
This field is mandatory and describes which retriever you are using.
projectIDstringnoneValue should be ID of GCP project you are using.
topicstringnoneTopic name on which messages will be published.

Configure the GO Module​

To configure your GO module to use the Google Cloud PubSub exporter, you need to add the following configuration to your ffclient.Config{} object:

example.go
config := ffclient.Config{
// ...
DataExporter: ffclient.DataExporter{
// ...
Exporter: &pubsubexporter.Exporter{
ProjectID: "project-id", // required
Topic: "topic", // required
Options: []option.ClientOption{...},
PublishSettings: &pubsub.PublishSettings{...},
EnableMessageOrdering: true,
},
},
// ...
}
err := ffclient.Init(config)
defer ffclient.Close()
FieldMandatoryDescription
ProjectID ID of GCP project.
You can find it in your GCP console
Topic Name of topic on which messages will be published
OptionsPubSub client options (see docs)
PublishSettingsTopic related settings (see docs)
EnableMessageOrderingEnables delivery of ordered keys