Initial commit
This commit is contained in:
27
shfiles/setup-jetstream.sh
Normal file
27
shfiles/setup-jetstream.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/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
|
||||
|
||||
Reference in New Issue
Block a user