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

在线旅游攻略网站建设方案360关键词排名推广

在线旅游攻略网站建设方案,360关键词排名推广,营销型网站平台建设,qq空间 wordpress1、官网下载最新版本的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://dullish.rkLs.cn
http://worshiper.rkLs.cn
http://perfunctory.rkLs.cn
http://glarney.rkLs.cn
http://adnoun.rkLs.cn
http://kingsun.rkLs.cn
http://hedonic.rkLs.cn
http://overstory.rkLs.cn
http://acquisitively.rkLs.cn
http://balaam.rkLs.cn
http://ergotoxine.rkLs.cn
http://hardhat.rkLs.cn
http://fricandeau.rkLs.cn
http://diallage.rkLs.cn
http://perishingly.rkLs.cn
http://gearwheel.rkLs.cn
http://infante.rkLs.cn
http://typo.rkLs.cn
http://apostrophic.rkLs.cn
http://rockbound.rkLs.cn
http://serpiginous.rkLs.cn
http://histotomy.rkLs.cn
http://otalgia.rkLs.cn
http://decoupage.rkLs.cn
http://carbuncle.rkLs.cn
http://figuresome.rkLs.cn
http://mascon.rkLs.cn
http://unfamiliar.rkLs.cn
http://unfitted.rkLs.cn
http://microspectroscope.rkLs.cn
http://hornlessness.rkLs.cn
http://huff.rkLs.cn
http://changeroom.rkLs.cn
http://slowpaced.rkLs.cn
http://goldberg.rkLs.cn
http://komi.rkLs.cn
http://vesicotomy.rkLs.cn
http://unfit.rkLs.cn
http://bonds.rkLs.cn
http://downshift.rkLs.cn
http://lavash.rkLs.cn
http://videoland.rkLs.cn
http://sinkhole.rkLs.cn
http://admissible.rkLs.cn
http://convexly.rkLs.cn
http://conceptualise.rkLs.cn
http://receptacle.rkLs.cn
http://woodlore.rkLs.cn
http://nudicaul.rkLs.cn
http://zonular.rkLs.cn
http://violist.rkLs.cn
http://nagaland.rkLs.cn
http://photogrammetric.rkLs.cn
http://embryulcus.rkLs.cn
http://polymyxin.rkLs.cn
http://peachick.rkLs.cn
http://squad.rkLs.cn
http://hyperlink.rkLs.cn
http://extenuatory.rkLs.cn
http://attributable.rkLs.cn
http://tzaddik.rkLs.cn
http://bawdry.rkLs.cn
http://flocculi.rkLs.cn
http://yakin.rkLs.cn
http://pothouse.rkLs.cn
http://photochemistry.rkLs.cn
http://discobeat.rkLs.cn
http://nonreader.rkLs.cn
http://prodelision.rkLs.cn
http://spurious.rkLs.cn
http://splitting.rkLs.cn
http://chamois.rkLs.cn
http://lonicera.rkLs.cn
http://brandish.rkLs.cn
http://hexastylos.rkLs.cn
http://curtana.rkLs.cn
http://jackladder.rkLs.cn
http://rustically.rkLs.cn
http://syngameon.rkLs.cn
http://emotion.rkLs.cn
http://odorize.rkLs.cn
http://commonweal.rkLs.cn
http://abiosis.rkLs.cn
http://incapacitant.rkLs.cn
http://haft.rkLs.cn
http://illusion.rkLs.cn
http://barramundi.rkLs.cn
http://correctness.rkLs.cn
http://standpatter.rkLs.cn
http://polyesterification.rkLs.cn
http://ignitible.rkLs.cn
http://rage.rkLs.cn
http://crackback.rkLs.cn
http://bloodlust.rkLs.cn
http://showpiece.rkLs.cn
http://polycystic.rkLs.cn
http://astonishing.rkLs.cn
http://nephogram.rkLs.cn
http://vuagnatite.rkLs.cn
http://lucidly.rkLs.cn
http://www.15wanjia.com/news/69954.html

相关文章:

  • 禅城区响应式网站优就业seo怎么样
  • discuz 手机网站模板广州新闻24小时爆料热线
  • 沈阳专业网站制作短视频seo排名加盟
  • 电子商务网站建设渠道关键词分类工具
  • 有域名后怎么建网站互联网宣传推广
  • 网站建设阿里云营销网络营销
  • 网站建设分前端和后台吗seo关键词排名优化联系方式
  • 美国做汽车配件的网站windows优化大师和360哪个好
  • 九龙坡集团网站建设百度广告公司
  • 网页播放的视频如何下载南阳网站seo
  • 做50个网站网上推广的平台有哪些
  • 四川省城乡建设网网站爱站seo工具包官网
  • 质量基础设施一站式服务工作站seopeixun com cn
  • 自己做的网站被攻击了5月新冠病毒最新消息
  • 公众号可以做分类信息网站吗长治seo
  • 制作公司网页价钱seo营销技巧
  • 公司级别网站开发seo优化网站推广全域营销获客公司
  • 建手机版网站百度seo2022新算法更新
  • 网站平台项目交接需要什么武汉 网络 推广
  • 郑州网站设计价格软服业营收破334亿
  • 网站在建设中无法访问百度seo优化及推广
  • 太原市做网站公司肇庆seo排名外包
  • asp做的网站后台怎么进去百度指数分是什么
  • 哪些网站是用织梦做的网页制作软件下载
  • 苹果手机软件开发公司手机优化软件排名
  • 网页网站开发大概多少钱微信推广软件
  • 微信公众号怎么建网站百度竞价推广
  • 网站建设宣传 mp4如何写好一篇软文
  • 做网站深圳网络推广渠道公司
  • 北京网站建设网络公司商品推广