Messaging and events

Google Cloud Pub/Sub integration

Google Cloud Pub/Sub is a managed messaging service for publishing events to many subscribers. Applications on Google Cloud use it for orders, inventory and analytics events. ECOM connects Pub/Sub topics and subscriptions to EDI partners, files and APIs.

Provider
Google Cloud
Model
Topics and subscriptions
Delivery
Pull or push subscriptions
Access control
IAM service accounts
Where Google Cloud Pub/Sub fitsA hub diagram: Cloud Run services, warehouse apps, e-commerce and data pipelines exchange Pub/Sub messages with the ECOM B2B gateway, which uses topics, subscriptions and acknowledgment deadlines and maps messages for the ERP, warehouse, EDI partners and APIs.Where Google Cloud Pub/Sub fitsPartners, the ECOM gateway and your systemsGOOGLE CLOUD SOURCESCloud Run servicesWarehouse appsE-commerceData pipelinesDESTINATIONSERPWarehouse (WMS)EDI partnersAPIs and appsECOM B2B gatewayGoogle Cloud Pub/SubTopics and subscriptionsAck deadlinesMap messages
Where Google Cloud Pub/Sub fitsA hub diagram: Cloud Run services, warehouse apps, e-commerce and data pipelines exchange Pub/Sub messages with the ECOM B2B gateway, which uses topics, subscriptions and acknowledgment deadlines and maps messages for the ERP, warehouse, EDI partners and APIs.Where Google Cloud Pub/SubfitsPartners, the ECOM gateway and your systemsGOOGLE CLOUD SOURCESCloud Run servicesWarehouse appsE-commerceData pipelinesECOM B2B gatewayGoogle Cloud Pub/SubTopics andsubscriptionsAck deadlinesMap messagesDESTINATIONSERPWarehouse (WMS)EDI partnersAPIs and apps

Events published on Google Cloud reach partners through the gateway, and partner documents come back as events.

Expand diagram Download SVG

Overview

What Google Cloud Pub/Sub is

Publishers send messages to a topic. Each subscription attached to the topic receives a copy. Subscribers either pull messages or have Pub/Sub push them to an HTTPS endpoint. Each message must be acknowledged within the acknowledgment deadline, or it is redelivered.

Ordering keys keep messages with the same key in order. Dead-letter topics collect messages that fail too many times. Exactly-once delivery is available for pull subscriptions in a region; otherwise delivery is at least once.

Where businesses use it

  • Google Cloud applications

    Services on Google Cloud exchanging business events.

  • Analytics pipelines

    Streaming events into BigQuery and data processing.

  • Event fan-out

    One event delivered to every service that needs it.

How it works

How Pub/Sub messaging works

A publisher sends a message with data and attributes, and optionally an ordering key, to a topic. Pub/Sub stores it and delivers it to each subscription. A pull subscriber receives messages, processes them and acknowledges them; a push subscription posts them to an endpoint that answers with success.

Unacknowledged messages are redelivered after the deadline. After the maximum delivery attempts, they go to the dead-letter topic if one is configured.

A shipment event through Pub/SubA sequence diagram: the warehouse publishes a shipment event to a topic, the ECOM gateway subscription pulls it, processes it and acknowledges it within the deadline, while an analytics subscription receives its own copy.A shipment event through Pub/SubPublish, pull, acknowledgeWarehouse appPub/Sub topicECOM gatewayAnalyticsPublish shipment eventPull from the ECOM subscriptionMap to ship noticeAcknowledgeSeparate copy to analytics
A shipment event through Pub/SubA sequence diagram: the warehouse publishes a shipment event to a topic, the ECOM gateway subscription pulls it, processes it and acknowledges it within the deadline, while an analytics subscription receives its own copy.A shipment event throughPub/SubPublish, pull, acknowledgeWarehouseappPub/SubtopicECOMgatewayAnalyticsPublish shipment eventPull from the ECOMsubscriptionMap to shipnoticeAcknowledgeSeparate copy to analytics

Each subscription gets its own copy. An acknowledgment within the deadline ends delivery for that subscription.

