Giter Club home page Giter Club logo

kafka's Introduction

kafka linux 下载地址: http://kafka.apache.org/downloads

启动zookeeper cd进入kafka解压目录,输入 bin/zookeeper-server-start.sh config/zookeeper.properties

启动kafka cd进入kafka解压目录,输入 bin/kafka-server-start.sh config/server.properties

创建一个topic Kafka通过topic对同一类的数据进行管理,同一类的数据使用同一个topic可以在处理数据时更加的便捷 在kafka解压目录打开终端,输入 bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test 创建一个名为test的topic

在创建topic后可以通过输入 bin/kafka-topics.sh --list --zookeeper localhost:2181 来查看已经创建的topic

创建一个消息消费者 在kafka解压目录打开终端,输入 bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning 可以创建一个用于消费topic为test的消费者

创建一个消息生产者z 在kafka解压目录打开一个新的终端,输入 bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test

点对点模式: 消费者同在一个group 就只能有其中一个消费着能获取到这条信息

订阅模式: 消费者在不同的group 中 全部消费者都能获取到这条信息

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.