gcloud eventarc message-buses publish Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud eventarc message-buses publish - publish to an Eventarc message bus
- SYNOPSIS
gcloud eventarc message-buses publish(MESSAGE_BUS:--location=LOCATION)(--avro-message=AVRO_MESSAGE|--json-message=JSON_MESSAGE| [--event-data=EVENT_DATA--event-id=EVENT_ID--event-source=EVENT_SOURCE--event-type=EVENT_TYPE:--event-attributes=[ATTRIBUTE=VALUE,…]])[GCLOUD_WIDE_FLAG …]
- DESCRIPTION
- Publish to an Eventarc message bus.
- EXAMPLES
- To publish an event to the message bus
my-message-buswith event id1234, event typeevent-provider.event.v1.eventType,event source//event-provider/event/source, event data{"key": "value" }and event attributes ofattribute1=value,run:gcloudeventarcmessage-busespublishmy-message-bus--location=us-central1--event-id=1234--event-type=event-provider.event.v1.eventType--event-source="//event-provider/event/source"--event-data='{"key": "value"}'--event-attributes=attribute1=valueTo publish an event to the message bus
my-message-buswith a jsonmessage, run:gcloudeventarcmessage-busespublishmy-message-bus--location=us-central1--json-message='{"id": 1234, "type":"event-provider.event.v1.eventType", "source": "//event-provider/event/source", "specversion": "1.0", "data": {"key": "value"}}' - POSITIONAL ARGUMENTS
- Message bus resource - Message bus to publish to. The arguments in this groupcan be used to specify the attributes of this resource. (NOTE) Some attributesare not given arguments in this group but can be set in other ways.
To set the
projectattribute:- provide the argument
message_buson the command line with a fullyspecified name; - provide the argument
--projecton the command line; - set the property
core/project.
This must be specified.
MESSAGE_BUS- ID of the message bus or fully qualified identifier for the message bus.
To set the
message-busattribute:- provide the argument
message_buson the command line.
This positional argument must be specified if any of the other arguments in thisgroup are specified.
- provide the argument
--location=LOCATION- The location for the Eventarc message bus, which should be one of the supportedregions. Alternatively, set the [eventarc/location] property.
To set the
locationattribute:- provide the argument
message_buson the command line with a fullyspecified name; - provide the argument
--locationon the command line; - set the property
eventarc/location.
- provide the argument
- provide the argument
- Message bus resource - Message bus to publish to. The arguments in this groupcan be used to specify the attributes of this resource. (NOTE) Some attributesare not given arguments in this group but can be set in other ways.
- REQUIRED FLAGS
- Exactly one of these must be specified:
--avro-message=AVRO_MESSAGE- An Avro message to publish to the message bus.
--json-message=JSON_MESSAGE- A JSON message to publish to the message bus.
--event-data=EVENT_DATA- An event data. The event data of a published event.
This flag argument must be specified if any of the other arguments in this groupare specified.
--event-id=EVENT_ID- An event id. The id of a published event.
This flag argument must be specified if any of the other arguments in this groupare specified.
--event-source=EVENT_SOURCE- An event source. The event source of a published event.
This flag argument must be specified if any of the other arguments in this groupare specified.
--event-type=EVENT_TYPE- An event type. The event type of a published event.
This flag argument must be specified if any of the other arguments in this groupare specified.
--event-attributes=[ATTRIBUTE=VALUE,…]- Event attributes. The event attributes of a published event.This flag can berepeated to add more attributes.
- Exactly one of these must be specified:
- GCLOUD WIDE FLAGS
- These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$gcloud helpfor details. - NOTES
- This variant is also available:
gcloudbetaeventarcmessage-busespublish
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-29 UTC.