Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StompClientConnection

Once a connection to the STOMP server has been made, client receives a StompClientConnection, that let send and receive STOMP frames.

Hierarchy

  • StompClientConnection

Index

Methods

abort

  • Aborts a transaction.

    Parameters

    • id: string

    Returns PromiseLike<Frame>

  • Aborts a transaction.

    Parameters

    • id: string
    • receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>

    Returns StompClientConnection

  • Aborts a transaction.

    Parameters

    • id: string
    • headers: {}
      • [key: string]: string

    Returns PromiseLike<Frame>

  • Aborts a transaction.

    Parameters

    • id: string
    • headers: {}
      • [key: string]: string
    • receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>

    Returns StompClientConnection

ack

  • Sends an acknowledgement for a specific message. It means that the message has been handled and processed by the client. The id parameter is the message id received in the frame.

    Parameters

    • id: string

    Returns PromiseLike<Frame>

  • Sends an acknowledgement for a specific message. It means that the message has been handled and processed by the client. The id parameter is the message id received in the frame.

    Parameters

    • id: string
    • receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>

    Returns StompClientConnection

  • Sends an acknowledgement for the given frame. It means that the frame has been handled and processed by the client. The sent acknowledgement is part of the transaction identified by the given id.

    Parameters

    • id: string
    • txId: string

    Returns PromiseLike<Frame>

  • Sends an acknowledgement for the given frame. It means that the frame has been handled and processed by the client. The sent acknowledgement is part of the transaction identified by the given id.

    Parameters

    • id: string
    • txId: string
    • receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>

    Returns StompClientConnection

beginTX

  • Begins a transaction.

    Parameters

    • id: string

    Returns PromiseLike<Frame>

  • Begins a transaction.

    Parameters

    • id: string
    • receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>

    Returns StompClientConnection

  • Begins a transaction.

    Parameters

    • id: string
    • headers: {}
      • [key: string]: string

    Returns PromiseLike<Frame>

  • Begins a transaction.

    Parameters

    • id: string
    • headers: {}
      • [key: string]: string
    • receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>

    Returns StompClientConnection

close

  • close(): void
  • Closes the connection without sending the DISCONNECT frame.

    Returns void

closeHandler

commit

  • Commits a transaction.

    Parameters

    • id: string

    Returns PromiseLike<Frame>

  • Commits a transaction.

    Parameters

    • id: string
    • receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>

    Returns StompClientConnection

  • Commits a transaction.

    Parameters

    • id: string
    • headers: {}
      • [key: string]: string

    Returns PromiseLike<Frame>

  • Commits a transaction.

    Parameters

    • id: string
    • headers: {}
      • [key: string]: string
    • receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>

    Returns StompClientConnection

connectionDroppedHandler

  • Sets a handler notified when the server does not respond to a ping request in time. In other words, this handler is invoked when the heartbeat has detected a connection failure with the server. The handler can decide to reconnect to the server.

    Parameters

    Returns StompClientConnection