Expand diagram Download SVG

In depth

Pub/Sub integration in practice

  • Pull or push

    Pull for controlled processing; push to an HTTPS endpoint for simple event delivery.

  • Acknowledgment deadline

    Set to fit processing time, or extended while work continues.

  • Ordering keys

    Keep related events, such as updates to one order, in order.

  • Dead-letter topics

    Messages that fail too often are moved aside for review.

  • Duplicates

    Consumers are idempotent, or exactly-once delivery is used where available.

  • IAM

    Service accounts with publisher or subscriber roles only.

In practice

Example: shipment events to retailer ship notices

A warehouse application on Google Cloud publishes shipment events. Retailers need X12 856s.

Example: shipment events to retailer ship noticesFive steps: the warehouse publishes shipment events, the gateway subscription pulls them, maps each to an X12 856, sends it to the retailer, and acknowledges the event.Example: shipment events to retailer ship noticesA practical example, step by step1PublishEach shipment ispublished to a topic.Step 12PullThe gateway'ssubscription pullsnew events.Step 23Map to 856Each retailer's shipnotice is built.Step 34SendThe 856 goes to theretailer.Step 45AcknowledgeThe event isacknowledged aftersending.Step 5
Example: shipment events to retailer ship noticesFive steps: the warehouse publishes shipment events, the gateway subscription pulls them, maps each to an X12 856, sends it to the retailer, and acknowledges the event.Example: shipment events toretailer ship noticesA practical example, step by step1PublishEach shipment is published to a topic.Step 12PullThe gateway's subscription pulls newevents.Step 23Map to 856Each retailer's ship notice is built.Step 34SendThe 856 goes to the retailer.Step 45AcknowledgeThe event is acknowledged aftersending.Step 5

Acknowledging after the send means an interrupted send is retried, not lost.

Expand diagram Download SVG

Connections

How Google Cloud Pub/Sub connects your business

  • Trading partners

    EDI documents from partners become Pub/Sub messages for internal systems, and events become partner documents.

  • ERP and business systems

    Orders, shipments, inventory and invoices move between applications as events, without point-to-point links.

  • APIs and files

    The same data can be published to APIs or written to files for systems that do not read the platform.

  • Business workflows

    Order-to-cash and fulfillment steps react to events as they happen.

ECOM

How ECOM supports Google Cloud Pub/Sub

ECOM supports Google Cloud Pub/Sub with dedicated implementation, mapping, communication and support teams, and with specialists who know the industries your partners work in.

  • Implementation team

    Plans the Google Cloud Pub/Sub setup with you, configures it on the gateway and runs the tests with your partners and systems.

  • Mapping team

    Builds and maintains the maps, code conversions and validation rules between partner data and your applications.

  • Communication team

    Sets up and monitors partner connections, certificates, keys and credentials, and coordinates changes with each partner.

  • Support team

    Watches the flows, investigates failed or missing documents, and works the issue through with you and your partner.

For Google Cloud Pub/Sub in particular

  • Pub/Sub publishers and pull or push subscriptions with service accounts, ordering keys and dead-letter topics.
  • Mapping between Pub/Sub messages and EDI, XML, JSON, files and your ERP, with validation.
  • Monitoring of queues, subscriptions and failed messages, with alerts and a clear path to reprocess.

Frequently asked questions

What is the difference between pull and push subscriptions?

With pull, the subscriber requests messages. With push, Pub/Sub posts each message to an HTTPS endpoint, which acknowledges by answering with success.

Does Pub/Sub keep messages in order?

Messages with the same ordering key are delivered in order when ordering is enabled on the subscription.

What happens if a message is not acknowledged?

It is redelivered after the deadline. After the maximum attempts it goes to the dead-letter topic, if one is set.

Can Pub/Sub events become EDI documents?

Yes. Events are mapped to partner EDI documents, and partner documents can be published as events.

Talk to an EDI/API Expert

Tell us which partners, systems and Google Cloud Pub/Sub requirements you are working with. An ECOM specialist will review them with you and outline the setup, the maps and the tests.