# alternera_plugin_anypoint_mq

[![CI](https://github.com/10e-ab/alternera-anypoint-mq/actions/workflows/ci.yml/badge.svg)](https://github.com/10e-ab/alternera-anypoint-mq/actions/workflows/ci.yml)

The Anypoint MQ plugin for [Alternera](https://github.com/10e-ab/alternera)
pipelines: a step publishes a message to an Anypoint MQ queue or exchange,
or consumes, acknowledges (ack) or releases (nack) messages, through the
broker's REST API. Consuming runs from a message trigger
(`AnypointMq.Source`, an Anypoint MQ queue as a message source), or from a
pipeline a continuous trigger runs.

The package builds on the plugin SDK and the editor contract
([alternera-sdk](https://github.com/10e-ab/alternera-sdk)) and calls nothing
of the proxy: the broker call goes through `Plugin.Provisional.Outbound` as
a proxy user of the tenant, and the auth profile's token through
`Plugin.Provisional.Credentials`. Alternera ships it: the proxy depends on
it and lists `Alternera.Plugins.AnypointMq` among its shipped plugins.

## Tests

`test/` checks the contract, the broker calls and the message source with
the SDK's kit, with no proxy and no broker around:

```bash
mix deps.get
mix test
```

To test against an unreleased SDK, point `ALTERNERA_SDK_PATH` at an
absolute path to a checkout of alternera-sdk.

## Documentation

- `docs/anypoint_mq.md`: the user guide page, which the proxy serves as
  `plugin-anypoint_mq` (`use Alternera.Plugin, docs:`);
- `docs/guide.md`: the notes the proxy's assistant reads (`guide:`);
- `docs/internals.adoc`: the internals chapter, how the step, the broker
  calls, the source and the editor work.

## Working on it with Alternera

Alternera takes this package from Hex. To change it and the proxy together,
check this repository out and point `ALTERNERA_ANYPOINT_MQ_PATH` at that
checkout (an absolute path) when building Alternera; it then takes the
package from there. Release this package first, then the Alternera change
that requires the new version.

## Licence

Licensed under the Apache License, Version 2.0 (`LICENSE`, `NOTICE`).
Alternera itself, the proxy this package plugs into, is under the Elastic
License 2.0.
