// Publish publishes a verifiable credential to a message queue for processing.
Publish publishes a verifiable credential to a message queue for processing.
// Publish publishes a verifiable credential to a message queue for processing .
func (h *Publisher) Publish(anchorEvent *vocab.AnchorEventType) error {
	payload, err := h.jsonMarshal(anchorEvent)
	if err != nil {
		return fmt.Errorf("publish anchor event: %w", err)
	}
	msg := message.NewMessage(watermill.NewUUID(), payload)
	logger.Debugf("Publishing anchor event to topic [%s]: %s", anchorEventTopic, anchorEvent)
	err = h.pubSub.Publish(anchorEventTopic, msg)
	if err != nil {
		return errors.NewTransient(err)
	}
	return nil
}
func ( h * Publisher ) Publish ( anchorEvent * vocab . AnchorEventType ) error { payload , err := h . jsonMarshal ( anchorEvent ) if err != nil { return fmt . Errorf ( " " , err ) } msg := message . NewMessage ( watermill . NewUUID ( ) , payload ) logger . Debugf ( " " , anchorEventTopic , anchorEvent ) err = h . pubSub . Publish ( anchorEventTopic , msg ) if err != nil { return errors . NewTransient ( err ) } return nil }
Publish publishes a verifiable credential to a message queue for processing.
Publish publishes a verifiable credential to a message queue for processing .