RequestResponseLink class

Describes an amqp request(sender)-response(receiver) link that is created over an amqp session.

Constructors

RequestResponseLink(Session, Sender, Receiver)

Properties

connection

Provides the underlying amqp connection object.

receiver
sender
session

Methods

close()

Closes the sender, receiver link and the underlying session.

create(Connection, SenderOptions, ReceiverOptions, { abortSignal?: AbortSignalLike })

Creates an amqp request/response link.

isOpen()

Indicates whether the session and the sender and receiver links are all open or closed.

remove()

Removes the sender, receiver link and it's underlying session.

sendRequest(Message, SendRequestOptions)

Sends the given request message and returns the received response. If the operation is not completed in the provided timeout in milliseconds default: 60000, then OperationTimeoutError is thrown.

Constructor Details

new RequestResponseLink(session: Session, sender: Sender, receiver: Receiver)

Parameters

session

Session

The amqp session.

sender

Sender

The amqp sender link.

receiver

Receiver

The amqp receiver link.

Property Details

Provides the underlying amqp connection object.

Connection connection

Property Value

Connection

Connection.

receiver: Receiver

Property Value

Receiver

sender: Sender

Property Value

Sender

session: Session

Property Value

Session

Method Details

Closes the sender, receiver link and the underlying session.

function close(): Promise<void>

Returns

Promise<void>

Promise

Creates an amqp request/response link.

static function create(connection: Connection, senderOptions: SenderOptions, receiverOptions: ReceiverOptions, createOptions?: { abortSignal?: AbortSignalLike }): Promise<RequestResponseLink>

Parameters

connection

Connection

The amqp connection.

senderOptions

SenderOptions

Options that must be provided to create the sender link.

receiverOptions

ReceiverOptions

Options that must be provided to create the receiver link.

createOptions

{ abortSignal?: AbortSignalLike }

Optional parameters that can be used to affect this method's behavior. For example, abortSignal can be passed to allow cancelling an in-progress create invocation.

Returns

Promise

Indicates whether the session and the sender and receiver links are all open or closed.

function isOpen(): boolean

Returns

boolean

boolean - true - open, false - closed.

Removes the sender, receiver link and it's underlying session.

function remove()

Sends the given request message and returns the received response. If the operation is not completed in the provided timeout in milliseconds default: 60000, then OperationTimeoutError is thrown.

function sendRequest(request: Message, options?: SendRequestOptions): Promise<Message>

Parameters

request

Message

The AMQP (request) message.

options
SendRequestOptions

Options that can be provided while sending a request.

Returns

Promise<Message>

Promise The AMQP (response) message.