When Camel receives a PubSub message with reserved Google PubSub attributes these are set on a Camel header and passed on to any message sender. These reserved attributes are not allowed to be set on an outgoing message so this throws an error.
1) We can filter out these reserved attributes before sending.
2) We could also use another Camel header to store the reserved attributes which will not be used when sending.
3) We could also map all attributes to headers and vice versa like we do with other transports. The real issues with this is that PubSub only supports string values as attributes. And we still need to filter out the reserved attributes.
I think we should implement option 1 regardless, to make sure this never cause issues again. Perhaps combine it with option 2 to map to "googclient_deliveryattempt" attribute to the "CamelGooglePubsub.DeliveryAttempt" header.
I've already prepared a fix based on the proposed solution 1: https://github.com/apache/camel/pull/4343