lib/protocol/protocol.js
function encodeJoinGroupRequest (clientId, correlationId, groupId, memberId, sessionTimeout, groupProtocols) {
  var request = encodeRequestHeader(clientId, correlationId, REQUEST_TYPE.joinGroup);
  request
    .Int16BE(groupId.length)
    .string(groupId)
    .Int32BE(sessionTimeout)
    .Int16BE(memberId.length)
    .string(memberId)
    .Int16BE(GROUPS_PROTOCOL_TYPE.length)
    .string(GROUPS_PROTOCOL_TYPE)
    .Int32BE(groupProtocols.length);

  groupProtocols.forEach(encodeGroupProtocol.bind(request));

  return encodeRequestWithLength(request.make());
}
function encodeJoinGroupRequest (clientId, correlationId, groupId, memberId, sessionTimeout, groupProtocols) {
  var request = encodeRequestHeader(clientId, correlationId, REQUEST_TYPE.joinGroup);
  request
    .Int16BE(groupId.length)
    .string(groupId)
    .Int32BE(sessionTimeout)
    .Int16BE(memberId.length)
    .string(memberId)
    .Int16BE(GROUPS_PROTOCOL_TYPE.length)
    .string(GROUPS_PROTOCOL_TYPE)
    .Int32BE(groupProtocols.length);

  groupProtocols.forEach(encodeGroupProtocol.bind(request));

  return encodeRequestWithLength(request.make());
}
{ name: '', // string subscription: [/* topics */], version: 0, // integer userData: {} //arbitary } /*
JoinGroupRequest => GroupId SessionTimeout MemberId ProtocolType GroupProtocols
GroupId => string
SessionTimeout => int32
MemberId => string
ProtocolType => string
GroupProtocols => [ProtocolName ProtocolMetadata]
ProtocolName => string
ProtocolMetadata => bytes