Product Decisions This Supports
- API Strategy: Enables rapid development of JSON-RPC 2.0 endpoints for internal tools, microservices, or legacy system integrations without reinventing the wheel. Ideal for teams needing structured RPC communication (e.g., CLI-to-backend, service orchestration, or admin panels).
- Legacy Modernization: Bridges older PHP/Symfony2 systems with modern RPC-based workflows (e.g., replacing SOAP or custom JSON APIs).
- Build vs. Buy: Buy if the team lacks time/resources to build a custom RPC layer from scratch. Build only if needing deep customization (e.g., non-standard auth, batching, or transport layers).
- Roadmap Prioritization:
- Short-term: Quickly expose Symfony2 services as RPC endpoints for dev tools (e.g., IDE plugins, monitoring).
- Long-term: Extend to support JSON-RPC over WebSockets or gRPC via a unified facade (if the package evolves or is forked).
- Use Cases:
- Internal Developer Tools: Remote procedure calls for debugging, testing, or admin interfaces.
- Microservices Communication: Lightweight alternative to REST/gRPC for service-to-service RPC (if latency is critical).
- Legacy System Integration: Wrap existing Symfony2 controllers/services in a standardized RPC layer for gradual migration.
When to Consider This Package
- Adopt if:
- Your team uses Symfony2 and needs JSON-RPC 2.0 support with minimal setup.
- You prioritize simplicity over flexibility (e.g., no need for GraphQL, OpenAPI, or gRPC).
- Your use case fits request/response RPC (not pub/sub or streaming).
- You’re okay with Symfony2-specific constraints (not Symfony 5+/6+).
- Look elsewhere if:
- You need modern Symfony (5/6/7) compatibility (this bundle targets Symfony2).
- You require advanced features like:
- Batch requests (not natively supported).
- Custom transport layers (e.g., WebSockets, gRPC).
- Strong typing (PHP 8+ attributes or OpenAPI schemas).
- Your team prefers REST or GraphQL for public APIs.
- The package’s maturity (0 stars, minimal docs) is a risk for production use.
- You need authentication/authorization beyond basic Symfony security (e.g., API keys, OAuth).
How to Pitch It (Stakeholders)
For Executives:
"This bundle lets us rapidly expose Symfony2 services as JSON-RPC endpoints—ideal for internal tools, microservices, or legacy integrations—without building a custom solution. It’s a lightweight, standards-based way to enable RPC communication (e.g., for CLI tools, monitoring, or service orchestration). While immature, it’s a low-risk prototype if we validate demand first. For public APIs, we’d explore more robust options like gRPC or OpenAPI."
For Engineering:
*"The agentsib/jsonrpc-bundle provides a Symfony2-specific JSON-RPC 2.0 layer with:
- Zero-config RPC endpoints for services/controllers.
- Symfony2 integration (no framework swaps needed).
- Minimal dependencies (just the
agentsib/jsonrpc library).
Tradeoffs:
- No Symfony 5+/6+ support (Symfony2-only).
- Limited docs (expect trial-and-error for edge cases).
- Basic auth (relies on Symfony security; add custom middleware if needed).
Proposal: Use this for internal RPC needs (e.g., dev tools) and fork/extend if we hit limits. For public APIs, we should evaluate gRPC or REST instead."*
For Developers:
*"This bundle auto-generates JSON-RPC endpoints for your Symfony2 services with almost no code. Example:
// Service method
public function add(User $user, string $role) { ... }
// Auto-exposed as RPC:
curl -X POST -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"add","params":[1,"admin"],"id":1}' \
http://app.dev/api/rpc
**Gotchas**:
- **No batch requests** (send one call per RPC).
- **Symfony2-only** (won’t work on newer Symfony).
- **Docs are sparse**—expect to dig into the source for customization.
**Use it for**:
✅ Quick internal RPC tools.
✅ Legacy system wrappers.
❌ Public APIs or high-scale services."*