GCP Part 3 - Publishing and Subscribing to a Topic with deviceWISE
The Pub/Sub notifications sends information about changes to objects in your buckets to Google Cloud's Pub/Sub, where the information is added to a Pub/Sub topic of your choice in the form of messages.

In this section you will understand to publish and subscribe a topic:
- Login to https://cloud.google.com/ and go to the Cloud Console.
- Click Google Cloud Platform > Pub/Sub > Topics.
Topics screen appears. - Click Create a topic.
- In the Topic ID field, provide a unique topic name, for example, MyNewTopic.
- Click CREATE TOPIC.
The created topic page appears. - Click Subscriptions, To add a subscription to the topic you just created.
- Click CREATE SUBSCRIPTION.
- Enter the Subscription ID.
- Choose the topic you created. The subscription receives messages from the topic.
- Click CREATE.

This section details the step-by-step guide to create the logic and to send the device data to AWS.
To create a trigger, do the following:
- Right-click on Projects and select New.
- Enter the Name and Description. Click Ok.
- Right-click on the new project and click Start.
The project state changes to Started. - Double-click on the project you just started, to open the project on a new tab.
- Click New, to start defining a new Trigger.
The Trigger screen appears. - To define the trigger, do the following:
- Enter the Name of the trigger.
- Click the Trigger Event Type drop-down and select On-Demand as the event type.
- Expand the Google Cloud action group, drag and drop the PubSub Publish action onto the canvas.
- Drag and drop the end execution block, located above the Trigger actions group.
- Connect the Start to the PubSub Publish action block and connect the PubSub Publish action block to the End Execution.
- Double-click the PubSub Publish action block, to edit the action.
- In the PubSub Publish window, click the Topic drop-down and select the newly created topic. For example, MyNewTopic.
- Change the type of the variable to STRING.
- Enter the Value of the variable as Hello World.

This section details the step-by-step guide to create the logic and to subscribe to a topic in the Google Cloud. To create the subscribe trigger, do the following:
- Double-click on the project you created.
- Click New, to start defining a new Trigger.
The Trigger screen appears. - To define the trigger do the following:
- Enter the Name of the trigger.
- Click the Trigger Event Type drop-down and select PubSub Subscription as the event type.
- Drag and drop the end execution block located above the Trigger action group.
- Connect the Start to the End Execution.
- Go to Settings tab and turn-on the reporting, by clicking the Reporting drop-down and selecting On.
- Right-click on the trigger and click Start.
The triggers start successfully. - Right-click on the Publish trigger and select Fire Trigger.
The trigger publishes the Hello World message to the GCP. As the Subscribe is subscribed to the MyNewSubsciption, you will see the same message in the Reports. - Under Logs & Reports, click Reports.
- Expand the Event Notification and Message Data.
You will see the message "Hello World" subscribed from the GCP.
The GCP and deviceWISE is connected and is able to send and receive data.