• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

rop: RoP 将 RocketMQ 协议处理插件引入 Pulsar broker,这样 Pulsar 就能支持原生 Ro ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

rop

开源软件地址:

https://gitee.com/mirrors/rop

开源软件介绍:

RocketMQ on Pulsar(RoP)

RoP stands for RocketMQ on Pulsar. Rop broker supports RocketMQ-4.6.1 protocol, and is backed byPulsar.

RoP is implemented as aPulsar ProtocolHandlerwith protocol name "rocketmq". ProtocolHandler is build as a nar file, and is loaded when PulsarBroker starts.

Supported

RoP is implemented based on Pulsar features. Currently, the functions supported by RoP are asfollows:

  • Send and Receive Messages
  • SendAsync Messages
  • Queue Selector Producer
  • Round Robin Producer
  • Producer And Consumer(Push and Pull) With Namespace
  • Batch Messages
  • Order Messages
  • Send And Receive With Tag
  • Deliver Level Message
  • Retry Topic
  • DLQ Topic
  • Broadcast Consumer

Get started

In this guide, you will learn how to use the Pulsar broker to serve requests from RocketMQ client.

Download Pulsar

Download Pulsar 2.7.1binary package apache-pulsar-2.7.1-bin.tar.gz. and unzip it.

Note: Currently, RoP is only compatible with Apache Pulsar 2.7.0 and above.

Download and Build RoP Plugin

You can download rop nar file from the RoP sources.

To build from code, complete the following steps:

  1. Clone the project from GitHub to your local.
git clone https://github.com/streamnative/rop.gitcd rop
  1. Build the project.
mvn clean install -DskipTests

You can find the nar file in the following directory.

./target/pulsar-protocol-handler-rocketmq-${version}.nar

Configuration

NameDescriptionDefault
rocketmqTenantRocketMQ on Pulsar broker tenantrocketmq
rocketmqMetadataTenantThe tenant used for storing Rocketmq metadata topicsrocketmq
rocketmqNamespaceRocketmq on Pulsar Broker namespacedefault
rocketmqMetadataNamespaceThe namespace used for storing rocket metadata topics__rocketmq
rocketmqListenersRocketMQ service portrocketmq://127.0.0.1:9876
rocketmqMaxNoOfChannelsThe maximum number of channels which can exist concurrently on a connection64
rocketmqMaxFrameSizeThe maximum frame size on a connection4194304 (4MB)
rocketmqHeartBeatThe default heartbeat timeout of RoP connection60 (s)

Configure Pulsar broker to run RoP protocol handler as Plugin

As mentioned above, RoP module is loaded with Pulsar broker. You need to add configs in Pulsar'sconfig file, such as broker.conf or standalone.conf.

  1. Protocol handler configuration

You need to add messagingProtocols(the default value is null), protocolHandlerDirectory (the default value is "./protocols") and loadManagerClassName=org.apache.pulsar.broker.loadbalance.impl.ModularLoadManagerImpl, in Pulsar configuration files, such as broker.confor standalone.conf. For RoP, the value for messagingProtocols is rocketmq; the valuefor protocolHandlerDirectory is the directory of RoP nar file.

The following is an example.

messagingProtocols=rocketmqprotocolHandlerDirectory=./protocolsloadManagerClassName=org.apache.pulsar.broker.loadbalance.impl.ModularLoadManagerImpl
  1. Set RocketMQ service listeners

Set RocketMQ service listeners. Note that the hostname value in listeners is the same as Pulsarbroker's advertisedListeners.

The following is an example.

rocketmqListeners=rocketmq://127.0.0.1:9876advertisedListeners=INTERNAL:pulsar://127.0.0.1:6650,INTERNAL:pulsar+ssl://127.0.0.1:6651,INTERNAL_ROP:pulsar://127.0.0.1:9876,INTERNAL_ROP:pulsar+ssl://127.0.0.1:9896rocketmqListenerPortMap=9876:INTERNAL_ROP
  1. Set offset management as below since offset management for RoP depends on Pulsar "Broker Entry Metadata". It’s required for KoP 2.8.0 or higher version.
brokerEntryMetadataInterceptors=org.apache.pulsar.common.intercept.AppendIndexMetadataInterceptor
  1. Set brokerDeleteInactiveTopicsEnabled to false.
brokerDeleteInactiveTopicsEnabled=false

Note: advertisedListeners and advertisedAddress cannot be configured at the same time.

Run Pulsar broker

With the above configuration, you can start your Pulsar broker. For details, referto Pulsar Get started guides.

cd apache-pulsar-2.7.1bin/pulsar standalone -nss -nfw

Run RocketMQ Client to verify

In the RoP repo, we provide a sub model of examples, which contains a variety of scenarios used bythe rocketmq client. You can run these examples directly in the IDE. Or you can download theRocketMQ src code and run RocketMQ client of examples.

Log level configuration

In Pulsar log4j2.yaml config file,you can set RoP log level.

The following is an example.

    Logger:      - name: RocketMQProtocolHandler        level: debug        additivity: false        AppenderRef:          - ref: Console

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
koa-alibaba-component: 阿里云 Koa 组件发布时间:2022-03-25
下一篇:
Rick/kubesphere-projector发布时间:2022-03-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap