github.com/asynkron/protoactor-go@v0.0.0-20240308120642-ef91a6abee75/cluster/pubsub.proto (about) 1 syntax = "proto3"; 2 package cluster; 3 option go_package = "/github.com/asynkron/protoactor-go/cluster"; 4 5 import "cluster.proto"; 6 import "google/protobuf/duration.proto"; 7 import "actor.proto"; 8 9 // Identifies a subscriber by either ClusterIdentity or PID 10 message SubscriberIdentity { 11 oneof Identity { 12 actor.PID pid = 1; 13 cluster.ClusterIdentity cluster_identity = 2; 14 } 15 } 16 17 // First request to initialize the actor. 18 message Initialize { 19 google.protobuf.Duration idleTimeout = 1; 20 } 21 22 message Acknowledge {} 23 24 // A list of subscribers 25 message Subscribers { 26 repeated SubscriberIdentity subscribers = 1; 27 } 28 29 // Sent to topic actor to add a subscriber 30 message SubscribeRequest { 31 SubscriberIdentity subscriber = 1; 32 } 33 34 // Subscribe acknowledgement 35 message SubscribeResponse {} 36 37 // Sent to topic actor to remove a subscriber 38 message UnsubscribeRequest { 39 SubscriberIdentity subscriber = 1; 40 } 41 42 // Unsubscribe acknowledgement 43 message UnsubscribeResponse {} 44 45 // Message sent from publisher to topic actor 46 // See also PubSubBatch 47 message PubSubBatchTransport { 48 repeated string type_names = 1; 49 repeated PubSubEnvelope envelopes = 2; 50 } 51 52 // Contains message byte representation and type reference 53 message PubSubEnvelope { 54 int32 type_id = 1; 55 bytes message_data = 2; 56 int32 serializer_id = 3; 57 } 58 59 // Message sent from topic to delivery actor 60 message DeliverBatchRequestTransport { 61 Subscribers subscribers = 1; 62 PubSubBatchTransport batch = 2; 63 string topic = 3; 64 } 65 66 // Message sent from delivery actor to topic to notify of subscribers that fail to process the messages 67 message NotifyAboutFailingSubscribersRequest { 68 repeated SubscriberDeliveryReport invalid_deliveries = 1; 69 } 70 71 // Ack to the delivery actor after notification of subscribers that fail to process the messages 72 message NotifyAboutFailingSubscribersResponse {} 73 74 // Contains information about a failed delivery 75 message SubscriberDeliveryReport { 76 SubscriberIdentity subscriber = 1; 77 DeliveryStatus status = 2; 78 } 79 80 // Delivery status as seen by the delivery actor 81 enum DeliveryStatus { 82 // Message was put in the queue of the subscriber 83 Delivered = 0; 84 85 // Message did not reach subscriber, because it was dead 86 SubscriberNoLongerReachable = 1; 87 88 // Delivery timed out 89 Timeout = 2; 90 91 // Some other problem happened 92 OtherError = 127; 93 } 94 95 // Message posted to subscriber's mailbox, that is then unrolled to single messages, and has ability to auto respond 96 // See also PubSubAutoRespondBatch 97 message PubSubAutoRespondBatchTransport { 98 repeated string type_names = 1; 99 repeated PubSubEnvelope envelopes = 2; 100 } 101 102 // Status of the whole published batch or single message 103 enum PublishStatus { 104 // Batch or message was successfully published according to the delivery guarantees 105 Ok = 0; 106 107 // Topic failed to forward the message 108 Failed = 1; 109 } 110 111 // Publish ack/nack response 112 message PublishResponse { 113 // Status of the whole published batch or single message 114 PublishStatus status = 1; 115 }