Class MessageSender
- java.lang.Object
-
- com.microsoft.azure.eventhubs.impl.MessageSender
-
- All Implemented Interfaces:
AmqpLink
,AmqpSender
public final class MessageSender extends Object implements AmqpSender
Abstracts all amqp related details translates event-driven reactor model into async send Api
-
-
Field Summary
Fields Modifier and Type Field Description protected ScheduledExecutorService
executor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<Void>
close()
void
closeSync()
static CompletableFuture<MessageSender>
create(MessagingFactory factory, String sendLinkName, String senderPath)
String
getClientId()
ErrorContext
getContext()
protected Exception
getLastKnownError()
int
getMaxMessageSize()
String
getSendPath()
protected CompletableFuture<Void>
onClose()
void
onClose(org.apache.qpid.proton.amqp.transport.ErrorCondition condition, String errorContext)
void
onError(Exception completionException, String failingLinkName)
void
onFlow(int creditIssued)
void
onOpenComplete(Exception completionException)
void
onSendComplete(org.apache.qpid.proton.engine.Delivery delivery)
CompletableFuture<Void>
send(Iterable<org.apache.qpid.proton.message.Message> messages)
CompletableFuture<Void>
send(org.apache.qpid.proton.message.Message msg)
protected void
setClosed()
protected void
throwIfClosed()
-
-
-
Field Detail
-
executor
protected final ScheduledExecutorService executor
-
-
Method Detail
-
create
public static CompletableFuture<MessageSender> create(MessagingFactory factory, String sendLinkName, String senderPath)
-
getSendPath
public String getSendPath()
-
getMaxMessageSize
public int getMaxMessageSize()
-
send
public CompletableFuture<Void> send(Iterable<org.apache.qpid.proton.message.Message> messages)
-
send
public CompletableFuture<Void> send(org.apache.qpid.proton.message.Message msg)
-
onOpenComplete
public void onOpenComplete(Exception completionException)
- Specified by:
onOpenComplete
in interfaceAmqpLink
- Parameters:
completionException
- completionException=null if open is successful
-
onClose
public void onClose(org.apache.qpid.proton.amqp.transport.ErrorCondition condition, String errorContext)
-
onSendComplete
public void onSendComplete(org.apache.qpid.proton.engine.Delivery delivery)
- Specified by:
onSendComplete
in interfaceAmqpSender
-
getContext
public ErrorContext getContext()
-
onFlow
public void onFlow(int creditIssued)
- Specified by:
onFlow
in interfaceAmqpSender
-
onClose
protected CompletableFuture<Void> onClose()
-
getLastKnownError
protected Exception getLastKnownError()
-
getClientId
public String getClientId()
-
setClosed
protected final void setClosed()
-
close
public final CompletableFuture<Void> close()
-
closeSync
public final void closeSync() throws EventHubException
- Throws:
EventHubException
-
throwIfClosed
protected final void throwIfClosed()
-
-