Search in sources :

Example 1 with AddOffsetsToTxnResponseData

use of org.apache.kafka.common.message.AddOffsetsToTxnResponseData in project kafka by apache.

the class TransactionManagerTest method prepareAddOffsetsToTxnResponse.

private void prepareAddOffsetsToTxnResponse(final Errors error, final String consumerGroupId, final long producerId, final short producerEpoch) {
    client.prepareResponse(body -> {
        AddOffsetsToTxnRequest addOffsetsToTxnRequest = (AddOffsetsToTxnRequest) body;
        assertEquals(consumerGroupId, addOffsetsToTxnRequest.data().groupId());
        assertEquals(transactionalId, addOffsetsToTxnRequest.data().transactionalId());
        assertEquals(producerId, addOffsetsToTxnRequest.data().producerId());
        assertEquals(producerEpoch, addOffsetsToTxnRequest.data().producerEpoch());
        return true;
    }, new AddOffsetsToTxnResponse(new AddOffsetsToTxnResponseData().setErrorCode(error.code())));
}
Also used : AddOffsetsToTxnRequest(org.apache.kafka.common.requests.AddOffsetsToTxnRequest) AddOffsetsToTxnResponse(org.apache.kafka.common.requests.AddOffsetsToTxnResponse) AddOffsetsToTxnResponseData(org.apache.kafka.common.message.AddOffsetsToTxnResponseData)

Aggregations

AddOffsetsToTxnResponseData (org.apache.kafka.common.message.AddOffsetsToTxnResponseData)1 AddOffsetsToTxnRequest (org.apache.kafka.common.requests.AddOffsetsToTxnRequest)1 AddOffsetsToTxnResponse (org.apache.kafka.common.requests.AddOffsetsToTxnResponse)1