{"id":13640907,"url":"https://github.com/zio/zio-amqp","last_synced_at":"2025-04-25T23:31:30.432Z","repository":{"id":40348512,"uuid":"220320982","full_name":"zio/zio-amqp","owner":"zio","description":"ZIO-based AMQP client for Scala","archived":false,"fork":false,"pushed_at":"2024-08-15T20:09:32.000Z","size":238,"stargazers_count":34,"open_issues_count":19,"forks_count":21,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T12:24:51.581Z","etag":null,"topics":["amqp","scala","zio"],"latest_commit_sha":null,"homepage":"https://zio.dev/zio-amqp/","language":"Scala","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/zio.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-07T20:13:15.000Z","updated_at":"2025-01-18T20:01:31.000Z","dependencies_parsed_at":"2024-05-20T21:15:57.329Z","dependency_job_id":"c5e08d39-6c3a-4d7f-94c6-8657dc033a88","html_url":"https://github.com/zio/zio-amqp","commit_stats":null,"previous_names":["zio/zio-amqp","svroonland/zio-amqp"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zio%2Fzio-amqp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zio%2Fzio-amqp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zio%2Fzio-amqp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zio%2Fzio-amqp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zio","download_url":"https://codeload.github.com/zio/zio-amqp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250366708,"owners_count":21418770,"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":["amqp","scala","zio"],"created_at":"2024-08-02T01:01:15.645Z","updated_at":"2025-04-25T23:31:30.078Z","avatar_url":"https://github.com/zio.png","language":"Scala","funding_links":[],"categories":["NoSQL"],"sub_categories":[],"readme":"[//]: # (This file was autogenerated using `zio-sbt-website` plugin via `sbt generateReadme` command.)\n[//]: # (So please do not edit it manually. Instead, change \"docs/index.md\" file or sbt setting keys)\n[//]: # (e.g. \"readmeDocumentation\" and \"readmeSupport\".)\n\n# ZIO AMQP\n\nZIO AMQP is a ZIO-based wrapper around the RabbitMQ client. It provides a streaming interface to AMQP queues and helps to prevent you from shooting yourself in the foot with thread-safety issues. \n\n[![Development](https://img.shields.io/badge/Project%20Stage-Development-green.svg)](https://github.com/zio/zio/wiki/Project-Stages) ![CI Badge](https://github.com/zio/zio-amqp/workflows/CI/badge.svg) [![Sonatype Releases](https://img.shields.io/nexus/r/https/oss.sonatype.org/dev.zio/zio-amqp_2.13.svg?label=Sonatype%20Release)](https://oss.sonatype.org/content/repositories/releases/dev/zio/zio-amqp_2.13/) [![Sonatype Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-amqp_2.13.svg?label=Sonatype%20Snapshot)](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-amqp_2.13/) [![javadoc](https://javadoc.io/badge2/dev.zio/zio-amqp-docs_2.13/javadoc.svg)](https://javadoc.io/doc/dev.zio/zio-amqp-docs_2.13) [![ZIO AMQP](https://img.shields.io/github/stars/zio/zio-amqp?style=social)](https://github.com/zio/zio-amqp)\n\n## Installation\n\nAdd the following lines to your `build.sbt` file:\n\n```scala\nlibraryDependencies += \"dev.zio\" %% \"zio-amqp\" % \"1.0.0-alpha.3\"\n```\n\n## Consuming\n\nThe example below creates a connection to an AMQP server and then creates a channel. Both are created as Managed resources, which means they are closed automatically after using even in the face of errors.\n\nThe example then creates a stream of the messages consumed from a queue named `\"queueName\"`. Each received message is acknowledged back to the AMQP server.\n\n## Producing\n\nAlso in the example bellow is a producer which publishes to a given queue\n\n```scala\nimport zio.amqp._\nimport zio.amqp.model._\nimport java.net.URI\nimport zio._\nimport zio.Console._\n\nval channel: ZIO[Scope, Throwable, Channel] = for {\n  connection \u003c- Amqp.connect(URI.create(\"amqp://my_amqp_server_uri\"))\n  channel    \u003c- Amqp.createChannel(connection)\n} yield channel\n\nval effect: ZIO[Any, Throwable, Unit] =\n  ZIO.scoped {\n    channel.flatMap { channel =\u003e\n      channel\n        .consume(queue = QueueName(\"queueName\"), consumerTag = ConsumerTag(\"test\"))\n        .mapZIO { record =\u003e\n          val deliveryTag = record.getEnvelope.getDeliveryTag\n          printLine(s\"Received ${deliveryTag}: ${new String(record.getBody)}\") *\u003e\n            channel.ack(DeliveryTag(deliveryTag))\n        }\n        .take(5)\n        .runDrain\n    }\n  }\n\nval producer = ZIO.scoped {\n  channel.flatMap { channel =\u003e\n    channel.publish(\n      exchange = ExchangeName(\"\"),\n      routingKey = RoutingKey(\"queueName\"),\n      body = \"Hello world\".getBytes\n    )\n  }\n}\n```\n\nSee the [ZIO documentation](https://zio.dev/docs/overview/overview_running_effects#defaultruntime) for more information on how to run this effect or integrate with an existing application.\n\n## Documentation\n\nLearn more on the [ZIO AMQP homepage](https://zio.dev/zio-amqp)!\n\n## Contributing\n\nFor the general guidelines, see ZIO [contributor's guide](https://zio.dev/contributor-guidelines).\n\n## Code of Conduct\n\nSee the [Code of Conduct](https://zio.dev/code-of-conduct)\n\n## Support\n\nCome chat with us on [![Badge-Discord]][Link-Discord].\n\n[Badge-Discord]: https://img.shields.io/discord/629491597070827530?logo=discord \"chat on discord\"\n[Link-Discord]: https://discord.gg/2ccFBr4 \"Discord\"\n\n## License\n\n[License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzio%2Fzio-amqp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzio%2Fzio-amqp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzio%2Fzio-amqp/lists"}