Skip to content

Latest commit

 

History

History
157 lines (120 loc) · 4.71 KB

File metadata and controls

157 lines (120 loc) · 4.71 KB

?? Service + Web Dashboard Integration Options

?? Current Situation:

Your application currently has separate modes which is actually a good design:

ExtensionAttributes.WorkerSvc.exe --service      # ? Windows Service (scheduled jobs)
ExtensionAttributes.WorkerSvc.exe --web         # ? Web Dashboard (monitoring)

?? Recommended Production Setup:

?? Option 1: Dual Instance Setup (Recommended)

Run two instances of your application - this is the most robust approach:

Instance 1: Windows Service (Background Processing)

# Install as Windows Service for scheduled jobs
ExtensionAttributes.WorkerSvc.exe --service
  • Service Name: ExtensionAttributesWorkerSvc
  • Purpose: Scheduled extension attribute processing
  • Runs: Background, automatic startup
  • Jobs: Quartz.NET scheduled jobs based on schedule.json

Instance 2: Web Dashboard (Monitoring & Control)

# Run web dashboard separately (or as another service)
ExtensionAttributes.WorkerSvc.exe --web
  • Purpose: Real-time monitoring, health checks, manual device processing
  • Runs: Web server on http://localhost:5000
  • Features: Dashboard, API, health checks, device processing

?? Option 2: Port-Based Service Management

Primary Service (Background Jobs)

# Main service on default ports
ExtensionAttributes.WorkerSvc.exe --service

Web Dashboard Service (Different Port)

# Web service on different port - modify appsettings.json:
{
  "Kestrel": {
    "Endpoints": {
      "Http": {
        "Url": "http://localhost:5001"
      }
    }
  }
}

# Then run:
ExtensionAttributes.WorkerSvc.exe --web

?? Option 3: Service Manager Approach

Create a simple batch script or PowerShell script to manage both:

start-all.cmd

@echo off
echo Starting Extension Attributes Automation...

echo Installing Windows Service...
ExtensionAttributes.WorkerSvc.exe --service

timeout /t 5

echo Starting Web Dashboard...
start "Web Dashboard" ExtensionAttributes.WorkerSvc.exe --web

echo.
echo ? Extension Attributes Automation is running:
echo ?? Service: Background processing (Windows Service)
echo ?? Dashboard: http://localhost:5000
echo.
pause

start-all.ps1

Write-Host "Starting Extension Attributes Automation..." -ForegroundColor Green

Write-Host "Installing Windows Service..." -ForegroundColor Yellow
Start-Process -FilePath "ExtensionAttributes.WorkerSvc.exe" -ArgumentList "--service" -Wait

Start-Sleep -Seconds 5

Write-Host "Starting Web Dashboard..." -ForegroundColor Yellow
Start-Process -FilePath "ExtensionAttributes.WorkerSvc.exe" -ArgumentList "--web"

Write-Host ""
Write-Host "? Extension Attributes Automation is running:" -ForegroundColor Green
Write-Host "?? Service: Background processing (Windows Service)" -ForegroundColor Cyan  
Write-Host "?? Dashboard: http://localhost:5000" -ForegroundColor Cyan
Write-Host ""

?? Why This Design is Actually Better:

? Advantages of Separate Instances:

  1. ?? Independent Scaling - Each can be scaled separately
  2. ??? Fault Isolation - Web dashboard issues don't affect background processing
  3. ?? Easier Maintenance - Can restart web dashboard without affecting service
  4. ?? Dedicated Resources - Each optimized for its specific purpose
  5. ?? Clear Separation - Background processing vs interactive monitoring
  6. ?? Development Friendly - Can test web dashboard without running service

?? Enterprise Benefits:

  • Load Balancing: Multiple web dashboard instances can point to same service
  • High Availability: Service continues even if web dashboard is down
  • Security: Web dashboard can run in DMZ while service stays internal
  • Monitoring: Each instance can be monitored independently

?? Quick Start Guide:

Step 1: Install Service

cd ExtensionAttributes.Worker\bin\Release\net9.0
ExtensionAttributes.WorkerSvc.exe --service

Step 2: Start Web Dashboard

# In same directory or different server
ExtensionAttributes.WorkerSvc.exe --web

Step 3: Verify Setup


?? Result:

You now have the best of both worlds:

  • ?? Reliable background service handling scheduled processing
  • ?? Interactive web dashboard for monitoring and control
  • ?? Complete separation of concerns
  • ??? Enterprise-grade reliability

This approach is actually superior to a hybrid solution because it provides better fault tolerance, scalability, and maintainability! ??