Mainflux.mainflux/consumers
b1ackd0t 4401e79a0d
NOISSUE - Add Subscriber Config (#1896)
* Replace Nats with Nats Jestream For PubSub

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Add Stream Description

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix connection leak in NATS publisher

The publisher struct in pkg/messaging/nats/publisher.go was modified to include a new `conn` field of type `*broker.Conn`. This change was made to fix a connection leak issue in the NATS publisher.

The `NewPublisher` function was updated to assign the `conn` parameter to the new `conn` field in the publisher struct.

Additionally, the `Close` method in the publisher struct was modified to close the `conn` connection.

This commit fixes the connection leak issue in the NATS publisher and ensures that connections are properly closed.

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>

* Setup subscriber config to contain handler topic and ID

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Add delivery policy

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Avoid duplicate messages

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Rename to DeliveryPolicy

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix tests

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Not check for data result set when we are returning subset of messages

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* For unsubscribe remove config

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* Fix comment

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-10-23 15:27:15 +02:00
..
notifiers NOISSUE - Make MQTT Broker Configurable (#1904) 2023-10-19 21:01:09 +02:00
tracing NOISSUE - Add More Linters (#1924) 2023-10-16 11:43:33 +02:00
writers NOISSUE - Add Subscriber Config (#1896) 2023-10-23 15:27:15 +02:00
README.md NOISSUE - Use github action for showing OpenAPI spec with Swagger UI (#1427) 2021-06-23 13:31:46 +02:00
consumer.go NOISSUE - Trace consume operations (#1778) 2023-07-22 14:38:16 +02:00
doc.go MF-1506 - Group-based Access Control (#1716) 2023-06-14 12:40:37 +02:00
messages.go NOISSUE - Add Subscriber Config (#1896) 2023-10-23 15:27:15 +02:00

README.md

Consumers

Consumers provide an abstraction of various Mainflux consumers. Mainflux consumer is a generic service that can handle received messages - consume them. The message is not necessarily a Mainflux message - before consuming, Mainflux message can be transformed into any valid format that specific consumer can understand. For example, writers are consumers that can take a SenML or JSON message and store it.

Consumers are optional services and are treated as plugins. In order to run consumer services, core services must be up and running.

For an in-depth explanation of the usage of consumers, as well as thorough understanding of Mainflux, please check out the official documentation.

For more information about service capabilities and its usage, please check out the API documentation.