Files
kubernetes/shfiles/setup-jetstream.sh
2026-07-18 12:00:33 +05:30

28 lines
615 B
Bash

#!/bin/bash
# Setup JetStream stream and consumer for NATS
echo "🚀 Setting up NATS JetStream..."
cd "$(dirname "$0")"
# Check if Python is available
if ! command -v python3 &> /dev/null; then
echo "❌ Python3 not found. Please install Python3."
exit 1
fi
# Check if nats-py is installed
if ! python3 -c "import nats" 2>/dev/null; then
echo "📦 Installing nats-py..."
pip3 install nats-py
fi
# Set environment variables
export NATS_URL="nats://nats.workolik.com:4222"
export NATS_USER="admin"
export NATS_PASSWORD="package@321#"
# Run the setup script
python3 scripts/setup_jetstream.py