static CompletableFuture<IMessageSender> createMessageSenderFromEntityPathAsync(URI namespaceEndpointURI, String entityPath, MessagingEntityType entityType, ClientSettings clientSettings) { Utils.assertNonNull("namespaceEndpointURI", namespaceEndpointURI); MessageSender sender = new MessageSender(namespaceEndpointURI, entityPath, null, entityType, clientSettings); return sender.initializeAsync().thenApply((v) -> sender); }
static CompletableFuture<IMessageSender> createMessageSenderFromEntityPathAsync(MessagingFactory messagingFactory, String entityPath, MessagingEntityType entityType) { Utils.assertNonNull("messagingFactory", messagingFactory); MessageSender sender = new MessageSender(messagingFactory, entityPath, entityType); return sender.initializeAsync().thenApply((v) -> sender); }
/** * Creates a transfer message sender asynchronously. This sender sends message to destination entity via another entity. * * This is mainly to be used when sending messages in a transaction. * When messages need to be sent across entities in a single transaction, this can be used to ensure * all the messages land initially in the same entity/partition for local transactions, and then * let service bus handle transferring the message to the actual destination. * @param messagingFactory messaging factory (which represents a connection) on which sender needs to be created. * @param entityPath path of the final destination of the message. * @param viaEntityPath The initial destination of the message. * @return a CompletableFuture representing the pending creating of IMessageSender instance. */ public static CompletableFuture<IMessageSender> createTransferMessageSenderFromEntityPathAsync(MessagingFactory messagingFactory, String entityPath, String viaEntityPath) { Utils.assertNonNull("messagingFactory", messagingFactory); MessageSender sender = new MessageSender(messagingFactory, viaEntityPath, entityPath, null); return sender.initializeAsync().thenApply((v) -> sender); }