1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-05-02 22:17:10 +08:00

Rename NATS subjects for HTTP & normalizer (#207)

* Change NATS subject name

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Change normalizer subscription name

Signed-off-by: Dejan Mijic <dejan@mainflux.com>
This commit is contained in:
Dejan Mijić 2018-03-22 23:59:15 +01:00 committed by Drasko DRASKOVIC
parent 36ca9015ff
commit 523716b090
2 changed files with 5 additions and 4 deletions

View File

@ -2,13 +2,13 @@
package nats
import (
"fmt"
"github.com/golang/protobuf/proto"
"github.com/mainflux/mainflux"
broker "github.com/nats-io/go-nats"
)
const topic string = "src.http"
var _ mainflux.MessagePublisher = (*natsPublisher)(nil)
type natsPublisher struct {
@ -26,5 +26,6 @@ func (pub *natsPublisher) Publish(msg mainflux.RawMessage) error {
return err
}
return pub.nc.Publish(topic, data)
subject := fmt.Sprintf("channel.%s", msg.Channel)
return pub.nc.Publish(subject, data)
}

View File

@ -12,7 +12,7 @@ import (
const (
queue string = "normalizers"
subject string = "src.*"
subject string = "channel.*"
output string = "normalized"
)