# tPubSubInput properties for Apache Spark Structured Streaming

[Preview](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Introduction/feature-preview-program-overview.htm)

These properties are used to configure tPubSubInput running in the Spark Structured Streaming Job framework.

The Spark Structured Streaming tPubSubInput component belongs to the Messaging family.

The streaming version of this component is available in Talend Real-Time Big Data Platform and in Talend Data Fabric.

## Basic settings

| Properties | Description |
| --- | --- |
| Schema and Edit schema | A schema is a row description. It defines the fields (columns) processed by the<br>component. When you create a Spark Job, avoid the reserved word<br>line when naming fields.<br><br><ul> <li><p><span>Built-In</span>: create and store the schema locally for                        this component only.</p></li> <li><p><span>Repository</span>: reuse a schema created and stored in                        the Repository across projects and Job designs.</p></li> </ul><br><br>Click Edit schema to modify the schema. If you modify a<br>Repository schema, the available options include:<br><br><ul> <li><p><span>View schema</span>: view the schema without modifying it.</p></li> <li><p><span>Change to built-in property</span>: change the schema to                        <span>Built-in</span> for local changes.</p></li> <li><p><span>Update repository connection</span>: modify the Repository                        schema and choose whether to propagate the changes to other Jobs.</p></li> </ul> |
| Google Cloud configuration | Select the tGoogleCloudConfiguration component that<br>provides the Google Cloud connection settings for this component. |
| Message format | Select the format of the Pub/Sub messages from the drop-down list:<br><br><ul> <li><span>String</span>: decodes the binary message payload as a                        UTF-8 string.</li> <li><span>byte[]</span>: passes the raw binary payload without                        decoding.</li> <li><span>Avro</span>: deserializes the binary payload using the                        Avro schema defined in the <span>Schema</span> tab.</li> </ul> |
| Pub/Sub topic | Enter the name of the Pub/Sub topic to consume messages from. |
| Pub/Sub subscription | Enter the name of the Pub/Sub subscription from which to consume messages.<br>The subscription must be connected to the specified topic. |
| Enable watermarking | Select this check box to activate watermarking and select the time mode to<br>be used:<br><br><ul> <li><span>Event time</span>: Select to use a timestamp column                     representing when each event occurred, then select the column in the                        <span>Watermark column (timestamp)</span> drop-down list.</li> <li><span>Processing time</span>: Select to use the time when Spark                     reads each record.</li> </ul><br><br>In the Watermark delay field, specify how long Spark<br>waits for late data before finalizing each window. |

## Advanced settings

| Properties | Description |
| --- | --- |
| Max messages | Enter the maximum number of Pub/Sub messages fetched per<br>micro-batch. |
| Acknowledge deadline (seconds) | Enter the acknowledgment deadline in seconds. Messages that are not<br>acknowledged within this window are redelivered by Pub/Sub. |
| Pub/Sub options | Add custom Pub/Sub connector options as key-value pairs by clicking the plus<br>button. |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | This component is used as a start component and requires an output link.<br><br>This component, along with the Spark Structured Streaming component Palette it belongs to,<br>appears only when you are creating a Spark Structured Streaming Job. |
| Spark Connection | You need to use the Structured Streaming Configuration<br>tab in the Run view to define the connection to a Spark cluster for<br>the whole Job.<br><br>This connection is effective on a per-Job basis. |