File

consolidated/stompjs/src/i-message.ts

Description

Instance of Message will be passed to subscription callback and Client#onUnhandledMessage. Since it is an extended FrameImpl, you can access headers and body as properties.

Part of @stomp/stompjs.

See Client#subscribe for example.

Extends

IFrame

Index

Properties

Properties

ack
ack: function
Type : function

When subscribing with manual acknowledgement, call this method on the message to ACK the message.

See Client#ack for an example.

nack
nack: function
Type : function

When subscribing with manual acknowledgement, call this method on the message to NACK the message.

See Client#nack for an example.

import { IFrame } from './i-frame';
import { StompHeaders } from './stomp-headers';

/**
 * Instance of Message will be passed to [subscription callback]{@link Client#subscribe}
 * and [Client#onUnhandledMessage]{@link Client#onUnhandledMessage}.
 * Since it is an extended {@link FrameImpl}, you can access [headers]{@link FrameImpl#headers}
 * and [body]{@link FrameImpl#body} as properties.
 *
 * Part of `@stomp/stompjs`.
 *
 * See [Client#subscribe]{@link Client#subscribe} for example.
 */
export interface IMessage extends IFrame {
  /**
   * When subscribing with manual acknowledgement, call this method on the message to ACK the message.
   *
   * See [Client#ack]{@link Client#ack} for an example.
   */
  ack: (headers?: StompHeaders) => void;

  /**
   * When subscribing with manual acknowledgement, call this method on the message to NACK the message.
   *
   * See [Client#nack]{@link Client#nack} for an example.
   */
  nack: (headers?: StompHeaders) => void;
}

/**
 * Aliased to {@link IMessage}.
 *
 * Part of `@stomp/stompjs`.
 */
export type Message = IMessage;

result-matching ""

    No results matching ""