Skip to main content

feldera_types/transport/
pubsub.rs

1use serde::{Deserialize, Serialize};
2use utoipa::ToSchema;
3
4// Subscription options docs: https://cloud.google.com/pubsub/docs/subscription-properties
5
6/// Google Pub/Sub input connector configuration.
7#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize, ToSchema)]
8pub struct PubSubInputConfig {
9    /// Set in order to use a Pub/Sub [emulator](https://cloud.google.com/pubsub/docs/emulator)
10    /// instead of the production service, e.g., 'localhost:8681'.
11    pub emulator: Option<String>,
12
13    /// The content of a Google Cloud credentials JSON file.
14    ///
15    /// When this option is specified, the connector will use the provided credentials for
16    /// authentication.  Otherwise, it will use Application Default Credentials (ADC) configured
17    /// in the environment where the Feldera service is running.  See
18    /// [Google Cloud documentation](https://cloud.google.com/docs/authentication/provide-credentials-adc)
19    /// for information on configuring application default credentials.
20    ///
21    /// When running Feldera in an environment where ADC are not configured,
22    /// e.g., a Docker container, use this option to ship Google Cloud credentials from another environment.
23    /// For example, if you use the
24    /// [`gcloud auth application-default login`](https://cloud.google.com/pubsub/docs/authentication#client-libs)
25    /// command for authentication in your local development environment, ADC are stored in the
26    /// `.config/gcloud/application_default_credentials.json` file in your home directory.
27    pub credentials: Option<String>,
28
29    /// Override the default service endpoint 'pubsub.googleapis.com'
30    pub endpoint: Option<String>,
31
32    /// gRPC channel pool size.
33    pub pool_size: Option<u32>,
34
35    /// gRPC request timeout.
36    pub timeout_seconds: Option<u32>,
37
38    /// gRPC connection timeout.
39    pub connect_timeout_seconds: Option<u32>,
40
41    /// Google Cloud project_id.
42    ///
43    /// When not specified, the connector will use the project id associated
44    /// with the authenticated account.
45    pub project_id: Option<String>,
46
47    /// Subscription name.
48    pub subscription: String,
49
50    /// Reset subscription's backlog to a given snapshot on startup,
51    /// using the Pub/Sub `Seek` API.
52    ///
53    /// This option is mutually exclusive with the `timestamp` option.
54    pub snapshot: Option<String>,
55
56    /// Reset subscription's backlog to a given timestamp on startup,
57    /// using the Pub/Sub `Seek` API.
58    ///
59    /// The value of this option is an ISO 8601-encoded UTC time, e.g., "2024-08-17T16:39:57-08:00".
60    ///
61    /// This option is mutually exclusive with the `snapshot` option.
62    pub timestamp: Option<String>,
63}