Skip to content

Commit

Permalink
update dev guide description
Browse files Browse the repository at this point in the history
Signed-off-by: SammyOina <sammyoina@gmail.com>
  • Loading branch information
SammyOina committed Aug 1, 2023
1 parent e0b6212 commit 0429795
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
18 changes: 12 additions & 6 deletions docs/dev-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,22 +226,28 @@ which will do this copying of the binaries.
Mainflux depends on several infrastructural services, notably the default message broker, [NATS](https://www.nats.io/) and [PostgreSQL](https://www.postgresql.org/) database.

#### Message Broker

Mainflux uses NATS as it's default central message bus. For development purposes (when not run via Docker), it expects that NATS is installed on the local system.

To do this execute:

```
go get github.com/nats-io/gnatsd
```bash
go install github.com/nats-io/nats-server/v2@latest
```

This will install `gnatsd` binary that can be simply run by executing:
This will install `nats-server` binary that can be simply run by executing:

```
gnatsd
```bash
nats-server
```

If you want to change the default message broker to [RabbitMQ](https://www.rabbitmq.com/download.html), [VerneMQ](https://vernemq.com/downloads/) or [Kafka](https://kafka.apache.org/quickstart) you need to install it on the local system.
If you want to change the default message broker to [RabbitMQ](https://www.rabbitmq.com/download.html) or [VerneMQ](https://vernemq.com/downloads/) you need to install it on the local system.
To run using a different broker you need to set the `MF_BROKER_TYPE` env variable to `nats`, `rabbitmq` or `vernemq` during make and run process.

```bash
MF_BROKER_TYPE=<broker-type> make
MF_BROKER_TYPE=<broker-type> make run
```

#### PostgreSQL
Mainflux uses PostgreSQL to store metadata (`users`, `things` and `channels` entities alongside with authorization tokens).
Expand Down
3 changes: 2 additions & 1 deletion docs/edge.md
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ git clone https://github.com/mainflux/agent
go run ./examples/publish/main.go -s http://localhost:4222 export.test "[{\"bn\":\"test\"}]";
```

We have configured route for export, `nats_topic = ">"` means that it will listen to `NATS` subject `export.>` and `mqtt_topic` is configured so that data will be sent to MQTT broker on topic `channels/e2adcfa6-96b2-425d-8cd4-ff8cb9c056ce/messages` with appended `NATS` subject. Depending on the broker used, nats by default, rabbitmq can be used by setting the build tag to `rabbitmq`.
We have configured route for export, `nats_topic = ">"` means that it will listen to `NATS` subject `export.>` and `mqtt_topic` is configured so that data will be sent to MQTT broker on topic `channels/e2adcfa6-96b2-425d-8cd4-ff8cb9c056ce/messages` with appended `NATS` subject. Other brokers can such as `rabbitmq` can be used, for more detail refer to [dev-guide][dev-guide].

In terminal where export is started you should see following message:

Expand All @@ -553,3 +553,4 @@ mainflux-mqtt | {"level":"info","message":"Publish - client ID export-88529fb2
[env]:(https://github.com/mainflux/export#environmet-variables)
[agent]:(https://github.com/mainflux/agent)
[protomsg]:https://github.com/mainflux/mainflux/blob/master/pkg/messaging/message.proto
[dev-guide]: /docs/dev-guide.md/#message-broker

0 comments on commit 0429795

Please sign in to comment.