• 检查kafka是否正常连接

    本文简单记录了利用java代码判断kafka是否正常工作。原理就是配置参数之后,连接kafka,看是否可以在规定的时间 (超时时间)内获取到topics

    2021-12-24[java]

    阅读更多
  • Spring Kafka Consumer and Producer Example

    Spring Kafka  Consumer and Producer Example

    This tutorial demonstrates how to send and receive messages from Spring Kafka. We start by creating a Spring Kafka Producer which is able to send messages to a Kafka topic. Next we create a Spring Kafka Consumer which is able to listen to messages send to a Kafka topic. We configure both with appropriate key/value serializers and deserializers. Finally we demonstrate the application using a simple Spring Boot application.

    2019-08-10[Java]

    阅读更多
  • Spring Kafka Adding Custom Header to Kafka Message Example

    In this tutorial we demonstrate how to add/read custom headers to/from a Kafka Message using Spring Kafka. We start by adding headers using either Message<?> or ProducerRecord<String, String>. Followed by reading the values inside the KafkaListener using @Header annotation and MessageHeaders class.

    2019-08-10[Java]

    阅读更多
  • Spring Kafka JSON Serializer and Deserializer Example

    The following tutorial demonstrates how to send and receive a Java Object as a JSON byte[] to and from Apache Kafka using Spring Kafka, Spring Boot and Maven. We’ll send a Java Object as JSON byte[] to a Kafka Topic using a JsonSerializer. Afterwards we’ll configure how to receive a JSON byte[] and automatically convert it to a Java Object using a JsonDeserializer.

    2019-08-10[Java]

    阅读更多
  • Spring Kafka Batch Listener Example

    In the following tutorial we demonstrate how to setup a batch listener using Spring Kafka, Spring Boot and Maven. We start by configuring the BatchListener. You can optionally configure a BatchErrorHandler. We also demonstrate how to set the upper limit of batch size messages. When we receive messages we also have the possibility of grabbing header values for individual messages.

    2019-08-10[Java]

    阅读更多
  • Spring Kafka and Spring Boot Configuration Example

    In the following tutorial we demonstrate how to configure Spring Kafka with Spring Boot. Spring Boot uses sensible default to configure Spring Kafka. We can override these defaults using the application.yml property file.

    2019-08-10[Java]

    阅读更多
  • Spring Kafka Forwarding Listener Results using @SendTo

    This tutorial demonstrates how to forward listener results using the @SendTo annotation using Spring Kafka, Spring Boot and Maven. We can use static typed topics, runtime expressions or application initialization expressions. Take a look at the following example.

    2019-08-10[Java]

    阅读更多
共有 7 条记录

 


  • 微信公众号

  • 我的微信

站点声明:

1、一号门博客CMS,由Python, MySQL, Nginx, Wsgi 强力驱动

2、部分文章或者资源来源于互联网, 有时候很难判断是否侵权, 若有侵权, 请联系邮箱:summer@yihaomen.com, 同时欢迎大家注册用户,主动发布无版权争议的 文章/资源.

3、鄂ICP备14001754号-3, 鄂公网安备 42280202422812号