RequestResponseLink class
Describes an amqp request(sender)-response(receiver) link that is created over an amqp session.
Constructors
Request |
Properties
connection | Provides the underlying amqp connection object. |
receiver | |
sender | |
session |
Methods
close() | Closes the sender, receiver link and the underlying session. |
create(Connection, Sender |
Creates an amqp request/response link. |
is |
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. |
send |
Sends the given request message and returns the received response. If the operation is not
completed in the provided timeout in milliseconds |
Constructor Details
RequestResponseLink(Session, Sender, Receiver)
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
connection
Provides the underlying amqp connection object.
Connection connection
Property Value
Connection
Connection.
receiver
receiver: Receiver
Property Value
Receiver
sender
sender: Sender
Property Value
Sender
session
session: Session
Property Value
Session
Method Details
close()
Closes the sender, receiver link and the underlying session.
function close(): Promise<void>
Returns
Promise<void>
Promise
create(Connection, SenderOptions, ReceiverOptions, { abortSignal?: AbortSignalLike })
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<RequestResponseLink>
Promise
isOpen()
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
.
remove()
Removes the sender, receiver link and it's underlying session.
function remove()
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.
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.