Jelajahi Sumber

Checkpoint wip producing messages

Evan Huus 11 tahun lalu
induk
melakukan
0db1060be3
2 mengubah file dengan 21 tambahan dan 0 penghapusan
  1. 5 0
      message.go
  2. 16 0
      produce_request.go

+ 5 - 0
message.go

@@ -70,3 +70,8 @@ func (m *message) decode(pd packetDecoder) (err error) {
 
 	return nil
 }
+
+func newMessageFromString(in string) message {
+	buf := make([]byte, len(in))
+	return message{COMPRESSION_NONE, nil, &buf}
+}

+ 16 - 0
produce_request.go

@@ -1 +1,17 @@
 package kafka
+
+type produceRequestPartitionBlock struct {
+	partition int32
+	msgSet *messageSet
+}
+
+type produceRequestTopicBlock struct {
+	topic *string
+	partitions []produceRequestPartitionBlock
+}
+
+type produceRequest struct {
+	requiredAcks int16
+	timeout int32
+	topics []produceRequestTopicBlock
+}