{"id":14963530,"url":"https://github.com/gojek/courier-android","last_synced_at":"2026-03-02T08:00:42.682Z","repository":{"id":37093196,"uuid":"470537161","full_name":"gojek/courier-android","owner":"gojek","description":"Kotlin library for creating long running connections using MQTT protocol","archived":false,"fork":false,"pushed_at":"2026-02-06T15:06:44.000Z","size":4522,"stargazers_count":156,"open_issues_count":8,"forks_count":31,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-02-06T23:07:26.705Z","etag":null,"topics":["android","gojek","kotlin-library","mobile-development","mqtt"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/gojek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSES/LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-03-16T10:38:32.000Z","updated_at":"2026-02-06T15:08:10.000Z","dependencies_parsed_at":"2023-11-14T08:38:05.244Z","dependency_job_id":"88e2c881-8acb-414a-a49f-fcac02944ea0","html_url":"https://github.com/gojek/courier-android","commit_stats":{"total_commits":75,"total_committers":10,"mean_commits":7.5,"dds":0.4933333333333333,"last_synced_commit":"bdcbff5406968d5b589876e4340e91f3ca7fd2a7"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/gojek/courier-android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gojek%2Fcourier-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gojek%2Fcourier-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gojek%2Fcourier-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gojek%2Fcourier-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gojek","download_url":"https://codeload.github.com/gojek/courier-android/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gojek%2Fcourier-android/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29995910,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"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":["android","gojek","kotlin-library","mobile-development","mqtt"],"created_at":"2024-09-24T13:31:44.879Z","updated_at":"2026-03-02T08:00:42.635Z","avatar_url":"https://github.com/gojek.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Build and Smoketest Status](https://github.com/gojek/courier-android/actions/workflows/android.yml/badge.svg)\n\u003ca href=\"https://gojek.github.io/courier-android/\"\u003e\n\t\u003cimg alt=\"Documentation\" src=\"https://img.shields.io/badge/documentation-yes-brightgreen.svg\" target=\"_blank\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/gojek/courier-android/graphs/commit-activity\"\u003e\n\t\u003cimg alt=\"Maintenance\" src=\"https://img.shields.io/badge/maintained-yes-green.svg\" target=\"_blank\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/gojek/courier-android/releases/latest\"\u003e\n\t\u003cimg alt=\"GitHub Release Date\" src=\"https://img.shields.io/github/release-date/gojek/courier-android\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/gojek/courier-android/commits/main\"\u003e\n\t\u003cimg alt=\"GitHub last commit\" src=\"https://img.shields.io/github/last-commit/gojek/courier-android\"\u003e\n\u003c/a\u003e\n[![Discord : Gojek Courier](https://img.shields.io/badge/Discord-Gojek%20Courier-blue.svg)](https://discord.gg/C823qK4AK7)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/gojek/courier-android/blob/main/docs/static/img/courier-logo-full-black.svg#gh-light-mode-only\" width=\"500\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/gojek/courier-android/blob/main/docs/static/img/courier-logo-full-white.svg#gh-dark-mode-only\" width=\"500\"/\u003e\n\u003c/p\u003e\n\n## About Courier\n\nCourier is a kotlin library for creating long running connections using MQTT protocol.\n\nLong running connection is a persistent connection established between client \u0026 server for instant bi-directional communication. A long running connection is maintained for maximum possible duration with the help of keep alive packets. This helps in saving battery and data on mobile devices.\n\nMQTT is an extremely lightweight protocol which works on publish/subscribe messaging model. It is designed for connections with remote locations where a \"small code footprint\" is required or the network bandwidth is limited.\n\nThe protocol usually runs over TCP/IP; however, any network protocol that provides ordered, lossless, bi-directional connections can support MQTT.\n\nMQTT has 3 built-in QoS levels for Reliable Message Delivery:\n\n* **QoS 0(At most once)** - the message is sent only once and the client and broker take no additional steps to acknowledge delivery (fire and forget).\n\n* **QoS 1(At least once)** - the message is re-tried by the sender multiple times until acknowledgement is received (acknowledged delivery).\n\n* **QoS 2(Exactly once)** - the sender and receiver engage in a two-level handshake to ensure only one copy of the message is received (assured delivery).\n\n## Detailed Documentation\n\nFind the detailed documentation here - https://gojek.github.io/courier-android/\n\nEnd-to-end courier example - https://gojek.github.io/courier/docs/Introduction\n\n## Features\n\n* Clean API\n\n* Adaptive Keep Alive\n\n* Message \u0026 Stream Adapters\n\n* Subscription Store\n\n* Automatic Reconnect \u0026 Resubscribe\n\n* Database Persistence\n\n* Backpressure handling\n\n* Alarm, Timer \u0026 WorkManager Ping Sender\n\n* MQTT Chuck\n\nMore details about features in Courier library can be found [here][1]\n\n## Getting Started\n\n### Sample App\n\nA demo application is added [here](./app/src/main/java/com/gojek/courier/app/ui/MainActivity.kt) which makes Courier connection with a [HiveMQ][2] public broker.\n\n### Download\n[![Maven Central](https://img.shields.io/maven-central/v/com.gojek.courier/courier.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.gojek.courier%22%20AND%20a:%courier%22)\n\nAll artifacts of Courier library are available via Maven Central.\n\n```groovy\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    implementation \"com.gojek.courier:courier:x.y.z\"\n\n    implementation \"com.gojek.courier:courier-message-adapter-gson:x.y.z\"\n    implementation \"com.gojek.courier:courier-stream-adapter-rxjava2:x.y.z\"\n}\n```\n\n### Usage\n\nDeclare a service interface for actions like Send, Receive, Subscribe, Unsubscribe:\n\n~~~ kotlin\ninterface MessageService {\n\t@Receive(topic = \"topic/{id}/receive\")\n\tfun receive(@Path(\"id\") identifier: String): Observable\u003cMessage\u003e\n\n\t@Send(topic = \"topic/{id}/send\", qos = QoS.TWO)\n\tfun send(@Path(\"id\") identifier: String, @Data message: Message)\n\n\t@Subscribe(topic = \"topic/{id}/receive\", qos = QoS.ONE)\n \tfun subscribe(@Path(\"id\") identifier: String): Observable\u003cMessage\u003e\n\n\t@Unsubscribe(topics = [\"topic/{id}/receive\"])\n \tfun unsubscribe(@Path(\"id\") identifier: String)\n}\n~~~\n\nUse Courier to create an implementation:\n\n~~~ kotlin\nval mqttClient = MqttClientFactory.create(\n    context = context,\n    mqttConfiguration = MqttV3Configuration(\n        authenticator = authenticator\n    )\n)\n\nval courierConfiguration = Courier.Configuration(\n    client = mqttClient,\n    streamAdapterFactories = listOf(RxJava2StreamAdapterFactory()),\n    messageAdapterFactories = listOf(GsonMessageAdapter.Factory())\n)\n\nval courier = Courier(courierConfiguration)\n\nval messageService = courier.create\u003cMessageService\u003e()\n~~~\n\n### Subscribe/Unsubscribe using Service Interface\n\n~~~ kotlin\nmessageService.subscribe(\"user-id\").subscribe { message -\u003e\n    print(message)\n}\nmessageService.unsubscribe(\"user-id\")\n~~~\n\n### Send/Receive using Service Interface\n\n~~~ kotlin\nmessageService.send(\"user-id\", message)\nmessageService.receive(\"user-id\") { message -\u003e\n    print(message)\n}\n~~~\n\n### Connect using MqttClient\n\n~~~ kotlin\nval connectOptions = MqttConnectOptions(\n    serverUris = listOf(ServerUri(SERVER_URI, SERVER_PORT)),\n    clientId = clientId,\n    username = username,\n    keepAlive = KeepAlive(\n        timeSeconds = keepAliveSeconds\n    ),\n    isCleanSession = cleanSessionFlag,\n    password = password\n)\n\nmqttClient.connect(connectOptions)\n~~~\n\n### Disconnect using MqttClient\n\n~~~ kotlin\nmqttClient.disconnect()\n~~~\n\n## Non-standard Connection options\n\n### UserProperties in MqttConnectionOptions\n\nThis option allows you to send user-properties in CONNECT packet for MQTT v3.1.1.\n\n~~~ kotlin\nval connectOptions = MqttConnectOptions(\n    serverUris = listOf(ServerUri(SERVER_URI, SERVER_PORT)),\n    clientId = clientId,\n    ...\n    userPropertiesMap = mapOf(\n                \"key1\" to \"value1\",\n                \"key2\" to \"value2\"\n    )\n)\n\nmqttClient.connect(connectOptions)\n~~~\n\n:warning: **\nThis is a non-standard option. As far as the MQTT specification is concerned, user-properties support is added in MQTT v5. So to support this in MQTT v3.1.1, broker needs to have support for this as well.\n\n## Contribution Guidelines\n\nRead our [contribution guide](./CONTRIBUTING.md) to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Courier Android library.\n\n## License\n\nAll Courier modules except Paho are [MIT Licensed](./LICENSES/LICENSE). Paho is [Eclipse Licensed](./LICENSES/LICENSE.paho).\n\n[1]: https://medium.com/gojekengineering/courier-library-for-gojeks-information-superhighway-368dc5f052fa\n[2]: https://broker.mqttdashboard.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgojek%2Fcourier-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgojek%2Fcourier-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgojek%2Fcourier-android/lists"}