关闭
Hit
enter
to search or
ESC
to close
May I Suggest ?
#leanote #leanote blog #code #hello world
柯仓无居所
Home
Archives
Tags
Search
MQ发送消息脚本
? rocketmq ?
? 发送消息 ?
855
0
0
swimming
? rocketmq ?
? 发送消息 ?
# MQ发送消息脚本 > 本脚本依赖RocketMq-conosle应用,脚本如下: ```python #!/usr/bin/env python3 #coding:utf-8 import requests import uuid import json post_url = 'http://x.x.x.x:8080/topic/sendTopicMessage.do' headers = { "Content-Type": "application/json;charset=UTF-8", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:76.0) Gecko/20100101 Firefox/76.0", } for i in range(1000): key = str(uuid.uuid4()).split('-')[-1] data = json.dumps({ "topic": "meet-1", "key": key, "tag": "test-python", "messageBody": str(uuid.uuid4()) }) res = requests.post(url=post_url,data=data,headers=headers) print("|--->{}".format(res.text)) ```
觉得不错,点个赞?
提交评论
Sign in
to leave a comment.
No Leanote account ?
Sign up now
.
0
条评论
More...
文章目录
No Leanote account ? Sign up now.