@Override public void received(Consumer<T> consumer, Message<T> msg) { readerListener.received(ReaderImpl.this, msg); consumer.acknowledgeCumulativeAsync(msg); }
@Override public void validate(byte[] message) { if (message.length != 8) { throw new SchemaSerializationException("Size of data received by DoubleSchema is not 8"); } }
@Override public int compareTo(MessageId o) { return messageId.compareTo(o); } }
@Override public Map<String, String> getProperties() { return msg.getProperties(); }
@Override public long getPublishTime() { return msg.getPublishTime(); }
@Override public long getEventTime() { return msg.getEventTime(); }
@Override public boolean hasKey() { return msg.hasKey(); }
/** * Choose a partition based on msg and the topic metadata. * * @param msg message to route * @param metadata topic metadata * @return the partition to route the message. * @since 1.22.0 */ default int choosePartition(Message<?> msg, TopicMetadata metadata) { return choosePartition(msg); }
@Override public Optional<EncryptionContext> getEncryptionCtx() { return msg.getEncryptionCtx(); }
@Override public long getSequenceId() { return msg.getSequenceId(); }
@Override public void reachedEndOfTopic(Consumer<T> consumer) { readerListener.reachedEndOfTopic(ReaderImpl.this); } });
/** * Get the topic name without partition part of this message. * @return the name of the topic on which this message was published */ @Override public String getTopicName() { return msg.getTopicName(); }
@Override public boolean hasProperty(String name) { return msg.hasProperty(name); }
@Override public String getProperty(String name) { return msg.getProperty(name); }
@Override public void validate(byte[] message) { if (message.length != 4) { throw new SchemaSerializationException("Size of data received by FloatSchema is not 4"); } }
@Override public void validate(byte[] message) { if (message.length != 2) { throw new SchemaSerializationException("Size of data received by ShortSchema is not 2"); } }
@Override public void validate(byte[] message) { if (message.length != 1) { throw new SchemaSerializationException("Size of data received by ByteSchema is not 1"); } }
@Override public void validate(byte[] message) { if (message.length != 1) { throw new SchemaSerializationException("Size of data received by BooleanSchema is not 1"); } }
@Override public void validate(byte[] message) { if (message.length != 4) { throw new SchemaSerializationException("Size of data received by IntSchema is not 4"); } }
@Override public void validate(byte[] message) { if (message.length != 8) { throw new SchemaSerializationException("Size of data received by LongSchema is not 8"); } }