/** * Creates a transfer message sender. 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 IMessageSender instance * @throws InterruptedException if the current thread was interrupted while waiting * @throws ServiceBusException if the sender cannot be created */ public static IMessageSender createTransferMessageSenderFromEntityPath(MessagingFactory messagingFactory, String entityPath, String viaEntityPath) throws InterruptedException, ServiceBusException { return Utils.completeFuture(createTransferMessageSenderFromEntityPathAsync(messagingFactory, entityPath, viaEntityPath)); }