Skip to content

Commit

Permalink
hstream-kafka-client: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
alissa-tung committed Sep 27, 2023
1 parent f3f421d commit 99770c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions hstream-kafka/client/HStream/Kafka/Client/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ handleCreateTopic opts topicName numPartitions replicationFactor = do
, K.requestApiVersion = 0
, K.requestCorrelationId = 1 -- FIXME
, K.requestClientId = requestClientId
, K.requesteTaggedFields = Right K.EmptyTaggedFields
, K.requesteTaggedFields = Left K.Unsupported
}
reqBody = K.CreateTopicsRequestV0
(K.KaArray $ Just [topic])
Expand All @@ -110,7 +110,7 @@ handleDeleteTopic opts topicName = do
, K.requestApiVersion = 0
, K.requestCorrelationId = 1 -- FIXME
, K.requestClientId = requestClientId
, K.requesteTaggedFields = Right K.EmptyTaggedFields
, K.requesteTaggedFields = Left K.Unsupported
}
reqBody = K.DeleteTopicsRequestV0
(K.KaArray $ Just [T.pack topicName])
Expand Down
2 changes: 1 addition & 1 deletion hstream-kafka/client/HStream/Kafka/Client/Network.hs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ sendAndRecv :: forall req resp header.
sendAndRecv opts reqHeader reqBody = withSock opts $ \sock -> do
let reqBs' = K.runPut reqHeader <> K.runPut @req reqBody
reqLen = K.runPut @Int32 $ fromIntegral (BS.length reqBs')
reqBs = reqLen <> reqBs
reqBs = reqLen <> reqBs'
NW.sendAll sock reqBs
recvResp @resp sock

0 comments on commit 99770c0

Please sign in to comment.