Get Book (gRPC) (v1.0.0)
This query was deprecated on June 20, 2025
This endpoint (GetBookGrpc
) is currently not utilized by any service in BookWorm.
For retrieving books, consider using the ListBookGrpc
endpoint, which is designed for listing and querying books efficiently.
Get a book by ID via gRPC
Overview
This gRPC endpoint follows Domain-Driven Design principles to retrieve a specific Book aggregate root from the Catalog bounded context by its unique identifier. The operation is implemented as a query that doesn’t modify state, adhering to CQRS patterns.
The query handler maps the domain entity to a BookDto response through an auto-mapper profile, ensuring that domain implementation details remain encapsulated. The endpoint respects the aggregate boundaries and only exposes data appropriate for the presentation layer.
Key Features
- High Performance: gRPC binary protocol for efficient data transfer
- Strong Typing: Protocol buffer definitions ensure type safety
- Streaming Support: Capable of server streaming for bulk operations
- Cross-Platform: Works with any gRPC-compatible client
Architecture
Usage
Call GetBook using grpcurl
You can use grpcurl to call the GetBook
method of the BookGrpcService
defined in your book.proto
:
grpcurl -plaintext \
-d '{"bookId": "<BOOK_ID>"}' \
localhost:5001 \
CatalogApi.BookGrpcService/GetBook
- Replace
<BOOK_ID>
with the actual book ID (string). - Adjust the host/port (
localhost:5001
) as needed for your environment. - The response will be a
BookResponse
message as defined in your proto:
{
"id": "<BOOK_ID>",
"name": "Atomic Habits",
"price": { "units": 12, "nanos": 0 },
"priceSale": { "units": 10, "nanos": 0 },
"status": "InStock"
}
The unique identifier for the book
The name of the book
The price of the book
The sale price of the book
The status of the book
No properties match your search
Try a different search term or clear the search to see all properties