{"id":18996947,"url":"https://github.com/rburgst/spring-boot-jms-perf-sample","last_synced_at":"2025-04-22T13:50:14.707Z","repository":{"id":145058070,"uuid":"52179741","full_name":"rburgst/spring-boot-jms-perf-sample","owner":"rburgst","description":"A simple spring boot JMS sending / receiving sample","archived":false,"fork":false,"pushed_at":"2016-02-20T23:05:09.000Z","size":105,"stargazers_count":3,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T15:42:02.911Z","etag":null,"topics":[],"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/rburgst.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-20T22:55:53.000Z","updated_at":"2018-05-08T20:47:25.000Z","dependencies_parsed_at":"2023-05-05T17:38:24.021Z","dependency_job_id":null,"html_url":"https://github.com/rburgst/spring-boot-jms-perf-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rburgst%2Fspring-boot-jms-perf-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rburgst%2Fspring-boot-jms-perf-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rburgst%2Fspring-boot-jms-perf-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rburgst%2Fspring-boot-jms-perf-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rburgst","download_url":"https://codeload.github.com/rburgst/spring-boot-jms-perf-sample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249273824,"owners_count":21241978,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-08T17:37:42.196Z","updated_at":"2025-04-16T20:31:25.654Z","avatar_url":"https://github.com/rburgst.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Boot JMS Sample\n\nA very simple JMS test application which can also be used for measuring performance of JMS brokers.\n\nWorks with \n\n* ActiveMQ\n* ArtemisMQ\n* ApolloMQ\n* HornetQ\n\nThe aim of this sample is to test performance, memory behaviour of a single producer sending into a single queue.\nThe queue is monitored by 2 consumers where each consumer filters for `CLIENT_ID=X` (where `X` = `1` or `2`).\n\nThe producer will send out packs of 10 messages for each consumer. I.e. \n\n\n* CLIENT_ID=1\n* CLIENT_ID=1\n* CLIENT_ID=1\n* CLIENT_ID=1\n* CLIENT_ID=1\n* CLIENT_ID=1\n* CLIENT_ID=1\n* CLIENT_ID=1\n* CLIENT_ID=1\n* CLIENT_ID=1\n* CLIENT_ID=2\n* CLIENT_ID=2\n* CLIENT_ID=2\n* CLIENT_ID=2\n* CLIENT_ID=2\n* CLIENT_ID=2\n* CLIENT_ID=2\n* CLIENT_ID=2\n* CLIENT_ID=2\n* CLIENT_ID=2\n\n\nThe result should look like this\n\n\n                                              .---- consumer 1 (CLIENT_ID=1)\n                                             /\n    producer   11111122222211111.. -\u003e  queue1  \n                                             \\\n                                              `---- consumer 2 (CLIENT_ID=2)\n                                              \n## Running the application\n\n1. start the 2 receivers: `q1rec1.sh, q1rec2.sh`\n2. wait until both of them are running\n3. start the sender: `q1sender.sh`\n\nFor testing the performance with multiple queues and producers, you can repeat the same process for \n`q1rec1.sh, q1rec2.sh, q1sender.sh`.\n\n\n### Configuration options\n\n| Configuration | Description | Default value |\n| ------------- | ------------|-------------- |\n| `jms.queueName`| The name of the JMS queue to use | `queue1` |\n| `jms.selector` | the JMS selector for which the receiver is listening, should be either  `CLIENT_ID=1` or `CLIENT_ID=2` | `CLIENT_ID=1`|\n| `sleepTime`    | The delay in [ms] between each message | `0` (no wait) |\n\n## Using different MQ\n\nThe main configuration for the samples is in `application.properties`.\n\n\n\n### ActiveMQ\n\nThe `build.gradle` file needs to be changed in the following way:\n\n* Remove (comment out) the `apache-artemis` dependency (if enabled)\n  \n        // compile(\"org.springframework.boot:spring-boot-starter-artemis\")\n\n* Enable \n        \n        compile(\"org.apache.activemq:activemq-broker\")\n\n\nShould work with default settings, you might need to change the username/password configured\n\n    spring.activemq.broker-url=tcp://127.0.0.1:61616\n    spring.activemq.user=admin\n    spring.activemq.password=admin\n\n### ApolloMQ\n\n* Use the same settings as for ActiveMQ in `build.gradle`\n* Reconfigure the `application.properties`:\n\n    spring.activemq.broker-url=tcp://127.0.0.1:61613\n    spring.activemq.user=admin\n    spring.activemq.password=password\n    \n### ArtemisMQ\n\n* Remove (comment out) the `apache-activemq` dependency (if enabled)\n  \n        // compile(\"org.apache.activemq:activemq-broker\")\n\n* Enable \n        \n        compile(\"org.springframework.boot:spring-boot-starter-artemis\")\n\n* Use the following settings in `application.properties`\n\n        spring.artemis.mode=native\n        spring.artemis.host=localhost\n        spring.artemis.port=61616\n        \n        spring.artemis.embedded.enabled=false\n\n### HornetQ\n\nHornetQ is the original predecessor from Apache Artemis (it was handed over to the Apache Foundation), therefore\nit is nearly exatly the same as `Apache Artemis`.\n\n* comment out all dependencies for Apache ActiveMQ and Artemis\n* add the following dependency:\n\n        compile(\"org.springframework.boot:spring-boot-starter-hornetq\")\n\n* Add the following configuration to `application.properties`:\n\n        spring.hornetq.mode=native\n        spring.hornetq.host=localhost\n        spring.hornetq.port=9876\n        \n        \n## Specific Scenarios\n\n#### Only consume half of the messages\n\nIt is quite instructive to test the case where there is 1 producer and 1 consumer but the consumer only collects\nhalf of the messages. \nDepending on the broker configuration this will typically lead to producer back-pressure after the sending window \nis full, eventually the single consumer will no longer receive messages\n\n## Credits\n\nThis sample is based on [https://spring.io/guides/gs/messaging-jms/](https://spring.io/guides/gs/messaging-jms/) ([https://github.com/spring-guides/gs-messaging-jms.git](https://github.com/spring-guides/gs-messaging-jms.git))\n\n## References\n\n* [http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-messaging.html](http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-messaging.html)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frburgst%2Fspring-boot-jms-perf-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frburgst%2Fspring-boot-jms-perf-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frburgst%2Fspring-boot-jms-perf-sample/lists"}