Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleMessage ¶ added in v0.1.1
func HandleMessage( msg *message.Message, target proto.Message, handler func(ctx context.Context) error, ) error
HandleMessage - Handles a message by first unmarshalling its payload to the provided 'target' and then invoking the provided handler with the context of the message. If the unmarshalling fails then we will never be able to handle this message so we ack it to "get rid of it" and return an error. But if the provided handler fails then we the message will be nack'ed (to trigger a redelivery) and no error is returned (it's up to the provided handler to log this error).
The rules are as follows: To receive the next message, `Ack()` must be called on the received message, but if the message processing failed and message should be redelivered then `Nack()` shall be called.
Types ¶
type Subscriber ¶
type Subscriber struct {
message.Subscriber
}
func NewSubscriber ¶
func NewSubscriber( logger *zap.Logger, config *SubscriberConfig, registerHttpHandler googlecloud_http.RegisterHttpHandler, ) *Subscriber
type SubscriberConfig ¶
type SubscriberConfig struct { }