Skip to content

[Feature] Add JsonRpcIdGenerator strategies with UUID v1/v3/v4/v5/v6/v7 support #25

@limehee

Description

@limehee

Problem statement

Request ID generation is currently application-defined, which leads to duplicated implementation for uniqueness, ordering, and interoperability constraints. Teams also need different ID schemes (numeric, UUID, deterministic name-based) depending on integration requirements.

Proposed solution

Add a JsonRpcIdGenerator strategy API in jsonrpc-core and provide first-party implementations:

  • AtomicLongIdGenerator (numeric IDs)
  • UUID-based generators covering major versions:
    • v1
    • v3
    • v4
    • v5
    • v6
    • v7

Design goals:

  • thread-safe generation
  • predictable interoperability (string or numeric output forms)
  • easy composition with request builders and client-side request orchestration

Alternatives considered

  • Keep ID generation entirely user-defined
  • Provide only one default UUID variant

These options do not address common portability needs across environments and protocols.

JSON-RPC behavior impact

No protocol behavior change. This adds ID generation utilities for client-side request construction.

Additional context

  • Document trade-offs for numeric IDs vs UUID strings.
  • Recommend v7 as default UUID strategy for new integrations.
  • Add tests for uniqueness characteristics, format correctness, and strategy wiring.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: waiting-for-feedbackWaiting for additional information from reporter or stakeholders.type: featureNew feature specification and implementation.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions