Write writes a message to the kafka broker that this connection was established to. The method returns the number of bytes written, or an error if something went wrong. The operation either succeeds or fail, it never partially writes the message. This method is exposed to satisfy the net.Conn inte
(b []byte)
| 1098 | // This method is exposed to satisfy the net.Conn interface but is less efficient |
| 1099 | // than the more general purpose WriteMessages method. |
| 1100 | func (c *Conn) Write(b []byte) (int, error) { |
| 1101 | return c.WriteCompressedMessages(nil, Message{Value: b}) |
| 1102 | } |
| 1103 | |
| 1104 | // WriteMessages writes a batch of messages to the connection's topic and |
| 1105 | // partition, returning the number of bytes written. The write is an atomic |