Skip to content

Commit

Permalink
Add protocol dto classes #5
Browse files Browse the repository at this point in the history
- partial coordinator API
  • Loading branch information
Kindrat committed Nov 29, 2015
1 parent 6c49fd2 commit 7a516a9
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.github.nginate.kafka.protocol.messages.request;

import com.github.nginate.kafka.protocol.messages.Request;
import com.github.nginate.kafka.protocol.types.Type;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;

import static com.github.nginate.kafka.protocol.types.TypeName.STRING;

/**
* The offsets for a given consumer group are maintained by a specific broker called the group coordinator. i.e., a
* consumer needs to issue its offset commit and fetch requests to this specific broker. It can discover the current
* coordinator by issuing a group coordinator request.
*/
@Data
@Builder
//@ApiKey(ApiKeys.) FIXME
@EqualsAndHashCode(callSuper = true)
public class GroupCoordinatorRequest extends Request {
@Type(STRING)
private String groupId;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.github.nginate.kafka.protocol.messages.response;

import com.github.nginate.kafka.protocol.messages.Response;
import com.github.nginate.kafka.protocol.types.Type;
import lombok.Data;
import lombok.EqualsAndHashCode;

import static com.github.nginate.kafka.protocol.types.TypeName.INT16;
import static com.github.nginate.kafka.protocol.types.TypeName.INT32;
import static com.github.nginate.kafka.protocol.types.TypeName.STRING;

@Data
//@ApiKey(ApiKeys.) FIXME
@EqualsAndHashCode(callSuper = true)
public class GroupCoordinatorResponse extends Response {
@Type(INT16)
private Short errorCode;
@Type(INT32)
private Integer coordinatorId;
@Type(STRING)
private String coordinatorHost;
@Type(INT32)
private Integer coordinatorPort;
}

0 comments on commit 7a516a9

Please sign in to comment.