func (ap *publisher) Publish(ctx context.Context, message *message) error {
	msgJSON, err := json.Marshal(message)
	if err != nil {
		return errors.Wrap(err, "unable to marshal message")
	}

	if getIsLambdaApp(ctx) {
		return ap.awsClient.PublishSNS(ctx, message.Metadata.Priority, string(msgJSON), message.Headers)
	}

	return ap.awsClient.SendMessageSQS(ctx, message.Metadata.Priority, string(msgJSON), message.Headers)
}
// Publish a message on Taskhawk
Publish a message on Taskhawk
// Publish a message on Taskhawk
func (ap *publisher) Publish(ctx context.Context, message *message) error {
	msgJSON, err := json.Marshal(message)
	if err != nil {
		return errors.Wrap(err, "unable to marshal message")
	}
	if getIsLambdaApp(ctx) {
		return ap.awsClient.PublishSNS(ctx, message.Metadata.Priority, string(msgJSON), message.Headers)
	}
	return ap.awsClient.SendMessageSQS(ctx, message.Metadata.Priority, string(msgJSON), message.Headers)
}
func ( ap * publisher ) Publish ( ctx context . Context , message * message ) error { msgJSON , err := json . Marshal ( message ) if err != nil { return errors . Wrap ( err , " " ) } if getIsLambdaApp ( ctx ) { return ap . awsClient . PublishSNS ( ctx , message . Metadata . Priority , string ( msgJSON ) , message . Headers ) } return ap . awsClient . SendMessageSQS ( ctx , message . Metadata . Priority , string ( msgJSON ) , message . Headers ) }
Publish a message on Taskhawk
Publish a message on Taskhawk