Java Code Examples for org.apache.kafka.common.header.Headers#remove()

The following examples show how to use org.apache.kafka.common.header.Headers#remove() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BinderHeaderMapper.java    From spring-cloud-stream-binder-kafka with Apache License 2.0 5 votes vote down vote up
/**
 * Remove never headers.
 * @param headers the headers from which to remove the never headers.
 * @since 3.0.2
 */
public static void removeNeverHeaders(Headers headers) {
	headers.remove(MessageHeaders.ID);
	headers.remove(MessageHeaders.TIMESTAMP);
	headers.remove(IntegrationMessageHeaderAccessor.DELIVERY_ATTEMPT);
	headers.remove(BinderHeaders.NATIVE_HEADERS_PRESENT);
}
 
Example 2
Source File: KafkaHeaders.java    From brave with Apache License 2.0 4 votes vote down vote up
static void replaceHeader(Headers headers, String key, String value) {
  headers.remove(key);
  headers.add(key, value.getBytes(UTF_8));
}
 
Example 3
Source File: KafkaHeaders.java    From brave with Apache License 2.0 4 votes vote down vote up
static void replaceHeader(Headers headers, String key, String value) {
  headers.remove(key);
  headers.add(key, value.getBytes(UTF_8));
}