-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve mqtt-kafka to use only one kafka consumer group per mqtt client. #727
Improve mqtt-kafka to use only one kafka consumer group per mqtt client. #727
Conversation
…artial data frame while computing crc32c value
@@ -529,6 +529,8 @@ public void writeProduceEntryStart( | |||
MutableInteger position, | |||
long timestamp, | |||
long ownerId, | |||
long produceId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
long produceId, | |
long producerId, |
entryInfo.putInt(6 * Long.BYTES + Integer.BYTES, 0x00); | ||
entryInfo.putInt(6 * Long.BYTES + 2 * Integer.BYTES, NO_DELTA_POSITION); | ||
entryInfo.putShort(6 * Long.BYTES + 3 * Integer.BYTES, ackMode.value()); | ||
entryInfo.putLong(4 * Long.BYTES, produceId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
entryInfo.putLong(4 * Long.BYTES, produceId); | |
entryInfo.putLong(4 * Long.BYTES, producerId); |
factories.put(KafkaBeginExFW.KIND_OFFSET_FETCH, cacheOffsetFetchFactory); | ||
factories.put(KafkaBeginExFW.KIND_INIT_PRODUCE_ID, cacheInitProduceIdFactory); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
INIT_PRODUCER_ID
@@ -96,6 +96,8 @@ public final class KafkaCacheClientProduceFactory implements BindingHandler | |||
new Array32FW.Builder<>(new KafkaHeaderFW.Builder(), new KafkaHeaderFW()) | |||
.wrap(new UnsafeBuffer(new byte[8]), 0, 8) | |||
.build(); | |||
private static final long PRODUCE_FLUSH_PRODUCE_ID = -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private static final long PRODUCE_FLUSH_PRODUCE_ID = -1; | |
private static final long PRODUCE_FLUSH_PRODUCER_ID = -1; |
@@ -96,6 +96,8 @@ public final class KafkaCacheClientProduceFactory implements BindingHandler | |||
new Array32FW.Builder<>(new KafkaHeaderFW.Builder(), new KafkaHeaderFW()) | |||
.wrap(new UnsafeBuffer(new byte[8]), 0, 8) | |||
.build(); | |||
private static final long PRODUCE_FLUSH_PRODUCE_ID = -1; | |||
private static final short PRODUCE_FLUSH_PRODUCE_EPOCH = -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private static final short PRODUCE_FLUSH_PRODUCE_EPOCH = -1; | |
private static final short PRODUCE_FLUSH_PRODUCER_EPOCH = -1; |
return limit; | ||
} | ||
|
||
private final class KafkaInitProduceIdStream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private final class KafkaInitProduceIdStream | |
private final class KafkaInitProducerIdStream |
} | ||
} | ||
|
||
private final class KafkaInitProduceIdClient extends KafkaSaslClient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private final class KafkaInitProduceIdClient extends KafkaSaslClient | |
private final class KafkaInitProducerIdClient extends KafkaSaslClient |
final InitProduceIdRequestFW initProduceIdRequest = | ||
initProduceIdRequestRW.wrap(encodeBuffer, encodeProgress, encodeLimit) | ||
.producerId(produceId) | ||
.producerEpoch(produceEpoch) | ||
.build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final InitProduceIdRequestFW initProduceIdRequest = | |
initProduceIdRequestRW.wrap(encodeBuffer, encodeProgress, encodeLimit) | |
.producerId(produceId) | |
.producerEpoch(produceEpoch) | |
.build(); | |
final InitProducerIdRequestFW initProducerIdRequest = | |
initProducerIdRequestRW.wrap(encodeBuffer, encodeProgress, encodeLimit) | |
.producerId(produceId) | |
.producerEpoch(produceEpoch) | |
.build(); |
signaler.signalNow(originId, routedId, initialId, traceId, SIGNAL_NEXT_REQUEST, 0); | ||
} | ||
|
||
private void onDecodeInitProduceIdResponse( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private void onDecodeInitProduceIdResponse( | |
private void onDecodeInitProducerIdResponse( |
@@ -185,6 +186,7 @@ scope kafka | |||
case 253: kafka::stream::KafkaGroupBeginEx group; | |||
case 254: kafka::stream::KafkaBootstrapBeginEx bootstrap; | |||
case 255: kafka::stream::KafkaMergedBeginEx merged; | |||
case 22: kafka::stream::KafkaInitProduceIdBeginEx initProduceId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
case 22: kafka::stream::KafkaInitProduceIdBeginEx initProduceId; | |
case 22: kafka::stream::KafkaInitProducerIdBeginEx initProducerId; |
|
||
KafkaInitProduceIdBeginExFW initProduceIdBeginEx = beginEx.initProduceId(); | ||
KafkaInitProducerIdBeginExFW initProduceIdBeginEx = beginEx.initProducerId(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
KafkaInitProducerIdBeginExFW initProduceIdBeginEx = beginEx.initProducerId(); | |
KafkaInitProducerIdBeginExFW initProducerIdBeginEx = beginEx.initProducerId(); |
Description
Improve mqtt-kafka to use only one kafka consumer group per mqtt client.