/** * Creates a message sender asynchronously to the entity using the {@link MessagingFactory} * @param messagingFactory messaging factory (which represents a connection) on which sender needs to be created * @param entityPath path of entity * @return a CompletableFuture representing the pending creating of IMessageSender instance */ public static CompletableFuture<IMessageSender> createMessageSenderFromEntityPathAsync(MessagingFactory messagingFactory, String entityPath) { return createMessageSenderFromEntityPathAsync(messagingFactory, entityPath, null); }
/** * Creates a message sender asynchronously to the entity using the client settings. * @param namespaceEndpointURI endpoint uri of entity namespace * @param entityPath path of entity * @param clientSettings client settings * @return a CompletableFuture representing the pending creating of IMessageSender instance */ public static CompletableFuture<IMessageSender> createMessageSenderFromEntityPathAsync(URI namespaceEndpointURI, String entityPath, ClientSettings clientSettings) { return createMessageSenderFromEntityPathAsync(namespaceEndpointURI, entityPath, null, clientSettings); }
/** * Creates a message sender to the entity using the client settings. * @param namespaceName namespace of entity * @param entityPath path of entity * @param clientSettings client settings * @return IMessageSender instance * @throws InterruptedException if the current thread was interrupted while waiting * @throws ServiceBusException if the sender cannot be created */ public static IMessageSender createMessageSenderFromEntityPath(String namespaceName, String entityPath, ClientSettings clientSettings) throws InterruptedException, ServiceBusException { return Utils.completeFuture(createMessageSenderFromEntityPathAsync(namespaceName, entityPath, clientSettings)); }
/** * Creates a message sender to the entity using the client settings. * @param namespaceEndpointURI endpoint uri of entity namespace * @param entityPath path of entity * @param clientSettings client settings * @return IMessageSender instance * @throws InterruptedException if the current thread was interrupted while waiting * @throws ServiceBusException if the sender cannot be created */ public static IMessageSender createMessageSenderFromEntityPath(URI namespaceEndpointURI, String entityPath, ClientSettings clientSettings) throws InterruptedException, ServiceBusException { return Utils.completeFuture(createMessageSenderFromEntityPathAsync(namespaceEndpointURI, entityPath, clientSettings)); }
static IMessageSender createMessageSenderFromEntityPath(MessagingFactory messagingFactory, String entityPath, MessagingEntityType entityType) throws InterruptedException, ServiceBusException { return Utils.completeFuture(createMessageSenderFromEntityPathAsync(messagingFactory, entityPath, entityType)); }
/** * Creates a message sender to the entity. * @param messagingFactory messaging factory (which represents a connection) on which sender needs to be created * @param entityPath path of entity * @return IMessageSender instance * @throws InterruptedException if the current thread was interrupted while waiting * @throws ServiceBusException if the sender cannot be created */ public static IMessageSender createMessageSenderFromEntityPath(MessagingFactory messagingFactory, String entityPath) throws InterruptedException, ServiceBusException { return Utils.completeFuture(createMessageSenderFromEntityPathAsync(messagingFactory, entityPath)); }
static IMessageSender createMessageSenderFromEntityPath(URI namespaceEndpointURI, String entityPath, MessagingEntityType entityType, ClientSettings clientSettings) throws InterruptedException, ServiceBusException { return Utils.completeFuture(createMessageSenderFromEntityPathAsync(namespaceEndpointURI, entityPath, entityType, clientSettings)); }
ClientFactory.createMessageSenderFromEntityPathAsync(this.factory, this.queuePath, MessagingEntityType.QUEUE).handleAsync((sender, ex) ->
/** * Creates a message sender asynchronously to the entity using the client settings. * @param namespaceName namespace name of entity * @param entityPath path of entity * @param clientSettings client settings * @return a CompletableFuture representing the pending creating of IMessageSender instance */ public static CompletableFuture<IMessageSender> createMessageSenderFromEntityPathAsync(String namespaceName, String entityPath, ClientSettings clientSettings) { Utils.assertNonNull("namespaceName", namespaceName); Utils.assertNonNull("entityPath", entityPath); return createMessageSenderFromEntityPathAsync(Util.convertNamespaceToEndPointURI(namespaceName), entityPath, clientSettings); }
/** * Create message sender asynchronously from ConnectionStringBuilder * * @param amqpConnectionStringBuilder the connection string builder * @return a CompletableFuture representing the pending creating of {@link IMessageSender} instance */ public static CompletableFuture<IMessageSender> createMessageSenderFromConnectionStringBuilderAsync(ConnectionStringBuilder amqpConnectionStringBuilder) { Utils.assertNonNull("amqpConnectionStringBuilder", amqpConnectionStringBuilder); return createMessageSenderFromEntityPathAsync(amqpConnectionStringBuilder.getEndpoint(), amqpConnectionStringBuilder.getEntityPath(), Util.getClientSettingsFromConnectionStringBuilder(amqpConnectionStringBuilder)); }
static CompletableFuture<IMessageSender> createMessageSenderFromConnectionStringBuilderAsync(ConnectionStringBuilder amqpConnectionStringBuilder, MessagingEntityType entityType) { Utils.assertNonNull("amqpConnectionStringBuilder", amqpConnectionStringBuilder); return createMessageSenderFromEntityPathAsync(amqpConnectionStringBuilder.getEndpoint(), amqpConnectionStringBuilder.getEntityPath(), entityType, Util.getClientSettingsFromConnectionStringBuilder(amqpConnectionStringBuilder)); }