当前位置: 首页 > news >正文

为什么要在南极建站建app需要多少钱

为什么要在南极建站,建app需要多少钱,沈阳企业建站模板,南宁市做公司网站1、官网下载最新版本的kafka#xff0c;里面已经集成zookeeper。直接解压到D盘 2、配置文件修改#xff0c;config目录下面的zookeeper.properties. 设置zookeeper数据目录 dataDirD:/kafka_2.12-3.6.0/tmp/zookeeper 3、修改kafka的配置文件server.properties. 主要修…1、官网下载最新版本的kafka里面已经集成zookeeper。直接解压到D盘 2、配置文件修改config目录下面的zookeeper.properties.   设置zookeeper数据目录 dataDirD:/kafka_2.12-3.6.0/tmp/zookeeper 3、修改kafka的配置文件server.properties.   主要修改内容如下 zookeeper.connectlocalhost:2181 log.dirsD:\\kafka_2.12-3.6.0\\logs listenersPLAINTEXT://localhost:9092 其他默认即可。 4、修改完成后进入bin目录启动zookeeper和kafka命令如下 zookeeper-server-start.bat ../../config/zookeeper.properties kafka-server-start.bat ../../config/server.properties 5、命令行创建topic命令如下 kafka-topics.bat --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic hello 6、创建生产者和消费者测试。生产者输入消息消费者就会收到相应的消息了  kafka-console-producer.bat --broker-list localhost:9092 --topic hello kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic hello--from-beginning 7、创建springboot工程测试 引入依赖 dependency groupIdorg.springframework.boot/groupId artifactIdspring-boot-starter-web/artifactId /dependency dependency groupIdorg.springframework.boot/groupId artifactIdspring-boot-starter-test/artifactId scopetest/scope /dependency dependency groupIdorg.springframework.kafka/groupId artifactIdspring-kafka/artifactId /dependency 8、yml文件配置kafka spring: kafka: bootstrap-servers: localhost:9092 producer: acks: 1 retries: 3 batch-size: 16384 properties: linger: ms: 0 buffer-memory: 33554432 key-serializer: org.apache.kafka.common.serialization.StringSerializer value-serializer: org.apache.kafka.common.serialization.StringSerializer consumer: group-id: helloGroup enable-auto-commit: false auto-commit-interval: 1000 auto-offset-reset: latest properties: request: timeout: ms: 18000 session: timeout: ms: 12000 key-deserializer: org.apache.kafka.common.serialization.StringDeserializer value-deserializer: org.apache.kafka.common.serialization.StringDeserializer 9、使用springboot    KafkaTemplate发送消息 RequestMapping(value /sendMessage, method RequestMethod.GET) public String sendMessage(String message) { kafkaTemplate.send(hello, message); return 发送成功~; } 10、消息消费 KafkaListener(topics hello) public void receiveMessage(ConsumerRecordString, String record) { String topic record.topic(); long offset record.offset(); int partition record.partition(); String message record.value(); System.out.println(topic topic); System.out.println(offset offset); System.out.println(partition partition); System.out.println(message message); }
http://www.hkea.cn/news/14465547/

相关文章:

  • 卖建材的网站有哪些wordpress设置菜单跳转到锚
  • 网站做全景图ppt接单兼职网站
  • 网站建设静态网页简要概括自建网站的优缺点
  • 东莞站福公司工资英文站用wordpress
  • 网站建设遵循的原则是什么山东兴华建设集团有限公司网站拼音
  • 高端的网站设计费用icoc.cc是哪个网站域名
  • jsp网站开发源码实例wordpress写文章排版
  • 厦门模板做网站wordpress is_single()
  • 兰州拼团网站建设工作中网页开发方案
  • 单页网站排名没有莆田室内设计公司排名
  • 哈尔滨城乡建设局网站首页创世网站
  • 阿里云搭建公司网站苏州网络推广软件
  • 做网站维护价格丝芙兰网站做的好差
  • 95598网站服务建设上海松江网站设计公司
  • 河源市住宅和城乡规划建设局网站做网站商机
  • 招聘网站哪个好英文域名在哪个网站查询
  • 怎样更新网站快照h5制作小程序有哪些
  • 做网站维护工资多少白云建设网站
  • 网站建设项目实训心得网站栏目关键词
  • 如何做实验室网站做公司网站有用吗
  • wordpress建站欣赏网站的技术建设方案
  • 什么是网络营销策略优化大师的功能有哪些
  • 株洲建设网站制作做网站的第一步
  • 上海市建设工程材料网站合肥科技网站建设
  • 建立旅游公司网站多钱wordpress怎么实时刷新数据
  • 建设企业网站中国建设银行开一个小公司需要多少钱
  • 免费个人网站建设公司业务外包是什么意思
  • 云南工程建设投标网上报名网站西安品牌策划公司排名
  • 网站图片怎么做超链接做外贸生意用哪个网站
  • 阿里国际网站官网入口制作网站链接