Skip to content

MessageRequestProperties

reference
1 min readUpdated

Kind: Interface

Source: packages/microservices/listener-metadata-explorer.ts

Part of: Microservices

MessageRequestProperties describes the request and reply message patterns associated with a microservice listener. It groups the inbound requestPattern with the corresponding outbound replyPattern, allowing metadata exploration tools to identify request-response communication contracts.

Properties

PropertyType
requestPatternPatternMetadata
replyPatternPatternMetadata

Diagram

mermaid
graph LR
  Listener[Microservice Listener Metadata] --> Properties[MessageRequestProperties]
  Properties --> Request[requestPattern: PatternMetadata]
  Properties --> Reply[replyPattern: PatternMetadata]
  Request --> Incoming[Incoming request message]
  Reply --> Outgoing[Reply message]

Usage

ts
import type { MessageRequestProperties } from './listener-metadata-explorer';

const messageRequest: MessageRequestProperties = {
  requestPattern: {
    pattern: 'users.get',
  },
  replyPattern: {
    pattern: 'users.get.reply',
  },
};

// Use the metadata when inspecting or documenting listener contracts.
console.log(
  `Request pattern: ${messageRequest.requestPattern.pattern}`,
);
console.log(
  `Reply pattern: ${messageRequest.replyPattern.pattern}`,
);

AI Coding Instructions

  • Keep requestPattern and replyPattern paired when representing request-response message handlers.
  • Use valid PatternMetadata objects for both fields; do not substitute raw strings unless the metadata type explicitly permits them.
  • Preserve the distinction between request and reply patterns when inspecting listener metadata or generating documentation.
  • Update consumers of listener metadata if the shape or semantics of either pattern changes.

Was this page helpful?

Download as PDF
MessageRequestProperties — NestJS head-to-head