# @galaxyops/messaging-schemas

> This contains Pub/Sub message schemas. These help provide loose coupling during async communication between microservices.

Latest version **2.2.0** (published 2024-10-01) · 0 weekly downloads

## Install

```sh
npm install @galaxyops/messaging-schemas
pnpm add @galaxyops/messaging-schemas
yarn add @galaxyops/messaging-schemas
bun add @galaxyops/messaging-schemas
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.2.0 |
| Published | 2024-10-01 |
| First published | 2024-07-22 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 88.7 KB |
| Known vulnerabilities | 0 (+4 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 12 |
| Maintainers | hxtree |

## Links

- npm: https://www.npmjs.com/package/@galaxyops/messaging-schemas
- Repository: https://github.com/hxtree/galaxyops
- Homepage: https://github.com/hxtree/galaxyops#readme
- Issues: https://github.com/hxtree/galaxyops/issues
- npm.io page: https://npm.io/package/@galaxyops/messaging-schemas

## Dependencies (8)

- [uuid](https://npm.io/package/uuid.md) ~9.0.1
- [lodash](https://npm.io/package/lodash.md) 4.17.21
- [@types/lodash](https://npm.io/package/@types/lodash.md) 4.17.6
- [@types/validator](https://npm.io/package/@types/validator.md) ~13.7.10
- [class-transformer](https://npm.io/package/class-transformer.md) 0.5.1
- [@galaxyops/base-nodejs](https://npm.io/package/@galaxyops/base-nodejs.md) 0.2.0
- [@galaxyops/faker-factory](https://npm.io/package/@galaxyops/faker-factory.md) 3.3.0
- [@galaxyops/validation-schemas](https://npm.io/package/@galaxyops/validation-schemas.md) 2.2.0

## Recent versions

- 2.2.0 (latest) — 2024-10-01
- 2.1.0 — 2024-07-22

## README

# @galaxyops/messaging-schemas

This contains Pub/Sub message schemas. These help provide loose coupling during
async communication between microservices.

- SNS topics are deployed with the message broker.
- SQS deployments should be owned by consumer.

## Naming Convention

```txt
CONTEXT - VERB - CATEGORY
```

e.g.

- EmailSendCommand
- UserPasswordResetEvent
- PlayerDisconnectedEvent
- CharacterRankRequest

## Message Categories

**Command** Command send a idempotent request to a topic asking subscribers to
perform task. The consumer of a command does not inform or provide a response to
the publisher. The publisher expects something to occur as a result of the
request.

> Publisher -> SNS -> SQS -> Consumer

**Event** Publish to a SNS topic informing any subscribers that something
occurred within a given system. Events published may be significant events that
were published only for the purpose of data retention and analytic purposes.

> Publisher -> SNS -> SQS -> Consumer

**Request** Publish an async message to a single queue letting them know which
queue to send a reply to.

> Publisher -> SQS -> Consumer -> (SQS -> Publisher)

**Reply** In response to a request publish an message to a single queue as
request.

> (Publisher -> SQS) -> Consumer -> SQS -> Publisher

## References

- [Pub/Sub Messaging Schema](https://cloud.google.com/pubsub/docs/schemas)
- [Microservice Async Message Based Communication](https://medium.com/design-microservices-architecture-with-patterns/microservices-asynchronous-message-based-communication-6643bee06123)
- [Message Queue Pattern](https://badia-kharroubi.gitbooks.io/microservices-architecture/content/patterns/communication-patterns/message-queue-pattern.html)
- [Request Reply Pattern](https://aws.plainenglis.io/an-introduction-to-request-reply-pattern-and-its-uses-2a0bb74ff7d8)
- [CQRS](https://learn.microsoft.com/en-us/azure/architecture/patterns/cqrs)
- [Event Driven Schemas](https://medium.com/flippengineering/schema-and-topic-design-in-event-driven-systems-featuring-kafka-a555ddfdb8d8)

---
_Source: https://npm.io/package/@galaxyops/messaging-schemas · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
