Interface Sender
- All Superinterfaces:
AutoCloseable
,Link<Sender>
- All Known Implementing Classes:
ClientSender
-
Method Summary
Modifier and TypeMethodDescriptionSend the given message immediately if there is credit available or blocks if the link has not yet been granted credit.Send the given message immediately if there is credit available or blocks if the link has not yet been granted credit.Send the given message if credit is available or returns null if no credit has been granted to the link at the time of the send attempt.Send the given message if credit is available or returns null if no credit has been granted to the link at the time of the send attempt.Methods inherited from interface org.apache.qpid.protonj2.client.Link
address, client, close, close, closeAsync, closeAsync, connection, desiredCapabilities, detach, detach, detachAsync, detachAsync, offeredCapabilities, openFuture, properties, session, source, target
-
Method Details
-
send
Send the given message immediately if there is credit available or blocks if the link has not yet been granted credit.Upon successfully sending the message the methods returns a
Tracker
that can be used to await settlement of the message from the remote. If the sender has been configured to send the message pre-settled then the resulting Tracker will immediately report the message as remotely settlement and accepted.- Parameters:
message
- theMessage
to send.- Returns:
- the
Tracker
for the message delivery - Throws:
ClientException
- if an error occurs while initiating the send operation.
-
send
Send the given message immediately if there is credit available or blocks if the link has not yet been granted credit. The provided delivery annotations are encoded along with the message, the annotations can be passed repeatedly to send calls if sending the same delivery annotations with each message.Upon successfully sending the message the methods returns a
Tracker
that can be used to await settlement of the message from the remote. If the sender has been configured to send the message pre-settled then the resulting Tracker will immediately report the message as remotely settlement and accepted.- Parameters:
message
- theMessage
to send.deliveryAnnotations
- the delivery annotations that should be included in the sentMessage
.- Returns:
- the
Tracker
for the message delivery - Throws:
ClientException
- if an error occurs while initiating the send operation.
-
trySend
Send the given message if credit is available or returns null if no credit has been granted to the link at the time of the send attempt.Upon successfully sending the message the methods returns a
Tracker
that can be used to await settlement of the message from the remote. If the sender has been configured to send the message pre-settled then the resulting Tracker will immediately report the message as remotely settlement and accepted.- Parameters:
message
- theMessage
to send if credit is available.- Returns:
- the
Tracker
for the message delivery or null if no credit for sending. - Throws:
ClientException
- if an error occurs while initiating the send operation.
-
trySend
Send the given message if credit is available or returns null if no credit has been granted to the link at the time of the send attempt. The provided delivery annotations are encoded along with the message, the annotations can be passed repeatedly to send calls if sending the same delivery annotations with each message.Upon successfully sending the message the methods returns a
Tracker
that can be used to await settlement of the message from the remote. If the sender has been configured to send the message pre-settled then the resulting Tracker will immediately report the message as remotely settlement and accepted.- Parameters:
message
- theMessage
to send if credit is available.deliveryAnnotations
- the delivery annotations that should be included in the sentMessage
.- Returns:
- the
Tracker
for the message delivery or null if no credit for sending. - Throws:
ClientException
- if an error occurs while initiating the send operation.
-