Coder Social home page Coder Social logo

tangkuo / kafka-samples-java Goto Github PK

View Code? Open in Web Editor NEW

This project forked from baidubce/kafka-samples-java

0.0 3.0 0.0 14 KB

Samples for using native kafka client to access Baidu Kafka service

License: MIT License

Batchfile 1.60% Shell 1.67% Java 96.73%

kafka-samples-java's Introduction

百度Kafka服务Java源代码样例

百度Kafka是托管的Kafka消息服务。完全兼容开源Kafka。本样例展示如何使用Kafka原生客户端访问百度Kafka服务。 改样例包含可执行的源代码,如果需要,您可以直接基于样例中的代码进行再次开发。

如何运行

运行环境

准备topic和SSL证书

准备工作的细节请参考BCE官网帮助文档

  1. 在BCE管理控制台中创建好topic。
  2. 在BCE管理控制台中下载您的jks证书文件和kafka客户端配置文件。
  3. 用上一步的文件替换样例代码中的client.keystore.jks, client.truststore.jks以及src/main/resources/client.properties

运行样例代码

windows环境请执行:

run.bat your_topic_name

linux环境请执行:

sh run.sh your_topic_name

参考链接

Baidu Kafka Java Samples

Baidu Kafka is a fully managed kafka compatible message service. This sample illustrates how to access Baidu Kafka using open source kafka client.

How to run

Kafka-samples-java requires

Prepare your topic and SSL certificates

Please follow guide on cloud.baidu.com for detail.

  1. Create your own topic in BCE console.
  2. Download your own certificate files and kafka client properties files in BCE console.
  3. Replace client.keystore.jks, client.truststore.jks and src/main/resources/client.properties with your own.

Run the sample

On windows execute

run.bat your_topic_name

On linux execute

sh run.sh your_topic_name

Links

kafka-samples-java's People

Contributors

wolvever avatar zhangfaen avatar

Watchers

James Cloos avatar  avatar  avatar

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.