{"id":22096921,"url":"https://github.com/streamnative/aop","last_synced_at":"2026-05-15T05:16:35.151Z","repository":{"id":37364168,"uuid":"245953523","full_name":"streamnative/aop","owner":"streamnative","description":"AMQP on Pulsar protocol handler","archived":false,"fork":false,"pushed_at":"2026-04-19T00:24:11.000Z","size":2032,"stargazers_count":124,"open_issues_count":110,"forks_count":43,"subscribers_count":21,"default_branch":"master","last_synced_at":"2026-04-19T02:44:23.930Z","etag":null,"topics":["amqp","amqp0-9-1","apache-pulsar","message-queue","messaging","pubsub","pulsar"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/streamnative.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-03-09T05:44:53.000Z","updated_at":"2026-04-07T14:04:04.000Z","dependencies_parsed_at":"2026-04-02T12:06:50.611Z","dependency_job_id":null,"html_url":"https://github.com/streamnative/aop","commit_stats":null,"previous_names":[],"tags_count":594,"template":false,"template_full_name":null,"purl":"pkg:github/streamnative/aop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamnative%2Faop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamnative%2Faop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamnative%2Faop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamnative%2Faop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/streamnative","download_url":"https://codeload.github.com/streamnative/aop/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamnative%2Faop/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32368537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"online","status_checked_at":"2026-04-28T02:00:07.250Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amqp","amqp0-9-1","apache-pulsar","message-queue","messaging","pubsub","pulsar"],"created_at":"2024-12-01T04:13:32.336Z","updated_at":"2026-04-28T06:04:56.832Z","avatar_url":"https://github.com/streamnative.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"\u003c!--\n\n    Licensed to the Apache Software Foundation (ASF) under one\n    or more contributor license agreements.  See the NOTICE file\n    distributed with this work for additional information\n    regarding copyright ownership.  The ASF licenses this file\n    to you under the Apache License, Version 2.0 (the\n    \"License\"); you may not use this file except in compliance\n    with the License.  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing,\n    software distributed under the License is distributed on an\n    \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n    KIND, either express or implied.  See the License for the\n    specific language governing permissions and limitations\n    under the License.\n\n--\u003e\n\n[![LICENSE](https://img.shields.io/hexpm/l/pulsar.svg)](https://github.com/streamnative/aop/blob/master/LICENSE)\n\n\u003e **Notes**\n\u003e \n\u003e The AoP plugin supports only the 0-9-1 protocol with basic produce and consume functionalities, and does not include advanced features such as transactions. It is available as an open-source plugin and is only offered as a private preview feature in the Private Cloud distribution as an experimental feature. It is not available on StreamNative Cloud. Please use it with caution.\n\n# AMQP on Pulsar (AoP)\n\nAoP stands for AMQP on Pulsar. AoP broker supports AMQP0-9-1 protocol, and is backed by Pulsar.\n\nAoP is implemented as a Pulsar [ProtocolHandler](https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/protocol/ProtocolHandler.java) with protocol name \"amqp\". ProtocolHandler is built as a `nar` file, and is loaded when Pulsar Broker starts.\n\n## Limitations\nAoP is implemented based on Pulsar features. However, the methods of using Pulsar and using AMQP are different. The following are some limitations of AoP.\n\n- Currently, the AoP protocol handler supports AMQP0-9-1 protocol and only supports durable exchange and durable queue.\n- A Vhost is backed by a namespace which can only have one bundle. You need to create a namespace in advance for the Vhost.\n- AoP is supported on Pulsar 2.6.1 or later releases.\n\n## Get started\n\nIn this guide, you will learn how to use the Pulsar broker to serve requests from AMQP client.\n\n### Download Pulsar \n\nDownload [Pulsar 2.6.1](https://github.com/streamnative/pulsar/releases/download/v2.6.1/apache-pulsar-2.6.1-bin.tar.gz) binary package `apache-pulsar-2.6.1-bin.tar.gz`. and unzip it.\n\n### Download and Build AoP Plugin\nYou can download aop nar file from the [AoP releases](https://github.com/streamnative/aop/releases).\n\nTo build from code, complete the following steps:\n1. Clone the project from GitHub to your local.\n\n```bash\ngit clone https://github.com/streamnative/aop.git\ncd aop\n```\n\n2. Build the project.\n```bash\nmvn clean install -DskipTests\n```\nYou can find the nar file in the following directory.\n```bash\n./amqp-impl/target/pulsar-protocol-handler-amqp-${version}.nar\n```\n\n### Configuration\n\n|Name|Description|Default|\n|---|---|---|\namqpTenant|AMQP on Pulsar broker tenant|public\namqpListeners|AMQP service port|amqp://127.0.0.1:5672\namqpMaxNoOfChannels|The maximum number of channels which can exist concurrently on a connection|64\namqpMaxFrameSize|The maximum frame size on a connection|4194304 (4MB)\namqpHeartBeat|The default heartbeat timeout of AoP connection|60 (s)\namqpProxyPort|The AMQP proxy service port|5682\namqpProxyEnable|Whether to start proxy service|false\n\n### Configure Pulsar broker to run AoP protocol handler as Plugin\n\nAs mentioned above, AoP module is loaded with Pulsar broker. You need to add configs in Pulsar's config file, such as `broker.conf` or `standalone.conf`.\n\n1. Protocol handler configuration\n\nYou need to add `messagingProtocols`(the default value is `null`) and  `protocolHandlerDirectory` (the default value is \"./protocols\"), in Pulsar configuration files, such as `broker.conf` or `standalone.conf`. For AoP, the value for `messagingProtocols` is `amqp`; the value for `protocolHandlerDirectory` is the directory of AoP nar file.\n\nThe following is an example.\n```access transformers\nmessagingProtocols=amqp\nprotocolHandlerDirectory=./protocols\n```\n\n2. Set AMQP service listeners\n\nSet AMQP service `listeners`. Note that the hostname value in listeners is the same as Pulsar broker's `advertisedAddress`.\n\nThe following is an example.\n```\namqpListeners=amqp://127.0.0.1:5672\nadvertisedAddress=127.0.0.1\n```\n\n### Run Pulsar broker\n\nWith the above configuration, you can start your Pulsar broker. For details, refer to [Pulsar Get started guides](http://pulsar.apache.org/docs/en/standalone/).\n\n```access transformers\ncd apache-pulsar-2.6.1\nbin/pulsar standalone\n```\n\n### Run AMQP Client to verify\n\n### Log level configuration\n\nIn Pulsar [log4j2.yaml config file](https://github.com/apache/pulsar/blob/master/conf/log4j2.yaml), you can set AoP log level.\n\nThe following is an example.\n```\n    Logger:\n      - name: io.streamnative.pulsar.handlers.amqp\n        level: debug\n        additivity: false\n        AppenderRef:\n          - ref: Console\n``` \n\n### AoP configuration\n\nThere is also other configs that can be changed and placed into Pulsar broker config file.\n\u003c!what's the \"other configs\"?\u003e\n\n## Contribute\n### Prerequisite ###\n\nIf you want to make contributions to AMQP on Pulsar, follow the following steps.\n\n1. Install system dependency.\n\nFrom version 2.11.0, the AoP need JDK 17.\n\nDependency | Installation guide \n|---|---\nJava 17 | https://openjdk.java.net/install/\nMaven | https://maven.apache.org/\n\n2. Clone code to your machine. \n    \n    ```bash\n    git@github.com:streamnative/aop.git\n    ```\n\n3. Build the project.\n    ```bash\n    mvn install -DskipTests\n    ```\n\n### Contribution workflow\n\n#### Step 1: Fork\n\n1. Visit https://github.com/streamnative/aop\n2. Click `Fork` button (top right) to establish a cloud-based fork.\n\n#### Step 2: Clone fork to local machine\n\nCreate your clone.\n\n```sh\n$ cd $working_dir\n$ git clone https://github.com/$user/aop\n```\n\nSet your clone to track upstream repository.\n\n```sh\n$ cd $working_dir/aop\n$ git remote add upstream https://github.com/streamnative/aop.git\n```\n\nUse the `git remote -v` command, you find the output looks as follows:\n\n```\norigin    https://github.com/$user/aop.git (fetch)\norigin    https://github.com/$user/aop.git (push)\nupstream  https://github.com/streamnative/aop (fetch)\nupstream  https://github.com/streamnative/aop (push)\n```\n\n#### Step 3: Keep your branch in sync\n\nGet your local master up to date.\n\n```sh\n$ cd $working_dir/aop\n$ git checkout master\n$ git fetch upstream\n$ git rebase upstream/master\n$ git push origin master \n```\n\n#### Step 4: Create your branch\n\nBranch from master.\n\n```sh\n$ git checkout -b myfeature\n```\n\n#### Step 5: Edit the code\n\nYou can now edit the code on the `myfeature` branch.\n\n\n#### Step 6: Commit\n\nCommit your changes.\n\n```sh\n$ git add \u003cfilename\u003e\n$ git commit -m \"$add a comment\"\n```\n\nLikely you'll go back and edit-build-test in a few cycles. \n\nThe following commands might be helpful for you.\n\n```sh\n$ git add \u003cfilename\u003e (used to add one file)\ngit add -A (add all changes, including new/delete/modified files)\ngit add -a -m \"$add a comment\" (add and commit modified and deleted files)\ngit add -u (add modified and deleted files, not include new files)\ngit add . (add new and modified files, not including deleted files)\n```\n\n#### Step 7: Push\n\nWhen your commit is ready for review (or just to establish an offsite backup of your work), push your branch to your fork on `github.com`:\n\n```sh\n$ git push origin myfeature\n```\n\n#### Step 8: Create a pull request\n\n1. Visit your fork at https://github.com/$user/aop (replace `$user` obviously).\n2. Click the `Compare \u0026 pull request` button next to your `myfeature` branch.\n\n#### Step 9: Get a code review\n\nOnce you open your pull request, at least two reviewers will participate in reviewing. Those reviewers will conduct a thorough code review, looking for correctness, bugs, opportunities for improvement, documentation and comments, and style.\n\nCommit changes made in response to review comments to the same branch on your fork.\n\nVery small PRs are easy to review. Very large PRs are very difficult to review.\n\n### How to use Pulsar standalone\n\n1. Clone this project from GitHub to your local.\n\n    ```bash\n    git clone https://github.com/streamnative/aop.git\n    cd aop\n    ```\n\n2. Build the project.\n\n    ```bash\n    mvn clean install -DskipTests\n    ```\n\n3. Copy the nar package to Pulsar protocols directory.\n\n    ```bash\n    cp ./amqp-impl/target/pulsar-protocol-handler-amqp-${version}.nar $PULSAR_HOME/protocols/pulsar-protocol-handler-amqp-${version}.nar\n    ```\n\n4. Modify Pulsar standalone configuration\n\n    ```\n    # conf file: $PULSAR_HOME/conf/standalone.conf\n    \n    # add amqp configs\n    messagingProtocols=amqp\n    protocolHandlerDirectory=./protocols\n    \n    amqpListeners=amqp://127.0.0.1:5672\n    advertisedAddress=127.0.0.1\n    ```\n\n5. Start Pulsar in standalone mode.\n\n    ```\n    $PULSAR_HOME/bin/pulsar standalone\n    ```\n\n6. Add namespace for vhost.\n\n    ```\n    # for example, the vhost name is `vhost1`\n    bin/pulsar-admin namespaces create -b 1 public/vhost1\n    # set retention for the namespace\n    bin/pulsar-admin namespaces set-retention -s 100M -t 2d public/vhost1\n    ```\n\n7. Use RabbitMQ client test\n\n    ```\n    # add RabbitMQ client dependency in your project\n    \u003cdependency\u003e\n      \u003cgroupId\u003ecom.rabbitmq\u003c/groupId\u003e\n      \u003cartifactId\u003eamqp-client\u003c/artifactId\u003e\n      \u003cversion\u003e5.8.0\u003c/version\u003e\n    \u003c/dependency\u003e\n    ```\n\n    ```\n    // Java Code\n    \n    // create connection\n    ConnectionFactory connectionFactory = new ConnectionFactory();\n    connectionFactory.setVirtualHost(\"vhost1\");\n    connectionFactory.setHost(\"127.0.0.1\");\n    connectionFactory.setPort(5672);\n    Connection connection = connectionFactory.newConnection();\n    Channel channel = connection.createChannel();\n    \n    String exchange = \"ex\";\n    String queue = \"qu\";\n    \n    // exchage declare\n    channel.exchangeDeclare(exchange, BuiltinExchangeType.FANOUT, true, false, false, null);\n    \n    // queue declare and bind\n    channel.queueDeclare(queue, true, false, false, null);\n    channel.queueBind(queue, exchange, \"\");\n    \n    // publish some messages\n    for (int i = 0; i \u003c 100; i++) {\n        channel.basicPublish(exchange, \"\", null, (\"hello - \" + i).getBytes());\n    }\n    \n    // consume messages\n    CountDownLatch countDownLatch = new CountDownLatch(100);\n    channel.basicConsume(queue, true, new DefaultConsumer(channel) {\n        @Override\n        public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException {\n            System.out.println(\"receive msg: \" + new String(body));\n            countDownLatch.countDown();\n        }\n    });\n    countDownLatch.await();\n    \n    // release resource\n    channel.close();\n    connection.close();\n    ```\n\n### How to use Proxy\n\nTo use proxy, complete the following steps. If you do not know some detailed steps, refer to [Deploy a cluster on bare metal](http://pulsar.apache.org/docs/en/deploy-bare-metal/).\n\n1. Prepare ZooKeeper cluster.\n\n2. Initialize cluster metadata.\n\n3. Prepare bookkeeper cluster.\n\n4. Copy the `pulsar-protocol-handler-amqp-${version}.nar` to the `$PULSAR_HOME/protocols` directory.\n\n5. Start broker.\n\n    broker config\n\n    ```yaml\n    messagingProtocols=amqp\n    protocolHandlerDirectory=./protocols\n    brokerServicePort=6651\n    amqpListeners=amqp://127.0.0.1:5672\n    \n    amqpProxyEnable=true\n    amqpProxyPort=5682\n    ```\n\n6. Reset the number of the namespace public/default to `1`.\n\n    ```shell script\n    $PULSAR_HOME/bin/pulsar-admin namespaces delete public/default\n    $PULSAR_HOME/bin/pulsar-admin namespaces create -b 1 public/default\n    $PULSAR_HOME/bin/pulsar-admin namespaces set-retention -s 100M -t 3d public/default\n    ``` \n\n7. Prepare exchange and queue for test.\n\n    ```\n    ConnectionFactory connectionFactory = new ConnectionFactory();\n    connectionFactory.setVirtualHost(\"/\");\n    connectionFactory.setHost(\"127.0.0.1\");\n    connectionFactory.setPort(5682);\n    Connection connection = connectionFactory.newConnection();\n    Channel channel = connection.createChannel();\n    String ex = \"ex-perf\";\n    String qu = \"qu-perf\";\n    channel.exchangeDeclare(ex, BuiltinExchangeType.DIRECT, true);\n    channel.queueDeclare(qu, true, false, false, null);\n    channel.queueBind(qu, ex, qu);\n    channel.close();\n    connection.close();\n    ```\n\n7. Download RabbitMQ perf tool and test. \n\n    (https://bintray.com/rabbitmq/java-tools/download_file?file_path=perf-test%2F2.11.0%2Frabbitmq-perf-test-2.11.0-bin.tar.gz)\n\n    ```shell script\n    $RABBITMQ_PERF_TOOL_HOME/bin/runjava com.rabbitmq.perf.PerfTest -e ex-perf -u qu-perf -r 1000 -h amqp://127.0.0.1:5682 -p\n    ```\n\n## Project Maintainer\n-   [@codelipenghui](https://github.com/codelipenghui)\n-   [@gaoran10](https://github.com/gaoran10)\n-   [@wangshaojie4039](https://github.com/wangshaojie4039)\n-   [@zhanghaou](https://github.com/wangshaojie4039/zhanghaou)\n\n## Licence \n\nThis library is licensed under the terms of the [Apache License 2.0](LICENSE) and may include packages written by third parties which carry their own copyright notices and license terms.\n\n## About StreamNative\n\nFounded in 2019 by the original creators of Apache Pulsar, [StreamNative](https://streamnative.io) is one of the leading contributors to the open-source Apache Pulsar project. We have helped engineering teams worldwide make the move to Pulsar with [StreamNative Cloud](https://streamnative.io/product), a fully managed service to help teams accelerate time-to-production.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreamnative%2Faop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstreamnative%2Faop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreamnative%2Faop/lists"}