All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mageddo.tobby.converter.RecordProcessedMapper Maven / Gradle / Ivy

There is a newer version: 2.1.6-alpha
Show newest version
package com.mageddo.tobby.converter;

import java.sql.PreparedStatement;
import java.sql.SQLException;

import com.mageddo.tobby.ProducedRecord;
import com.mageddo.tobby.internal.utils.Base64;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;

@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class RecordProcessedMapper {
  public static void map(PreparedStatement stm, ProducedRecord record) throws SQLException {
    stm.setString(1, record.getId().toString());
    stm.setString(2, record.getTopic());
    stm.setObject(3, record.getPartition());
    stm.setString(4, Base64.encodeToString(record.getKey()));
    stm.setString(5, Base64.encodeToString(record.getValue()));
    stm.setString(6, HeadersConverter.encodeBase64(record.getHeaders()));  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy