@@ -33,6 +33,9 @@ object PubSubRecord {
3333 * the unique identifier for the message
3434 * @param publishTime
3535 * the time at which the message was published
36+ * @param deliveryAttempt
37+ * Optional. The approximate number of times that Pub/Sub has attempted to deliver the associated message to a
38+ * subscriber. More precisely, this is 1 + (number of NACKs) + (number of ack_deadline exceeds) for this message.
3639 * @param ackId
3740 * the unique identifier for the acknowledgment of the message
3841 * @param ack
@@ -47,6 +50,7 @@ object PubSubRecord {
4750 val attributes : Map [String , String ],
4851 val messageId : Option [MessageId ],
4952 val publishTime : Option [Instant ],
53+ val deliveryAttempt : Option [Int ],
5054 val ackId : AckId ,
5155 val ack : F [Unit ],
5256 val nack : F [Unit ],
@@ -58,11 +62,13 @@ object PubSubRecord {
5862 attributes : Map [String , String ] = this .attributes,
5963 messageId : Option [MessageId ] = this .messageId,
6064 publishTime : Option [Instant ] = this .publishTime,
65+ deliveryAttempt : Option [Int ] = this .deliveryAttempt,
6166 ackId : AckId = this .ackId,
6267 ack : F [Unit ] = this .ack,
6368 nack : F [Unit ] = this .nack,
6469 extendDeadline : AckDeadline => F [Unit ] = this .extendDeadline
65- ): Subscriber [F , B ] = Subscriber (value, attributes, messageId, publishTime, ackId, ack, nack, extendDeadline)
70+ ): Subscriber [F , B ] =
71+ Subscriber (value, attributes, messageId, publishTime, deliveryAttempt, ackId, ack, nack, extendDeadline)
6672
6773 @ SuppressWarnings (Array (" scalafix:DisableSyntax.==" , " scalafix:Disable.equals" ))
6874 override def equals (obj : Any ): Boolean = obj match {
@@ -117,6 +123,8 @@ object PubSubRecord {
117123 * the unique identifier for the message
118124 * @param publishTime
119125 * the time at which the message was published
126+ * @param deliveryAttempt
127+ * the approximate number of times that Pub/Sub has attempted to deliver the associated message to a subscriber.
120128 * @param ackId
121129 * the unique identifier for the acknowledgment of the message
122130 * @param ack
@@ -133,12 +141,14 @@ object PubSubRecord {
133141 attributes : Map [String , String ],
134142 messageId : Option [MessageId ],
135143 publishTime : Option [Instant ],
144+ deliveryAttempt : Option [Int ],
136145 ackId : AckId ,
137146 ack : F [Unit ],
138147 nack : F [Unit ],
139148 extendDeadline : AckDeadline => F [Unit ]
140149 ): PubSubRecord .Subscriber [F , A ] =
141- new PubSubRecord .Subscriber (value, attributes, messageId, publishTime, ackId, ack, nack, extendDeadline) {}
150+ new PubSubRecord .Subscriber (value, attributes, messageId, publishTime, deliveryAttempt, ackId, ack, nack,
151+ extendDeadline) {}
142152
143153 // format: off
144154 def unapply [F [_], A ](record : PubSubRecord .Subscriber [F , A ]): Some [(Option [A ], Map [String , String ], Option [MessageId ], Option [Instant ], AckId , F [Unit ], F [Unit ], AckDeadline => F [Unit ])] =
0 commit comments