Skip to content

[FEATURE] Encina.GoogleCloudPubSub - Google Cloud Pub/Sub transport #237

@dlrivada

Description

@dlrivada

Summary

Add Google Cloud Pub/Sub as a message transport to complete the cloud provider triangle (AWS, Azure, GCP).

Motivation

  • GCP is one of the three major cloud providers
  • Many enterprises use GCP for their infrastructure
  • Pub/Sub offers dead-letter queues, filtering, and horizontal scalability similar to Azure Service Bus
  • Completes Encina's cloud-native story

Proposed Solution

New Package

  • Encina.GoogleCloudPubSub

Interfaces

  • IGoogleCloudPubSubMessagePublisher
  • Integration with Google.Cloud.PubSub.V1 SDK

Features

  • Topic/Subscription model
  • Message ordering (ordering keys)
  • Dead-letter topics
  • Message filtering
  • Exactly-once delivery
  • Push and pull subscriptions

Configuration

services.AddEncinaGoogleCloudPubSub(options =>
{
    options.ProjectId = "my-project";
    options.TopicId = "my-topic";
    options.SubscriptionId = "my-subscription";
});

Alternatives Considered

  1. AWS/Azure only: Supporting only AWS and Azure cloud providers. This excludes GCP users.

  2. Generic HTTP API: Using a generic HTTP publisher instead of native SDK. This loses GCP-specific features and optimizations.

  3. Dapr for GCP: Using Dapr with GCP Pub/Sub component. This adds Dapr dependency for simple GCP scenarios.

Affected Packages

  • Encina (core)
  • Encina.AspNetCore
  • Encina.EntityFrameworkCore
  • Encina.Dapper.*
  • Encina.ADO.*
  • Encina.MongoDB
  • Encina.Messaging
  • Encina.Caching.*
  • Other: Encina.GoogleCloudPubSub

Additional Context

Implementation Tasks

  • Create Encina.GoogleCloudPubSub package
  • Implement publisher
  • Implement consumer/subscriber
  • Message ordering support
  • Dead-letter topic handling
  • Message filtering
  • Health check integration
  • OpenTelemetry traces/metrics
  • Unit tests
  • Integration tests with emulator

References

Acceptance Criteria

  • Publisher implementation
  • Consumer/Subscriber implementation
  • Message ordering support
  • Dead-letter topic handling
  • Health check integration
  • OpenTelemetry traces/metrics
  • Unit tests
  • Integration tests with emulator

Related Issues

  • Encina.AmazonSQS (existing)
  • Encina.AzureServiceBus (existing)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-cloud-nativeCloud-Native patterns and integrationsarea-serverlessServerless (AWS Lambda, Azure Functions)area-transportMessage transport/broker implementationscloud-gcpGoogle Cloud Platformcomplexity-highComplexity: HighenhancementNew feature or requestindustry-best-practiceIndustry-proven pattern from major tech companiesnew-packageRequires creating a new NuGet packagephase-2-functionalityPhase 2: Functionality - new featurespriority-highPriority: High (⭐⭐⭐⭐)transport-pubsubGoogle Cloud Pub/Sub

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions