Spring Cloud GCP

Authors

João André Martins, Jisha Abubaker, Ray Tsang, Mike Eltsufin, Artem Bilan, Andreas Berger, Balint Pato, Chengyuan Zhao, Dmitry Solomakha, Elena Felder, Daniel Zou

Table of Contents

1. Introduction
2. Dependency Management
3. Getting started
3.1. Spring Initializr
3.1.1. GCP Support
3.1.2. GCP Messaging
3.1.3. GCP Storage
3.2. Code Samples
3.3. Code Challenges
3.4. Getting Started Guides
4. Spring Cloud GCP Core
4.1. Project ID
4.2. Credentials
4.2.1. Scopes
4.3. Environment
4.4. Spring Initializr
5. Google Cloud Pub/Sub
5.1. Pub/Sub Operations & Template
5.1.1. Publishing to a topic
JSON support
5.1.2. Subscribing to a subscription
5.1.3. Pulling messages from a subscription
5.2. Pub/Sub management
5.2.1. Creating a topic
5.2.2. Deleting a topic
5.2.3. Listing topics
5.2.4. Creating a subscription
5.2.5. Deleting a subscription
5.2.6. Listing subscriptions
5.3. Configuration
5.4. Sample
6. Spring Resources
6.1. Google Cloud Storage
6.1.1. Setting the Content Type
6.2. Configuration
6.3. Sample
7. Spring JDBC
7.1. Prerequisites
7.2. Spring Boot Starter for Google Cloud SQL
7.2.1. DataSource creation flow
7.2.2. Troubleshooting tips
Connection issues
Errors like c.g.cloud.sql.core.SslSocketFactory : Re-throwing cached exception due to attempt to refresh instance information too soon after error
PostgreSQL: java.net.SocketException: already connected issue
7.3. Samples
8. Spring Integration
8.1. Channel Adapters for Cloud Pub/Sub
8.1.1. Inbound channel adapter
8.1.2. Outbound channel adapter
8.1.3. Header mapping
8.2. Sample
8.3. Channel Adapters for Google Cloud Storage
8.3.1. Inbound channel adapter
8.3.2. Inbound streaming channel adapter
8.3.3. Outbound channel adapter
8.4. Sample
9. Spring Cloud Stream
9.1. Overview
9.2. Configuration
9.2.1. Producer Destination Configuration
9.2.2. Consumer Destination Configuration
9.3. Sample
10. Spring Cloud Sleuth
10.1. Tracing
10.2. Spring Boot Starter for Stackdriver Trace
10.3. Integration with Logging
10.4. Sample
11. Stackdriver Logging
11.1. Web MVC Interceptor
11.2. Logback Support
11.2.1. Log via API
11.2.2. Log via Console
11.3. Sample
12. Spring Cloud Config
12.1. Configuration
12.2. Quick start
12.3. Refreshing the configuration at runtime
12.4. Sample
13. Spring Data Cloud Spanner
13.1. Configuration
13.1.1. Cloud Spanner settings
13.1.2. Repository settings
13.1.3. Autoconfiguration
13.2. Object Mapping
13.2.1. Constructors
13.2.2. Table
SpEL expressions for table names
13.2.3. Primary Keys
13.2.4. Columns
13.2.5. Embedded Objects
13.2.6. Relationships
13.2.7. Supported Types
13.2.8. Lists
13.2.9. Lists of Structs
13.2.10. Custom types
13.2.11. Custom Converter for Struct Array Columns
13.3. Spanner Operations & Template
13.3.1. SQL Query
13.3.2. Read
13.3.3. Advanced reads
Stale read
Read from a secondary index
Read with offsets and limits
Sorting
Partial read
Summary of options for Query vs Read
13.3.4. Write / Update
Insert
Update
Upsert
Partial Update
13.3.5. DML
13.3.6. Transactions
Read/Write Transaction
Read-only Transaction
Declarative Transactions with @Transactional Annotation
13.3.7. DML Statements
13.4. Repositories
13.4.1. CRUD Repository
13.4.2. Paging and Sorting Repository
13.4.3. Spanner Repository
13.5. Query Methods
13.5.1. Query methods by convention
13.5.2. Custom SQL/DML query methods
Query methods with named queries properties
Query methods with annotation
13.5.3. Projections
13.5.4. REST Repositories
13.6. Database and Schema Admin
13.7. Sample
14. Spring Data Cloud Datastore
14.1. Configuration
14.1.1. Cloud Datastore settings
14.1.2. Repository settings
14.1.3. Autoconfiguration
14.2. Object Mapping
14.2.1. Constructors
14.2.2. Kind
14.2.3. Keys
14.2.4. Fields
14.2.5. Supported Types
14.2.6. Custom types
14.2.7. Collections and arrays
14.2.8. Custom Converter for collections
14.3. Relationships
14.3.1. Embedded Entities
Maps
14.3.2. Ancestor-Descendant Relationships
14.3.3. Key Reference Relationships
14.4. Datastore Operations & Template
14.4.1. GQL Query
14.4.2. Find by ID(s)
Indexes
Read with offsets, limits, and sorting
Partial read
14.4.3. Write / Update
Partial Update
14.4.4. Transactions
Declarative Transactions with @Transactional Annotation
14.4.5. Read-Write Support for Maps
14.5. Repositories
14.5.1. Query methods by convention
14.5.2. Custom GQL query methods
Query methods with annotation
Query methods with named queries properties
14.5.3. Transactions
14.5.4. Projections
14.5.5. REST Repositories
14.6. Sample
15. Cloud Memorystore for Redis
15.1. Spring Caching
16. Cloud Identity-Aware Proxy (IAP) Authentication
16.1. Configuration
16.2. Sample
17. Google Cloud Vision
17.1. Cloud Vision Template
17.2. Detect Image Labels Example
17.3. Sample
18. Cloud Foundry
19. Kotlin Support
19.1. Prerequisites
20. Sample