博客
关于我
pulsar mq 单体验证demo, docker启动pulsar mq验证生产者消费者命令
阅读量:803 次
发布时间:2023-03-04

本文共 398 字,大约阅读时间需要 1 分钟。

进入Pulsar容器并执行脚本操作

  • 进入Pulsar容器
    使用Docker命令进入容器环境:
  • docker exec -it xxx /bin/bash

    切换到bin目录:

    cd bin
    1. 消费主题
      使用Pulsar客户端工具消费指定主题:
    2. ./pulsar-client consume my-topic -s "first-subscription"
      1. 创建新的订阅
        重复上述步骤,创建新的订阅实例:
      2. ./pulsar-client consume my-topic -s "second-subscription"
        1. 发送消息
          在bin目录下,使用生产者命令发送消息:
        2. ./pulsar-client produce my-topic --messages "hello, world!"

          查看生产者和消费者的操作日志

          通过查看日志文件可以确认消息的发送和接收状态,确保Pulsar集群正常运行。

    转载地址:http://ewafk.baihongyu.com/

    你可能感兴趣的文章