public class KafkaHeaderReader extends Object
Modifier and Type | Method and Description |
---|---|
static Object |
readValue(org.apache.kafka.common.header.Header header,
org.thales.punch.libraries.storm.api.HeaderDeclaration headerDeclaration)
Return a header value according to its configured declaration
For accepted value type and encodings, check @HeaderDeclaration class
|
static Integer |
toInt(byte[] headerValue,
org.thales.punch.libraries.storm.api.HeaderDeclaration declaration)
byte kafka header content to integer value according to byte ordering in header declaration
|
static Long |
toLong(byte[] headerValue,
org.thales.punch.libraries.storm.api.HeaderDeclaration declaration)
byte kafka header content to long value according to byte ordering in header declaration
|
static String |
toString(byte[] headerValue,
org.thales.punch.libraries.storm.api.HeaderDeclaration declaration)
byte kafka header content to string value according to value type in header declaration
|
public static Object readValue(org.apache.kafka.common.header.Header header, org.thales.punch.libraries.storm.api.HeaderDeclaration headerDeclaration)
header
- kafka custom header from recordheaderDeclaration
- configured header declaration with type, encoding, field name and behaviorpublic static String toString(byte[] headerValue, org.thales.punch.libraries.storm.api.HeaderDeclaration declaration)
headerValue
- kafka custom header value from recorddeclaration
- configured header declaration with type, encoding, field name and behaviorpublic static Integer toInt(byte[] headerValue, org.thales.punch.libraries.storm.api.HeaderDeclaration declaration)
headerValue
- kafka custom header value from recorddeclaration
- configured header declaration with type, byte ordering, field name and behaviorpublic static Long toLong(byte[] headerValue, org.thales.punch.libraries.storm.api.HeaderDeclaration declaration)
headerValue
- kafka custom header value from recorddeclaration
- configured header declaration with type, byte ordering, field name and behaviorCopyright © 2022. All rights reserved.