Skip to content

[Glense] Hybrid inter-service communication: HTTP + gRPC + RabbitMQ#27

Merged
Brankonymous merged 2 commits intomainfrom
branko-grbic/hybrid-communication
Mar 30, 2026
Merged

[Glense] Hybrid inter-service communication: HTTP + gRPC + RabbitMQ#27
Brankonymous merged 2 commits intomainfrom
branko-grbic/hybrid-communication

Conversation

@Brankonymous
Copy link
Copy Markdown
Owner

🚀 PR: Hybrid Inter-Service Communication Architecture

📝 Summary

This PR transitions the system from an all-HTTP communication model to a hybrid protocol approach. By matching specific business flows to the most efficient protocol, we improve system decoupling, reduce latency for high-frequency calls, and ensure reliable background processing.

Key Changes:

  • Protocol Diversification: Integrated RabbitMQ (MassTransit) for async events and gRPC for high-performance sync calls.
  • Infrastructure: Updated docker-compose.yml to include the RabbitMQ container.
  • Security: Hardened profile mutation endpoints by adding the [Authorize] attribute.
  • Cleanup: Removed obsolete start-dev.sh and stop-dev.sh scripts in favor of standard Docker commands.
  • Documentation: Updated README with a new architecture diagram and protocol guidelines.

📊 Protocol Mapping

Flow Protocol Rationale
Account → Donation RabbitMQ Async wallet creation; registration shouldn't wait for financial provisioning.
Donation → Account RabbitMQ Async notifications; ensures donation processing remains non-blocking.
Video → Account RabbitMQ Fire-and-forget subscription events.
Video → Account gRPC Optimized for high-frequency, low-latency username batch lookups.
Donation → Account HTTP Simple, synchronous recipient validation before a transaction starts.

⚙️ Infrastructure & Security Updates

  • MassTransit Configuration: Configured RabbitMQ as the message broker for internal events.
  • Endpoint Protection: Added [Authorize] to all ProfileMutation endpoints to ensure only authenticated users can modify data.
  • Developer Experience: Removed custom shell scripts to align with standard docker compose up workflows.

🧪 Verification Plan

  1. Event Bus: Register a new user and verify that a UserRegistered event is consumed by the Donation service to create a wallet.
  2. Performance: Execute a username resolution from the Video service and confirm it uses the gRPC channel.
  3. Auth: Attempt a profile update without a valid JWT to ensure the 401 Unauthorized response is returned.
  4. Environment: Run docker-compose up to ensure the new RabbitMQ image pulls and initializes correctly.

Would you like me to generate a checklist of specific unit tests to verify these new RabbitMQ and gRPC flows?

@Brankonymous Brankonymous requested review from ZekiMilovan001, andjixi and bogdans55 and removed request for andjixi and bogdans55 March 30, 2026 09:44
@Brankonymous Brankonymous self-assigned this Mar 30, 2026
@Brankonymous Brankonymous moved this to Code Review in Glense Mar 30, 2026
@Brankonymous Brankonymous added this to the sprint-3 milestone Mar 30, 2026
@Brankonymous Brankonymous merged commit d0908a9 into main Mar 30, 2026
2 checks passed
@github-project-automation github-project-automation bot moved this from Code Review to Done in Glense Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants