Metadata-Version: 2.4
Name: amgi-pulsar
Version: 0.51.0
Summary: AMGI Apache Pulsar Server
Author: jack.burridge
Author-email: jack.burridge <jack.burridge@mail.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: amgi-common==0.51.0
Requires-Dist: amgi-types==0.51.0
Requires-Dist: pulsar-client>=3.10.0
Requires-Dist: typing-extensions>=4.15.0 ; python_full_version < '3.11'
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# amgi-pulsar

amgi-pulsar is an [AMGI](https://amgi.readthedocs.io/en/latest/) compatible server project, supporting running AMGI
applications against [Apache Pulsar](https://pulsar.apache.org/) topics.

The server consumes messages from a shared subscription, which is created if it does not exist. The subscription type
can be configured with `consumer_type`; `Shared` (the default) provides no ordering guarantees between consumers, while
`Exclusive`, `Failover` and `KeyShared` are also available. Messages are only acknowledged when the application sends a
`message.ack` event; a `message.nack` event triggers a redelivery. Messages that remain unacknowledged for longer than
`unacked_messages_timeout_ms` (30000 by default) are also redelivered.

## Installation

```
pip install amgi-pulsar==0.47.0
```

## Example

This example uses [AsyncFast](https://pypi.org/project/asyncfast/):

```python
from dataclasses import dataclass

from amgi_pulsar import run
from asyncfast import AsyncFast

app = AsyncFast()


@dataclass
class Order:
    item_ids: list[str]


@app.channel("order.topic")
async def order_topic(order: Order) -> None:
    # Makes an order
    ...


if __name__ == "__main__":
    run(app, "order.topic")
```

Or the application could be run via the commandline:

```commandline
asyncfast run amgi-pulsar main:app order.topic
```

## Contact

For questions or suggestions, please contact [jack.burridge@mail.com](mailto:jack.burridge@mail.com).

## License

Copyright 2025 AMGI
