Skip to content

Commit

Permalink
feat: ✨ Added user and password for nats
Browse files Browse the repository at this point in the history
  • Loading branch information
egalvis39 committed Jan 10, 2024
1 parent 89b87c9 commit c37bfb2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion menuflow/events/nats_publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ async def get_connection(cls) -> tuple[NATSClient, JetStreamContext]:
async def nats_jetstream_connection(cls) -> JetStreamContext:
log.info("Connecting to NATS JetStream")
nc: NATSClient = await nats_connect(
cls.config["nats.address"], allow_reconnect=False, max_reconnect_attempts=1
cls.config["nats.address"],
allow_reconnect=False,
max_reconnect_attempts=1,
user=cls.config["nats.user"],
password=cls.config["nats.password"],
)
js = nc.jetstream()
subject = f"{cls.config['nats.subject']}.*"
Expand Down

0 comments on commit c37bfb2

Please sign in to comment.