disconnect

  • Disconnects the client. Unlike the {@link StompClientConnection#close} method, this method send the DISCONNECT frame to the server.

    Returns PromiseLike<Frame>

  • Disconnects the client. Unlike the {@link StompClientConnection#close} method, this method send the DISCONNECT frame to the server.

    Parameters

    • receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>

    Returns StompClientConnection

  • Disconnects the client. Unlike the {@link StompClientConnection#close} method, this method send the DISCONNECT frame to the server. This method lets you customize the DISCONNECT frame.

    Parameters

    Returns PromiseLike<Frame>

  • Disconnects the client. Unlike the {@link StompClientConnection#close} method, this method send the DISCONNECT frame to the server. This method lets you customize the DISCONNECT frame.

    Parameters

    • frame: Frame
    • receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>

    Returns StompClientConnection

errorHandler

  • Sets a handler notified when an ERROR frame is received by the client. The handler receives the ERROR frame and a reference on the StompClientConnection.

    Parameters

    • handler: ((res: Frame) => void) | Handler<Frame>

    Returns StompClientConnection

exceptionHandler

  • exceptionHandler(exceptionHandler: ((res: Throwable) => void) | Handler<Throwable>): StompClientConnection
  • Configures the exception handler notified upon TCP-level errors.

    Parameters

    • exceptionHandler: ((res: Throwable) => void) | Handler<Throwable>

    Returns StompClientConnection

isConnected

  • isConnected(): boolean
  • Returns whether or not the CONNECTED frame has been receive meaning that the Stomp connection is established.

    Returns boolean

nack

  • Sends a non-acknowledgement for the given message. It means that the message has not been handled by the client. The id parameter is the message id received in the frame.

    Parameters

    • id: string

    Returns PromiseLike<Frame>

  • Sends a non-acknowledgement for the given message. It means that the message has not been handled by the client. The id parameter is the message id received in the frame.

    Parameters

    • id: string
    • receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>

    Returns StompClientConnection

  • Sends a non-acknowledgement for the given frame. It means that the frame has not been handled by the client. The sent non-acknowledgement is part of the transaction identified by the given id.

    Parameters

    • id: string
    • txId: string

    Returns PromiseLike<Frame>

  • Sends a non-acknowledgement for the given frame. It means that the frame has not been handled by the client. The sent non-acknowledgement is part of the transaction identified by the given id.

    Parameters

    • id: string
    • txId: string
    • receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>

    Returns StompClientConnection

pingHandler

  • Sets a handler that let customize the behavior when a ping needs to be sent to the server. Be aware that changing the default behavior may break the compliance with the STOMP specification.

    Parameters

    Returns StompClientConnection

receivedFrameHandler

  • Configures a received handler that get notified when a STOMP frame is received by the client. This handler can be used for logging, debugging or ad-hoc behavior. The frame can still be modified by the handler.

    Unlike {@link StompClient#receivedFrameHandler}, the given handler won't receive the CONNECTED frame. If a received frame handler is set on the StompClient, it will be used by all clients connection, so calling this method is useless, except if you want to use a different handler.

    Parameters

    • handler: ((res: Frame) => void) | Handler<Frame>

    Returns StompClientConnection

send

  • send(headers: {}, body: Buffer): PromiseLike<Frame>
  • send(headers: {}, body: Buffer, receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>): StompClientConnection
  • send(destination: string, body: Buffer): PromiseLike<Frame>
  • send(destination: string, body: Buffer, receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>): StompClientConnection
  • send(frame: Frame): PromiseLike<Frame>
  • send(frame: Frame, receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>): StompClientConnection
  • send(destination: string, headers: {}, body: Buffer): PromiseLike<Frame>
  • send(destination: string, headers: {}, body: Buffer, receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>): StompClientConnection
  • Sends a SEND frame to the server.

    Parameters

    • headers: {}
      • [key: string]: string
    • body: Buffer

    Returns PromiseLike<Frame>

  • Sends a SEND frame to the server.

    Parameters

    • headers: {}
      • [key: string]: string
    • body: Buffer
    • receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>

    Returns StompClientConnection

  • Sends a SEND frame to the server to the given destination. The message does not have any other header.

    Parameters

    • destination: string
    • body: Buffer

    Returns PromiseLike<Frame>

  • Sends a SEND frame to the server to the given destination. The message does not have any other header.

    Parameters

    • destination: string
    • body: Buffer
    • receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>

    Returns StompClientConnection

  • Sends the given frame to the server.

    Parameters

    Returns PromiseLike<Frame>

  • Sends the given frame to the server.

    Parameters

    • frame: Frame
    • receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>

    Returns StompClientConnection

  • Sends a SEND frame to the server to the given destination.

    Parameters

    • destination: string
    • headers: {}
      • [key: string]: string
    • body: Buffer

    Returns PromiseLike<Frame>

  • Sends a SEND frame to the server to the given destination.

    Parameters

    • destination: string
    • headers: {}
      • [key: string]: string
    • body: Buffer
    • receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>

    Returns StompClientConnection

server

  • server(): string
  • Returns string

session

  • session(): string
  • Returns string

subscribe

  • subscribe(destination: string, handler: ((res: Frame) => void) | Handler<Frame>): PromiseLike<string>
  • subscribe(destination: string, handler: ((res: Frame) => void) | Handler<Frame>, receiptHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>): StompClientConnection
  • subscribe(destination: string, headers: {}, handler: ((res: Frame) => void) | Handler<Frame>): PromiseLike<string>
  • subscribe(destination: string, headers: {}, handler: ((res: Frame) => void) | Handler<Frame>, receiptHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>): StompClientConnection
  • Subscribes to the given destination. This destination is used as subscription id.

    Parameters

    • destination: string
    • handler: ((res: Frame) => void) | Handler<Frame>

    Returns PromiseLike<string>

  • Subscribes to the given destination. This destination is used as subscription id.

    Parameters

    • destination: string
    • handler: ((res: Frame) => void) | Handler<Frame>
    • receiptHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>

    Returns StompClientConnection

  • Subscribes to the given destination.

    Parameters

    • destination: string
    • headers: {}
      • [key: string]: string
    • handler: ((res: Frame) => void) | Handler<Frame>

    Returns PromiseLike<string>

  • Subscribes to the given destination.

    Parameters

    • destination: string
    • headers: {}
      • [key: string]: string
    • handler: ((res: Frame) => void) | Handler<Frame>
    • receiptHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>

    Returns StompClientConnection

unsubscribe

  • unsubscribe(destination: string): PromiseLike<Frame>
  • unsubscribe(destination: string, receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>): StompClientConnection
  • unsubscribe(destination: string, headers: {}): PromiseLike<Frame>
  • unsubscribe(destination: string, headers: {}, receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>): StompClientConnection
  • Un-subscribes from the given destination. This method only works if the subscription did not specifies a subscription id (using the id header).

    Parameters

    • destination: string

    Returns PromiseLike<Frame>

  • Un-subscribes from the given destination. This method only works if the subscription did not specifies a subscription id (using the id header).

    Parameters

    • destination: string
    • receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>

    Returns StompClientConnection

  • Un-subscribes from the given destination. This method computes the subscription id as follows. If the given headers contains the id header, the header value is used. Otherwise the destination is used.

    Parameters

    • destination: string
    • headers: {}
      • [key: string]: string

    Returns PromiseLike<Frame>

  • Un-subscribes from the given destination. This method computes the subscription id as follows. If the given headers contains the id header, the header value is used. Otherwise the destination is used.

    Parameters

    • destination: string
    • headers: {}
      • [key: string]: string
    • receiptHandler: ((res: AsyncResult<Frame>) => void) | Handler<AsyncResult<Frame>>

    Returns StompClientConnection

version

  • version(): string
  • Returns string

writingFrameHandler

  • Configures a handler notified when a frame is going to be written on the wire. This handler can be used from logging, debugging. The handler can modify the received frame.

    If a writing frame handler is set on the StompClient, it will be used by all clients connection, so calling this method is useless, except if you want to use a different handler.

    Parameters

    • handler: ((res: Frame) => void) | Handler<Frame>

    Returns StompClientConnection

Generated using TypeDoc