Go Back
Lingk Event APIs to Google PubSub Events
Publisher
: Lingk
Run In Lingk
Description
This recipe writes a JSON array to multiple messages on a Google PubSub topic. To use this recipe, configure Google PubSub in your environment, set your PubSub topic, select your environment, and run the recipe.
Browse the knowledge base
Twitter
E-Mail
# _____ _ _____ __ # | __ \ (_) |_ _| / _| # | |__) |___ ___ _ _ __ ___ | | _ __ | |_ ___ # | _ // _ \/ __| | '_ \ / _ \ | | | '_ \| _/ _ \ # | | \ \ __/ (__| | |_) | __/ _| |_| | | | || (_) | # |_| \_\___|\___|_| .__/ \___| |_____|_| |_|_| \___/ # | | # |_| # Project Name - LINGK EVENT APIS TO GOOGLE PUBSUB EVENTS # Recipe URL - https://app.lingk.io/a/10932/tf/17882 # Description - # This recipe writes a JSON array to multiple messages on a Google PubSub topic. # To use this recipe, configure Google PubSub in your environment, set your PubSub topic, select your environment, and run the recipe. # Paste this payload into the Event window when Running the recipe. This event payload can also be passed to the Lingk REST APIs. #{ # "eventId": "Hello", # "eventName": "World", # "customerName": "Sample Company", # "companyId": 12344 #} # Industry - Higher Ed # Business Process - Graduate Reporting # Systems - GooglePub # Connectors - GooglePub, JSON # Data Flows - Single Direction # Connection Type - JSON to API # Add Recipe notes / Change log information here! # _____ _ # / ____| | | # | | ___ _ __ _ __ ___ ___| |_ ___ _ __ ___ # | | / _ \| '_ \| '_ \ / _ \/ __| __/ _ \| '__/ __| # | |___| (_) | | | | | | | __/ (__| || (_) | | \__ \ # \_____\___/|_| |_|_| |_|\___|\___|\__\___/|_| |___/ # # CONNECTORS specify what data will be pulled into the in-memory database during processing connectors: # Configure GooglePub credentials in your Environment before running this recipe # GooglePub Setup - https://help.lingk.io/en/articles/89-google-pubsub-connector-reference # JSON Setup - https://help.lingk.io/en/articles/74-json-connector-reference ###### Start: Google Connectors ####### # PubSub credentials provided by environment # Simply specify the publication topic endpoint - name: pubSubWriter type: GooglePubSubWriter properties: publicationEndpoint : "projects/mythic-hulling-182618/topics/test" ###### End: Google Connectors ####### ###### Start: JSON Connectors ####### # Example source data - name: eventPayload type: json properties: jsonObject: > {{dict|tojson}} ###### End: JSON Connectors ####### # _____ _ _ _ # / ____| | | | | | # | (___ | |_ __ _| |_ ___ _ __ ___ ___ _ __ | |_ ___ # \___ \| __/ _` | __/ _ \ '_ ` _ \ / _ \ '_ \| __/ __| # ____) | || (_| | || __/ | | | | | __/ | | | |_\__ \ # |_____/ \__\__,_|\__\___|_| |_| |_|\___|_| |_|\__|___/ # STATEMENTS specify how the data should be processed while in memory statements: #******************************************************************** D I S C L A I M E R *********************************************************************************************** # * # Note that in an effort to keep recipes optimized for DPH (Data Processing Hours), print statements should be commented out after development has concluded for a recipe. * # For more information on DPH optimization, please visit the following help article - https://help.lingk.io/en/articles/212-minimizing-data-processing-hours-on-the-lingk-platform * # * #******************************************************************** D I S C L A I M E R *********************************************************************************************** # this statement will also add attributes to the PubSub topic # anything in the "_attributes" struct will be sent as attributes # each row in the source table will be a new message - statement: | (pubSubEvents) => SELECT struct(customerId as key1 ,customerName as key2) as _attributes, eventId, eventName FROM eventPayload #- statement: PRINT pubSubEvents # one message per record will be added the topic - statement: INSERT pubSubEvents INTO pubSubWriter # Add more statements to convert, join, aggregrate, transform, and integrate your data
Join JSON and database data to output an Excel Spreadsheet
Join Salesforce data for better Excel reporting or CSV data feeds