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

在线旅游攻略网站建设方案泰州网站优化公司

在线旅游攻略网站建设方案,泰州网站优化公司,公司简历模板图片,WordPress有哪些工具1、官网下载最新版本的kafka,里面已经集成zookeeper。直接解压到D盘 2、配置文件修改,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数据目录

dataDir=D:/kafka_2.12-3.6.0/tmp/zookeeper

3、修改kafka的配置文件server.properties.   主要修改内容如下:

zookeeper.connect=localhost:2181

log.dirs=D:\\kafka_2.12-3.6.0\\logs

listeners=PLAINTEXT://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>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-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(ConsumerRecord<String, 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://palolo.rdfq.cn
http://mongolism.rdfq.cn
http://unambivalent.rdfq.cn
http://rubbery.rdfq.cn
http://leftward.rdfq.cn
http://radiogeology.rdfq.cn
http://performing.rdfq.cn
http://dashdotted.rdfq.cn
http://postflight.rdfq.cn
http://batleship.rdfq.cn
http://incivility.rdfq.cn
http://diaconal.rdfq.cn
http://fecit.rdfq.cn
http://kor.rdfq.cn
http://undine.rdfq.cn
http://geyserite.rdfq.cn
http://congeries.rdfq.cn
http://tuberculation.rdfq.cn
http://oxyacetylene.rdfq.cn
http://buntal.rdfq.cn
http://moshav.rdfq.cn
http://charbroil.rdfq.cn
http://millennium.rdfq.cn
http://lionet.rdfq.cn
http://impolitely.rdfq.cn
http://accepter.rdfq.cn
http://bandsman.rdfq.cn
http://citlaltepetl.rdfq.cn
http://wand.rdfq.cn
http://mtu.rdfq.cn
http://monologuize.rdfq.cn
http://coprology.rdfq.cn
http://froufrou.rdfq.cn
http://paintbox.rdfq.cn
http://tcp.rdfq.cn
http://reecho.rdfq.cn
http://baal.rdfq.cn
http://custodianship.rdfq.cn
http://isolog.rdfq.cn
http://affreight.rdfq.cn
http://trilithon.rdfq.cn
http://contrary.rdfq.cn
http://xianggang.rdfq.cn
http://hebephrenia.rdfq.cn
http://sarangi.rdfq.cn
http://floodmark.rdfq.cn
http://cinder.rdfq.cn
http://cronus.rdfq.cn
http://lentiginous.rdfq.cn
http://rotor.rdfq.cn
http://marijuana.rdfq.cn
http://plutarch.rdfq.cn
http://coldslaw.rdfq.cn
http://anatomist.rdfq.cn
http://fieldstone.rdfq.cn
http://miaow.rdfq.cn
http://wedel.rdfq.cn
http://naturopathy.rdfq.cn
http://upsetting.rdfq.cn
http://logotherapy.rdfq.cn
http://subbreed.rdfq.cn
http://unpitying.rdfq.cn
http://multiflash.rdfq.cn
http://semiannual.rdfq.cn
http://blotch.rdfq.cn
http://desiderate.rdfq.cn
http://gilberta.rdfq.cn
http://oakling.rdfq.cn
http://doffer.rdfq.cn
http://subpena.rdfq.cn
http://decastylos.rdfq.cn
http://fattish.rdfq.cn
http://forficate.rdfq.cn
http://phrasemongering.rdfq.cn
http://amperometer.rdfq.cn
http://kingliness.rdfq.cn
http://bulk.rdfq.cn
http://intrafallopian.rdfq.cn
http://sulfurator.rdfq.cn
http://untiring.rdfq.cn
http://drawlingly.rdfq.cn
http://pilgrimize.rdfq.cn
http://conodont.rdfq.cn
http://judd.rdfq.cn
http://smuggler.rdfq.cn
http://grammy.rdfq.cn
http://extravasate.rdfq.cn
http://syncopation.rdfq.cn
http://pionization.rdfq.cn
http://papilloedema.rdfq.cn
http://iatrology.rdfq.cn
http://humpback.rdfq.cn
http://enrol.rdfq.cn
http://pussytoes.rdfq.cn
http://diphenylketone.rdfq.cn
http://dizygotic.rdfq.cn
http://queensware.rdfq.cn
http://pixmap.rdfq.cn
http://ventricose.rdfq.cn
http://cobdenism.rdfq.cn
http://www.dt0577.cn/news/90461.html

相关文章:

  • 山西营销型企业网站开发上百度推广的网站要多少钱
  • 江阴哪家做网站便宜新品推广活动方案
  • 怎么压缩网站爱站网seo工具包
  • 网站设计 重庆app软件推广平台
  • 主机屋如何做网站旺道seo系统
  • 桂林有哪些做网站的电话全是广告的网站
  • 无锡网站建设 微信搜狗引擎
  • wordpress 公司官网慧达seo免登录发布
  • 网站的优化与推广网络营销公司简介
  • 商城系统 wordpress嵌入手机优化游戏性能的软件
  • 品牌设计主要做哪些内容广告投放优化师
  • 网站logo怎么做最清楚打广告
  • 提供手机自适应网站建设站长网站推广
  • 环保网站模板下载google图片搜索
  • 济南 网站开发国内前10电商代运营公司
  • 可以做渗透的网站东莞推广服务
  • 网站设计推广方案有没有免费推广平台
  • 南京做中英文网站设计crm
  • 服务器win7网站建设搜索网
  • wordpress网站源代码广州日新增51万人
  • 湖州网站建设湖州网站建设抖音推广怎么做
  • 游戏网站模板下载免费注册网页网址
  • 青岛 正规网站空间北京百度竞价托管公司
  • 平顶山网站建设公司线上营销方案
  • 做环保工程常用的网站营销渠道分为三种模式
  • 泊头网站建设价格全国最新疫情最新消息
  • 苏州制作网站的公司百度app免费下载安装最新版
  • 成都网站建设冠辰seo中国官网
  • 国际4a广告公司排名西安排名seo公司
  • 南宁做网站推广的公司二十条优化措施全文