{"id":42847106,"url":"https://github.com/mvallim/amazon-sns-java-messaging-lib","last_synced_at":"2026-01-30T11:58:48.742Z","repository":{"id":65507761,"uuid":"567136779","full_name":"mvallim/amazon-sns-java-messaging-lib","owner":"mvallim","description":"The Amazon SNS Java Messaging Library holds the compatible classes, that are used for communicating with Amazon Simple Notification Service. This project builds on top of the AWS SDK for Java to use Amazon SNS provider for the messaging applications without running any additional software.","archived":false,"fork":false,"pushed_at":"2025-10-27T13:13:39.000Z","size":589,"stargazers_count":6,"open_issues_count":9,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-14T04:51:15.949Z","etag":null,"topics":["amazon","amazon-sns","amazon-web-services","aws","aws-sns","aws-sns-topic","batch","java","kotlin","producer","robust","sns","topic"],"latest_commit_sha":null,"homepage":"https://mvallim.github.io/amazon-sns-java-messaging-lib/","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/mvallim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-11-17T06:28:37.000Z","updated_at":"2025-12-31T05:29:38.000Z","dependencies_parsed_at":"2024-03-04T22:25:08.753Z","dependency_job_id":"f6fc7d79-f819-4241-8e75-9c9d86bdda32","html_url":"https://github.com/mvallim/amazon-sns-java-messaging-lib","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/mvallim/amazon-sns-java-messaging-lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvallim%2Famazon-sns-java-messaging-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvallim%2Famazon-sns-java-messaging-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvallim%2Famazon-sns-java-messaging-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvallim%2Famazon-sns-java-messaging-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mvallim","download_url":"https://codeload.github.com/mvallim/amazon-sns-java-messaging-lib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvallim%2Famazon-sns-java-messaging-lib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28912184,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T11:55:24.701Z","status":"ssl_error","status_checked_at":"2026-01-30T11:54:13.194Z","response_time":66,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["amazon","amazon-sns","amazon-web-services","aws","aws-sns","aws-sns-topic","batch","java","kotlin","producer","robust","sns","topic"],"created_at":"2026-01-30T11:58:48.402Z","updated_at":"2026-01-30T11:58:48.734Z","avatar_url":"https://github.com/mvallim.png","language":"Java","readme":"# Amazon SNS Java Messaging Lib\n\n[![Build, Publish Snapshot and Pull Request](https://github.com/mvallim/amazon-sns-java-messaging-lib/actions/workflows/cd-snapshot.yml/badge.svg)](https://github.com/mvallim/amazon-sns-java-messaging-lib/actions/workflows/cd-snapshot.yml)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=amazon-sns-java-messaging-lib\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=amazon-sns-java-messaging-lib)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=amazon-sns-java-messaging-lib\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=amazon-sns-java-messaging-lib)\n[![Maven Central](https://img.shields.io/maven-central/v/com.github.mvallim/amazon-sns-java-messaging-lib)](https://img.shields.io/maven-central/v/com.github.mvallim/amazon-sns-java-messaging-lib)\n[![Hex.pm](https://img.shields.io/hexpm/l/plug.svg)](http://www.apache.org/licenses/LICENSE-2.0)\n\nThe Amazon SNS Java Messaging Library holds the compatible classes, that are used for communicating with Amazon Simple Notification Service. This project builds on top of the AWS SDK for Java to use Amazon SNS provider for the messaging applications without running any additional software.\n\n\u003e The batch size should be chosen based on the size of individual messages and available network bandwidth as well as the observed latency and throughput improvements based on the real life load. These are configured to some sensible defaults assuming smaller message sizes and the optimal batch size for server side processing.\n\n# Request Batch\n\nCombine multiple requests to optimally utilise the network.\n\nArticle [Martin Fowler](https://martinfowler.com) [Request Batch](https://martinfowler.com/articles/patterns-of-distributed-systems/request-batch.html)\n\n_**Compatible JDK 8, 11, 17 and 21**_\n\n_**Compatible AWS JDK v1 \u003e= 1.12**_\n\n_**Compatible AWS JDK v2 \u003e= 2.18**_\n\nThis library supports **`Kotlin`** aswell\n\n# 1. Quick Start\n\n## 1.1 Prerequisite\n\nIn order to use Amazon SNS Java Messaging Lib within a Maven project, simply add the following dependency to your pom.xml. There are no other dependencies for Amazon SNS Java Messaging Lib, which means other unwanted libraries will not overwhelm your project.\n\nYou can pull it from the central Maven repositories:\n\n### For AWS SDK v1\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.mvallim\u003c/groupId\u003e\n    \u003cartifactId\u003eamazon-sns-java-messaging-lib-v1\u003c/artifactId\u003e\n    \u003cversion\u003e1.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### For AWS SDK v2\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.mvallim\u003c/groupId\u003e\n    \u003cartifactId\u003eamazon-sns-java-messaging-lib-v2\u003c/artifactId\u003e\n    \u003cversion\u003e1.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nIf you want to try a snapshot version, add the following repository:\n\n```xml\n\u003crepository\u003e\n    \u003cid\u003esonatype-snapshots\u003c/id\u003e\n    \u003cname\u003eSonatype Snapshots\u003c/name\u003e\n    \u003curl\u003ehttps://central.sonatype.com/repository/maven-snapshots\u003c/url\u003e\n    \u003csnapshots\u003e\n        \u003cenabled\u003etrue\u003c/enabled\u003e\n    \u003c/snapshots\u003e\n\u003c/repository\u003e\n```\n\n#### Gradle\n\n### For AWS SDK v1\n\n```groovy\nimplementation 'com.github.mvallim:amazon-sns-java-messaging-lib-v1:1.1.0'\n```\n\n### For AWS SDK v2\n\n```groovy\nimplementation 'com.github.mvallim:amazon-sns-java-messaging-lib-v2:1.1.0'\n```\n\nIf you want to try a snapshot version, add the following repository:\n\n```groovy\nrepositories {\n    maven {\n        url \"https://central.sonatype.com/repository/maven-snapshots\"\n    }\n}\n```\n\n## 1.2 Usage\n\n### Properties `TopicProperty`\n\n| Property              | Type        | Description                                                                    |\n|-----------------------|-------------|--------------------------------------------------------------------------------|\n| **`fifo`**            | **boolean** | refers if SNS is fifo or not.                                                  |\n| **`maximumPoolSize`** | **int**     | refers maximum threads for producer.                                           |\n| **`topicArn`**        | **string**  | refers topic arn name.                                                         |\n| **`linger`**          | **int**     | refers to the time to wait before sending messages out to SNS.                 |\n| **`maxBatchSize`**    | **int**     | refers to the maximum amount of data to be collected before sending the batch. |\n\n**NOTICE**: the buffer of message store in memory is calculate using **`maximumPoolSize`** * **`maxBatchSize`** huge values demand huge memory.\n\n#### Determining the type of `BlockingQueue` with its maximum capacity\n\n```java\nfinal TopicProperty topicProperty = TopicProperty.builder()\n  .fifo(false)\n  .linger(100)\n  .maxBatchSize(10)\n  .maximumPoolSize(20)\n  .topicArn(\"arn:aws:sns:us-east-2:000000000000:topic\")\n  .build();\n  \nfinal AmazonSnsTemplate\u003cMyMessage\u003e snsTemplate = new AmazonSnsTemplate\u003c\u003e(\n\tamazonSNS, topicProperty, new LinkedBlockingQueue\u003c\u003e(100));\n```\n\n#### Using an `ObjectMapper` other than the default\n\n```java\nfinal TopicProperty topicProperty = TopicProperty.builder()\n  .fifo(false)\n  .linger(100)\n  .maxBatchSize(10)\n  .maximumPoolSize(20)\n  .topicArn(\"arn:aws:sns:us-east-2:000000000000:topic\")\n  .build();\n  \nfinal AmazonSnsTemplate\u003cMyMessage\u003e snsTemplate = new AmazonSnsTemplate\u003c\u003e(\n\tamazonSNS, topicProperty, new ObjectMapper\u003c\u003e());\n```\n\n#### Using an `ObjectMapper` and a `BlockingQueue` other than the default\n\n```java\nfinal TopicProperty topicProperty = TopicProperty.builder()\n  .fifo(false)\n  .linger(100)\n  .maxBatchSize(10)\n  .maximumPoolSize(20)\n  .topicArn(\"arn:aws:sns:us-east-2:000000000000:topic\")\n  .build();\n  \nfinal AmazonSnsTemplate\u003cMyMessage\u003e snsTemplate = new AmazonSnsTemplate\u003c\u003e(\n\tamazonSNS, topicProperty, new LinkedBlockingQueue\u003c\u003e(100), new ObjectMapper\u003c\u003e());\n```\n\n### Standard SNS\n\n```java\nfinal TopicProperty topicProperty = TopicProperty.builder()\n  .fifo(false)\n  .linger(100)\n  .maxBatchSize(10)\n  .maximumPoolSize(20)\n  .topicArn(\"arn:aws:sns:us-east-2:000000000000:topic\")\n  .build();\n\nfinal AmazonSnsTemplate\u003cMyMessage\u003e snsTemplate = new AmazonSnsTemplate\u003c\u003e(amazonSNS, topicProperty);\n\nfinal RequestEntry\u003cMyMessage\u003e requestEntry = RequestEntry.builder()\n  .withValue(new MyMessage())\n  .withMessageHeaders(Map.of())\n  .build();\n\nsnsTemplate.send(requestEntry);\n```\n\n### FIFO SNS\n\n```java\nfinal TopicProperty topicProperty = TopicProperty.builder()\n  .fifo(true)\n  .linger(100)\n  .maxBatchSize(10)\n  .maximumPoolSize(20)\n  .topicArn(\"arn:aws:sns:us-east-2:000000000000:topic\")\n  .build();\n\nfinal AmazonSnsTemplate\u003cMyMessage\u003e snsTemplate = new AmazonSnsTemplate\u003c\u003e(amazonSNS, topicProperty);\n\nfinal RequestEntry\u003cMyMessage\u003e requestEntry = RequestEntry.builder()\n  .withValue(new MyMessage())\n  .withMessageHeaders(Map.of())\n  .withGroupId(UUID.randomUUID().toString())\n  .withDeduplicationId(UUID.randomUUID().toString())\n  .build();\n\nsnsTemplate.send(requestEntry);\n```\n\n### Send With Callback\n\n```java\nfinal TopicProperty topicProperty = TopicProperty.builder()\n  .fifo(true)\n  .linger(100)\n  .maxBatchSize(10)\n  .maximumPoolSize(20)\n  .topicArn(\"arn:aws:sns:us-east-2:000000000000:topic\")\n  .build();\n\nfinal AmazonSnsTemplate\u003cMyMessage\u003e snsTemplate = new AmazonSnsTemplate\u003c\u003e(amazonSNS, topicProperty);\n\nfinal RequestEntry\u003cMyMessage\u003e requestEntry = RequestEntry.builder()\n  .withValue(new MyMessage())\n  .withMessageHeaders(Map.of())\n  .withGroupId(UUID.randomUUID().toString())\n  .withDeduplicationId(UUID.randomUUID().toString())\n  .build();\n\nsnsTemplate.send(requestEntry).addCallback(result -\u003e {\n  successCallback -\u003e LOGGER.info(\"{}\", successCallback), \n  failureCallback -\u003e LOGGER.error(\"{}\", failureCallback)\n});\n\nsnsTemplate.send(requestEntry).addCallback(result -\u003e {\n  successCallback -\u003e LOGGER.info(\"{}\", successCallback)\n});\n```\n\n### Send And Wait\n\n```java\nfinal TopicProperty topicProperty = TopicProperty.builder()\n  .fifo(true)\n  .linger(100)\n  .maxBatchSize(10)\n  .maximumPoolSize(20)\n  .topicArn(\"arn:aws:sns:us-east-2:000000000000:topic\")\n  .build();\n\nfinal AmazonSnsTemplate\u003cMyMessage\u003e snsTemplate = new AmazonSnsTemplate\u003c\u003e(amazonSNS, topicProperty);\n\nfinal RequestEntry\u003cMyMessage\u003e requestEntry = RequestEntry.builder()\n  .withValue(new MyMessage())\n  .withMessageHeaders(Map.of())\n  .withGroupId(UUID.randomUUID().toString())\n  .withDeduplicationId(UUID.randomUUID().toString())\n  .build();\n\nsnsTemplate.send(requestEntry).addCallback(result -\u003e {\n  successCallback -\u003e LOGGER.info(\"{}\", successCallback), \n  failureCallback -\u003e LOGGER.error(\"{}\", failureCallback)\n});\n\nsnsTemplate.await().join();\n```\n\n### Send And Shutdown\n\n```java\nfinal TopicProperty topicProperty = TopicProperty.builder()\n  .fifo(true)\n  .linger(100)\n  .maxBatchSize(10)\n  .maximumPoolSize(20)\n  .topicArn(\"arn:aws:sns:us-east-2:000000000000:topic\")\n  .build();\n\nfinal AmazonSnsTemplate\u003cMyMessage\u003e snsTemplate = new AmazonSnsTemplate\u003c\u003e(amazonSNS, topicProperty);\n\nfinal RequestEntry\u003cMyMessage\u003e requestEntry = RequestEntry.builder()\n  .withValue(new MyMessage())\n  .withMessageHeaders(Map.of())\n  .withGroupId(UUID.randomUUID().toString())\n  .withDeduplicationId(UUID.randomUUID().toString())\n  .build();\n\nsnsTemplate.send(requestEntry).addCallback(result -\u003e {\n  successCallback -\u003e LOGGER.info(\"{}\", successCallback), \n  failureCallback -\u003e LOGGER.error(\"{}\", failureCallback)\n});\n\nsnsTemplate.shutdown();\n```\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## Versioning\n\nWe use [GitHub](https://github.com/mvallim/amazon-sns-java-messaging-lib) for versioning. For the versions available, see the [tags on this repository](https://github.com/mvallim/amazon-sns-java-messaging-lib/tags).\n\n## Authors\n\n* **Marcos Vallim** - *Founder, Author, Development, Test, Documentation* - [mvallim](https://github.com/mvallim)\n\nSee also the list of [contributors](CONTRIBUTORS.txt) who participated in this project.\n\n## License\n\nThis project is licensed under the Apache License - see the [LICENSE](LICENSE) file for details\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvallim%2Famazon-sns-java-messaging-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmvallim%2Famazon-sns-java-messaging-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvallim%2Famazon-sns-java-messaging-lib/lists"}