RequestResponseLink class

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

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)

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 seconds default: 10, then the request will be retried linearly for the provided number of times default: 3 with the provided delay in seconds default: 15 between each attempt.

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<void>

Creates an amqp request/response link.

static function create(connection: Connection, senderOptions: SenderOptions, receiverOptions: ReceiverOptions): 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.

Returns

Promise<RequestResponseLink>

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 seconds default: 10, then the request will be retried linearly for the provided number of times default: 3 with the provided delay in seconds default: 15 between each attempt.

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

Parameters

request
AmqpMessage

The AMQP (request) message.

options
SendRequestOptions

Options that can be provided while sending a request.

Returns

Promise<AmqpMessage>

Promise<Message> The AMQP (response) message.