Use Custom Attributes in the Google Cloud Pub/Sub Connector
When integrating the Google Cloud Pub/Sub connector, you have the option to configure custom attributes. Review the following use case for using custom attributes.
Consider a scenario where you have multiple manufacturing sites worldwide, and one Manufacturing Connect Edge instance is connected to each site. Each Manufacturing Connect Edge instance also has one Google Cloud Pub/Sub Connector integrated with an outbound connection. To categorize the data being sent from Manufacturing Connect Edge to the Google Cloud Platform, you want to add custom attributes to each connector so that you know the origin of the data.
You will create the following key custom attributes:
- Country
- City
- Site ID
To review the entire workflow for setting up an outbound connection with the Google Cloud Pub/Sub Connector, refer to the Google Cloud Pub/Sub Integration Guide. The steps below focus on configuring the custom attributes for one of the Manufacturing Connect Edge instances described in the use case above.
To configure custom attributes:
- Navigate to Integration.
From the Integration pane, click Add a connector. The Add a Connector dialog box appears.
- Select Google Cloud Pub/Sub Connector.
- Configure the connection parameters to set up a connection with the Google Service account. Refer to the Google Cloud Pub/Sub Integration Guide.
Click the checkbox for Show Custom Attributes. The configuration section displays.
- Enter the following Key/Value pairs and click + Add for each pair.
- Key: Country Value: United States
- Key: City Value: Chicago
- Key: Site ID Value: 2463
- Review the configured custom attributes and all other connection parameters. Then, click Add.
The connector displays in the Integration pane with the custom attributes in the connector configuration.
Review the following payload with custom attributes configured.
- The Attribute keys column displays custom attributes that are created for the payload (location and source).
- The attribute.location column displays the value for the location attribute (toronto).
- The attribute.source column displays the value for the source attribute (mce).