{"id":20230987,"url":"https://github.com/bewaremypower/pulsar-reader-benchmark","last_synced_at":"2026-06-06T12:31:33.750Z","repository":{"id":208623782,"uuid":"722016329","full_name":"BewareMyPower/pulsar-reader-benchmark","owner":"BewareMyPower","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-22T13:37:38.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T13:45:26.865Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BewareMyPower.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-22T09:03:31.000Z","updated_at":"2023-11-22T09:04:16.000Z","dependencies_parsed_at":"2023-11-22T13:43:45.743Z","dependency_job_id":null,"html_url":"https://github.com/BewareMyPower/pulsar-reader-benchmark","commit_stats":null,"previous_names":["bewaremypower/pulsar-reader-benchmark"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BewareMyPower/pulsar-reader-benchmark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BewareMyPower%2Fpulsar-reader-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BewareMyPower%2Fpulsar-reader-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BewareMyPower%2Fpulsar-reader-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BewareMyPower%2Fpulsar-reader-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BewareMyPower","download_url":"https://codeload.github.com/BewareMyPower/pulsar-reader-benchmark/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BewareMyPower%2Fpulsar-reader-benchmark/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33983046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-06T02:00:07.033Z","response_time":107,"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":[],"created_at":"2024-11-14T07:44:44.880Z","updated_at":"2026-06-06T12:31:33.729Z","avatar_url":"https://github.com/BewareMyPower.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pulsar-reader-benchmark\n\nBenchmark for different ways of using a Pulsar reader to read messages to latest.\n\nRun a Pulsar standalone first. Then build and run tests:\n\n```bash\nmvn clean package -DskipTests\nmvn exec:java -Dexec.mainClass='io.bewaremypower.pulsar.Main'\n```\n\nBy default, it sends 10 messages to topic `my-topic` and consumes them.\n\nTo customize the number of messages, add the command line argument like:\n\n```bash\nmvn exec:java -Dexec.mainClass='io.bewaremypower.pulsar.Main' -Dexec.args=\"100 my-topic-2 10000\"\n```\n\nIt will use `my-topic-2` as the topic name, 100 as the number of messages, 10000 as the receiver queue size.\n\n## An example output\n\n```bash\n$ mvn exec:java -Dexec.mainClass='io.bewaremypower.pulsar.Main' -Dexec.args=\"1000000 my-topic-0 10000\" \n0 Listener: 18449ms\n0 ConsumerNoAck: 20336ms\n0 readNextAsync: 18602ms\n0 readNext: 18045ms\n1 Listener: 18423ms\n1 ConsumerNoAck: 18403ms\n1 readNextAsync: 18461ms\n1 readNext: 18049ms\n2 Listener: 19300ms\n2 ConsumerNoAck: 18556ms\n2 readNextAsync: 18523ms\n2 readNext: 18078ms\n3 Listener: 18414ms\n3 ConsumerNoAck: 18323ms\n3 readNextAsync: 18457ms\n3 readNext: 19473ms\n4 Listener: 18718ms\n4 ConsumerNoAck: 18450ms\n4 readNextAsync: 18810ms\n4 readNext: 17991ms\n---- SUMMARY ----\n# Listener\n18449, 18423, 19300, 18414, 18718\n# ConsumerNoAck\n20336, 18403, 18556, 18323, 18450\n# readNextAsync\n18602, 18461, 18523, 18457, 18810\n# readNext\n18045, 18049, 18078, 19473, 17991\n```\n\nConsumer with a non-durable cursor:\n- `Listener`: Use message listener to receive message, no acknowledgment, call `getLastMessageId` once.\n- `ConsumerNoAck`: Use `Consumer#receive` to receive message, no acknowledgment, call `getLastMessageId` once.\n\nReader in a `hasMessageAvailable` and `readNext` loop:\n- `readNext`: Call synchronous methods in another thread.\n- `readNextAsync`: Call asynchronous methods.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbewaremypower%2Fpulsar-reader-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbewaremypower%2Fpulsar-reader-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbewaremypower%2Fpulsar-reader-benchmark/lists"}