Skip to content

Instantly share code, notes, and snippets.

Avatar

Sid Sam sidsamant

  • SS&C Technologies
  • India
View GitHub Profile
View application.yml
spring.cloud:
stream:
default:
consumer:
maxAttempts: 2
kafka:
default:
consumer:
useNativeDecoding: true
enableDlq: true
View application.yml
spring.kafka:
bootstrapServers: "my-kafka-node-url"
View application.yml
spring.cloud.stream:
kafka.bindings:
my-function.consumer.configuration:
key.deserializer: org.springframework.kafka.support.serializer.ErrorHandlingDeserialzier
value.deserializer: org.springframework.kafka.support.serializer.ErrorHandlingDeserialzier
spring.deserializer.key.delegate.class: org.apache.kafka.common.serialization.StringDeserializer
spring.deserializer.value.delegate.class: io.confluent.kafka.serializers.KafkaAvroDeserializer
View gist:6279d1747f463d082272c8b432544271
@Bean
ListenerContainerWithDlqAndRetryCustomizer cust(KafkaTemplate<?, ?> template) {
return new ListenerContainerWithDlqAndRetryCustomizer() {
@Override
public void configure(AbstractMessageListenerContainer<?, ?> container, String destinationName,
String group,
@Nullable BiFunction<ConsumerRecord<?, ?>, Exception, TopicPartition> dlqDestinationResolver,
@Nullable BackOff backOff) {
@sidsamant
sidsamant / gist:9a098fd3d8fbb7bf40ed349e0efb95dd
Last active May 5, 2018
VM VirtualBox Host-Only Adapter, Static IP, Internet Access, Windows 10 Host, Fedora 26 Guest
View gist:9a098fd3d8fbb7bf40ed349e0efb95dd
Steps I followed to have my windows 10 host connect to Fedora 26 guest with static IP though host-only adapter and also allow the VM to connect to Internet through the host.
In VM VirtualBox,
1. File -> Preferences -> Network
NAT Networks tab
------------------
a. Hit the icon for 'Adds new NAT network'.
b. Wait till a new NAT Network adapter is created and added to the list. For me, it was named as 'NatNetwork'.