mirror of
https://github.com/mainflux/mainflux.git
synced 2025-05-04 22:17:59 +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:
parent
36ca9015ff
commit
523716b090
@ -2,13 +2,13 @@
|
|||||||
package nats
|
package nats
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
"github.com/mainflux/mainflux"
|
"github.com/mainflux/mainflux"
|
||||||
broker "github.com/nats-io/go-nats"
|
broker "github.com/nats-io/go-nats"
|
||||||
)
|
)
|
||||||
|
|
||||||
const topic string = "src.http"
|
|
||||||
|
|
||||||
var _ mainflux.MessagePublisher = (*natsPublisher)(nil)
|
var _ mainflux.MessagePublisher = (*natsPublisher)(nil)
|
||||||
|
|
||||||
type natsPublisher struct {
|
type natsPublisher struct {
|
||||||
@ -26,5 +26,6 @@ func (pub *natsPublisher) Publish(msg mainflux.RawMessage) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return pub.nc.Publish(topic, data)
|
subject := fmt.Sprintf("channel.%s", msg.Channel)
|
||||||
|
return pub.nc.Publish(subject, data)
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
queue string = "normalizers"
|
queue string = "normalizers"
|
||||||
subject string = "src.*"
|
subject string = "channel.*"
|
||||||
output string = "normalized"
|
output string = "normalized"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user