Skip to content

Add PubSub Push message Proto definition #23

@yuri-sergiichuk

Description

@yuri-sergiichuk

Is your feature request related to a problem? Please describe.

There is no PubSub proto message for the incoming push subscription messages described here. And thus, anyone who'd like to receive a Protobuf equivalent of the push message has to create its own proto wrapper around specified JSON representation.

Describe the solution you'd like
It'd be great to have an appropriate Protobuf message equivalent for the defined JSON representation:

   {
     "message": {
       "attributes": {
         "key": "value"
       },
       "data": "SGVsbG8gQ2xvdWQgUHViL1N1YiEgSGVyZSBpcyBteSBtZXNzYWdlIQ==",
       "messageId": "136969346945"
     },
     "subscription": "projects/myproject/subscriptions/mysubscription"
   }

Describe alternatives you've considered
I'm currently using my own Proto definition:

syntax = "proto3";

package google.pubsub.v1;

option java_multiple_files = true;
option java_outer_classname = "PubsubPushProto";
option java_package = "com.google.pubsub.v1";

import "google/pubsub/v1/pubsub.proto";

message PubsubPushNotification {

    // Pubsub message.
    PubsubMessage message = 1;

    // The name of the Pubsub subscription that pushed the current notification.
    // Format is `projects/{project}/subscriptions/{subscription}`.
    string subscription = 2;
}

Additional context
I'm currently using such a Protobuf as an input parameter for Spring's RestController POST handler. The conversion is done with the help of com.google.protobuf.util.JsonFormat.Parser class.

Metadata

Metadata

Labels

api: pubsubIssues related to the googleapis/java-pubsub API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions