README.md

# Pulsarix [![CI](https://github.com/elixir-plug/mime/actions/workflows/ci.yml/badge.svg)](https://github.com/GBMayombe/pulsarix/actions/workflows/ci.yml) [![Hex Docs](https://img.shields.io/badge/docs-hexpm-blue.svg)](https://hexdocs.pm/pulsarix/)

## Description

Pulsarix is an Elixir library for seamless interaction with Apache Kafka, focusing on message production capabilities. It provides a clean, functional interface for sending messages to Kafka topics with support for various production methods:

- Synchronous message production
- Asynchronous message production
- Callback-based approaches
- Batch message handling

### Features

- Multiple message production strategies
- Type-safe message handling with proper typespecs
- Telemetry integration for monitoring and metrics
- Flexible message formatting with support for:
  - Binary keys and values
  - Custom headers
  - Timestamp control
  - Batch operations

## Installation

If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `pulsarix` to your list of dependencies in `mix.exs`:

```elixir
def deps do
  [
    {:pulsarix, "~> 1.0.0"}
  ]
end
```

## Usage

> ### Warning {: .warning}
>
> Ensure kafka is started.

## Contributing

Before submitting a PR, ensure you run `mix check` and all checks passes
successfully.

## Version Bumps

This project adheres to [Semantic Versioning][semantic-versioning],
which means the version number will follow the format `MAJOR.MINOR.PATCH`.

Also, the [github-tag-action][github-tag-action] is used to automatically
create a new tag when the PR is merged to master.

When open a PR meant to generate a new version:

1. Update the `mix.exs` and `README` with the new version.

2. Update [CHANGELOG](CHANGELOG.md) with the new version tight to
   [semantic versioning][semantic-versioning].

3. Don't forget to include in your commit the tag:

   - `"#patch"` for increment `PATCH` version.
     E.g.: **"Fix failing tests (#patch)"**.
   - `"#minor"` for increment `MINOR` version.
     E.g.: **"Add Telemetry utility to instrument the projects (#minor)"**.
   - `"#major"` for increment `MAJOR` version.
     E.g.: **"Release x.y.z (#major)"**.

[github-tag-action]: https://github.com/anothrNick/github-tag-action
[semantic-versioning]: https://semver.org/spec/v2.0.0.html

If for some reason GH actions are not working (maybe because we ran out of
minutes), then push the tag manually, like so:

```
git tag -a v0.1.0 -m "Pulsarix version 0.1.0"
git push origin v0.1.0
```

## License

Apache License 2.0. See the project’s LICENSE file for details.

Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at <https://hexdocs.pm/pulsarix>.