Skip to content

Your application publishes job requests

The following diagrams illustrate how your application publishes job requests to the Cloud Pub/Sub request topics:

Architecture diagram showing an application publishing job requests to a Cloud Pub/Sub topic using a customer-owned service account and Google Application Default Credentials

Your application authenticates natively using its own service account and Google Application Default Credentials (ADC)

Architecture diagram showing an application publishing job requests to a Cloud Pub/Sub topic using downloaded private keys of the Modigie Application Account

Default workflow authenticating via downloaded private keys of the Modigie Application Account

Depending on your repository configuration, your application authenticates using one of two methods:

  • Customer Service Account (Keyless ADC): If your repository is configured with customer service accounts in requestPublishers, Modigie tenant-infra automatically grants roles/pubsub.publisher on the request topic to your service account(s). Your application authenticates natively using Google Application Default Credentials (ADC) without downloading, storing, or rotating private key files.
  • Modigie Application Account: By default, your application authenticates with GCP using the repository's dedicated Application Account via downloaded user-managed JSON keys or Workload Identity Federation.

Exclusivity Boundary

When requestPublishers is configured for a job type, publishing job requests becomes the exclusive responsibility of your designated customer service account(s). The repository's Application Account cannot be used to publish job requests. See Customer-Owned Google Cloud Resources.

Your application publishes the workload, including required and optional input parameters and metadata, to the dedicated Cloud Pub/Sub topic for that job type.

For code samples demonstrating how to publish messages with the official client libraries, see https://cloud.google.com/pubsub/docs/publish-receive-messages-client-library.

Publish requests as early as possible

In general, we recommend publishing job requests as soon as your application identifies the need for a specific job type and produces the input payload. This ensures the job type queues in your pipeline continuously maximize the utilization of your Job dispatch rate.

Batching messages

Your publisher can publish messages with job requests of the same job type in batches to improve network efficiency and throughput. However, message batching does not impact the delivery of job results. Each message contains only a single job request, and every real-time job executes independently. The Modigie API publishes job results as soon as a job terminates (that is, its status reaches completed, canceled, rejected, or failed). Job results are not delivered in a predetermined order.

Failures at publishing

Your application should log failed publish requests to facilitate alerting for elevated failure rates or unexpected backlog growth.

  • Transient Failures: Network timeouts and transient service unavailable errors should be retried with exponential backoff.
  • Persistent Authentication Failures: Repeated permission or authentication errors indicate configuration issues (e.g., service account email not listed in requestPublishers or expired key) that must be resolved prior to retrying.

Job requests that your application does not publish successfully do not enter Modigie, and your account is not charged for them.

If your publisher processes large message volumes, publish requests might accumulate in memory and fail with Deadline exceeded. For best practices, see https://cloud.google.com/pubsub/docs/publish-best-practices.