Skip to content

Commit 3d6aa46

Browse files
committed
feat: full nats profile
1 parent 90ef069 commit 3d6aa46

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

profile/profile.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ package profile
44
import (
55
"os"
66

7+
natslib "github.com/nats-io/nats.go"
78
"go-micro.dev/v5/broker"
89
"go-micro.dev/v5/broker/nats"
910
"go-micro.dev/v5/registry"
1011
nreg "go-micro.dev/v5/registry/nats"
1112
"go-micro.dev/v5/store"
13+
nstore "go-micro.dev/v5/store/nats-js-kv"
1214

1315
"go-micro.dev/v5/transport"
16+
ntx "go-micro.dev/v5/transport/nats"
1417
)
1518

1619
type Profile struct {
@@ -34,8 +37,10 @@ func NatsProfile() Profile {
3437
return Profile{
3538
Registry: nreg.NewNatsRegistry(registry.Addrs(addr)),
3639
Broker: nats.NewNatsBroker(broker.Addrs(addr)),
37-
Store: store.NewFileStore(), // nats-backed store when available
38-
Transport: transport.NewHTTPTransport(), // nats transport when available
40+
// this might be wrong, look for a better way to set this up
41+
Store: nstore.NewStore(nstore.NatsOptions(natslib.Options{Url: addr})),
42+
// same, double check for single url vs slice of Server
43+
Transport: ntx.NewTransport(ntx.Options(natslib.Options{Url: addr})),
3944
}
4045
}
4146

0 commit comments

Comments
 (0)