+
+func (r RegistratorImpl) RegisterProducer(producerId string, producerInfo *ProducerRegistrationInfo) error {
+ if body, marshalErr := json.Marshal(producerInfo); marshalErr == nil {
+ if putErr := restclient.Put(r.infoCoordinatorAddress+registerProducerPath+url.PathEscape(producerId), []byte(body)); putErr != nil {
+ return putErr
+ }
+ log.Debugf("Registered producer: %v", producerId)
+ return nil
+ } else {
+ return marshalErr
+ }
+}