Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
/**
* Response from publish / download from PayloadStore back to the serialization layer
* It contains the final path, response code and the encountered exception if there was any. 
*/
public class PayloadResponse {
    public final int responseCode;
    public final String path;
    public final PayloadStoreException PayloadStoreExceptionpayloadStoreException;
	public final Boolean retriable;
    /**
     * Construct payload response with response code and payload id.
     */
    public PayloadResponse(int responseCode, String path) {
        this(responseCode, path, null);
    }

    /**
     * Construct payload response with response code, payload id and exception.
     */
    public PayloadResponse(int responseCode, String path, PayloadStoreException payloadStoreException, Boolean retriable) {
        this.responseCode = responseCode;
        this.fullPayloadPath = path;
        this.PayloadStoreExceptionpayloadStoreException = payloadStoreException;
		this.retriable = retriable;
     }
}

Example

Code Block
languagejava
Map<String, Object> producerConfig = new HashMap<>();
producerConfig.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
producerConfig.put("value.serializers",
        "org.apache.kafka.common.serialization.DoubleSerializer,org.apache.kafka.common.serialization.LargeMessageSerializer");  producerConfig.put("large.message.payload.store.class", "CustomS3Store")
 producerConfig.put("s3.bucket", "my-bucket")
producerConfig.put("bootstrap.servers", "localhost:9092");

KafkaProducer<String, Double> producer = new KafkaProducer<>(producerConfig);

...