Your ROOT_URL in app.ini is http://git.slaventius.ru/ but you are visiting http://37.143.12.169/test3k/authPostman/src/commit/30e4e9bd322dc6b0407e43f94cc986d0c220f74f/vendor/github.com/segmentio/kafka-go/protocol/roundtrip.go You should set ROOT_URL correctly, otherwise the web may not work correctly.
 
 
 
 

28 lines
740 B

package protocol
import (
"io"
)
// RoundTrip sends a request to a kafka broker and returns the response.
func RoundTrip(rw io.ReadWriter, apiVersion int16, correlationID int32, clientID string, req Message) (Message, error) {
if err := WriteRequest(rw, apiVersion, correlationID, clientID, req); err != nil {
return nil, err
}
if !hasResponse(req) {
return nil, nil
}
id, res, err := ReadResponse(rw, req.ApiKey(), apiVersion)
if err != nil {
return nil, err
}
if id != correlationID {
return nil, Errorf("correlation id mismatch (expected=%d, found=%d)", correlationID, id)
}
return res, nil
}
func hasResponse(msg Message) bool {
x, _ := msg.(interface{ HasResponse() bool })
return x == nil || x.HasResponse()
}