# tPubSubOutput properties for Apache Spark Streaming (deprecated)

Availability-note[Deprecated](https://help.talend.com/r/en-US/Cloud/labels-on-talend-help-center/availability-deprecated)

This content is deprecated.

Receives messages serialized into byte arrays by its preceding component and issues these messages into a given PubSub service.

Information noteDeprecation: Spark Streaming is deprecated beginning with the R2026-09 release. Use Spark Structured Streaming instead.

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

The Spark Streaming tPubSubOutput component belongs to the Messaging family.

If you are using Dataproc 1.4 and onwards as your Spark cluster, make sure to select the Allow API access to all Google Cloud services in the same project check box at the cluster creation on Google Cloud Platform to be able to run PubService.

This component is available in Talend Real-Time Big Data Platform and Talend Data Fabric.

## Basic settings

| Properties | Description |
| --- | --- |
| Schema and Edit<br>schema | A schema is a row description. It defines the number of fields<br>(columns) to be processed and passed on to the next component. When you create a Spark<br>Job, avoid the reserved word line when naming the<br>fields.<br><br>Note that the schema of this component is read-only. It stores the<br>messages to be published. |
| Define a Google Cloud configuration component | If you are using Dataproc as your Spark cluster, clear this check box.<br><br>Otherwise, select this check box to allow the Pub/Sub component to use the Google Cloud<br>configuration information provided by a<br>tGoogleCloudConfiguration component. |
| Topic name | Enter the name of the topic you want to publish messages to. This topic must already<br>exist. |
| Topic operation | Select the operation to be performed on the specified topic:<br><br><ul> <li> <p> <kbd>None</kbd>: select this option if the topic to be used already exists.</p> </li> <li> <p> <kbd>Create if not exists</kbd>: select this option if the topic to be used does not exist.</p> </li> </ul> |

## Advanced settings

| Properties | Description |
| --- | --- |
| Connection pool | In this area, you configure, for each Spark executor, the connection pool used to control<br>the number of connections that stay open simultaneously. The default values given to the<br>following connection pool parameters are good enough for most use cases.<br><br><ul> <li> <p> <span>Max total number of connections</span>: enter the maximum number            of connections (idle or active) that are allowed to stay open simultaneously.</p> <p>The default number is <em>8</em>. If you enter <em>-1</em>, you allow unlimited number of open connections at the same                time.</p> </li> <li> <p> <span>Max waiting time (ms)</span>: enter the maximum amount of time                    at the end of which the response to a demand for using a connection should be returned by                    the connection pool. By default, it is -1, that is to say, infinite.</p> </li> <li> <p> <span>Min number of idle connections</span>: enter the minimum number                        of idle connections (connections not used) maintained in the connection pool.</p> </li> <li> <p> <span>Max number of idle connections</span>: enter the maximum number                            of idle connections (connections not used) maintained in the connection pool.</p> </li> </ul> |
| Evict connections | Select this check box to define criteria to destroy connections in the connection pool. The<br>following fields are displayed once you have selected it.<br><br><ul> <li> <p> <span>Time between two eviction runs</span>: enter the time interval                                    (in milliseconds) at the end of which the component checks the status of the connections and                                    destroys the idle ones.</p> </li> <li> <p> <span>Min idle time for a connection to be eligible to                                            eviction</span>: enter the time interval (in milliseconds) at the end of which the idle                                        connections are destroyed.</p> </li> <li> <p> <span>Soft min idle time for a connection to be eligible to                                                eviction</span>: this parameter works the same way as <span>Min idle                                                    time for a connection to be eligible to eviction</span> but it keeps the minimum number                                            of idle connections, the number you define in the <span>Min number of idle                                                connections</span> field.</p> </li> </ul> |

## Usage

| Usage guidance | Description |
| --- | --- |
| Usage rule | This component is used as an end component and requires an input link.<br><br>This component needs a Write component such as tWriteJSONField to define a *serializedValue* column in the input schema to send serialized data. |
| Spark Connection | In the Spark<br>Configuration tab in the Run<br>view, define the connection to a given Spark cluster for the whole Job. In<br>addition, since the Job expects its dependent jar files for execution, you must<br>specify the directory in the file system to which these jar files are<br>transferred so that Spark can access these files:<br><br><ul> <li> <div> <span>Yarn mode</span> (Yarn client or Yarn cluster):<ul> <li> <p>When using Google Dataproc, specify a bucket in the                                            <span>Google Storage staging bucket</span>                                        field in the <span>Spark configuration</span>                                        tab.</p> </li> <li> <p>When using HDInsight, specify the blob to be used for Job                                        deployment in the <span>Windows Azure Storage                                            configuration</span> area in the <span>Spark                                            configuration</span> tab.</p> </li> <li>When using Altus, specify the S3 bucket or the Azure                                    Data Lake Storage for Job deployment in the <span>Spark                                        configuration</span> tab.</li> <li> <p>When using on-premises distributions, use                                        the configuration component corresponding to the file system                                        your cluster is using. Typically, this system is HDFS and so                                        use <a href="https://help.qlik.com/talend/r/en-US/8.0/components/hdfs/thdfsconfiguration">tHDFSConfiguration</a>.</p> </li> </ul> </div> </li> <li> <p> <span>Standalone mode</span>: use the                            configuration component corresponding to the file system your cluster is                            using, such as <a href="https://help.qlik.com/talend/r/en-US/8.0/components/hdfs/thdfsconfiguration-properties-for-apache-spark-batch">tHDFSConfiguration Apache Spark Batch</a> or <a href="https://help.qlik.com/talend/r/en-US/8.0/components/amazon-s3/ts3configuration-properties-for-apache-spark-batch">tS3Configuration Apache Spark Batch</a>.</p> <p>If you are using Databricks without any configuration component present                            in your Job, your business data is written directly in DBFS (Databricks                            Filesystem).</p> </li> </ul><br><br>This connection is effective on a per-Job basis. |
| PubSub access permissions | When you use Pub/Sub with a Dataproc cluster, ensure that this cluster<br>has the appropriate permissions to access the Pub/Sub service.<br><br>To do this, you can create the Dataproc cluster by checking<br>Allow API access to all Google Cloud services in<br>the same project in the advanced options on Google Cloud Platform, or<br>via the command line, assigning the scopes explicitly (the following<br>example is for a low-resource test cluster):<br><br>```<br>gcloud beta dataproc clusters create CLUSTER_ID \<br>--zone europe-west1-b \<br>--master-machine-type n1-standard-2 \<br>--master-boot-disk-size 50 \<br>--num-workers 2 \<br>--worker-machine-type n1-standard-2 \<br>--worker-boot-disk-size 50 \<br>--scopes 'https://www.googleapis.com/auth/cloud-platform' \<br>--project PROJECT_ID<br>``` |