/** * 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)); }
/** * Creates a message receiver to the entity using the client settings in PeekLock mode * @param namespaceName namespace of entity * @param entityPath path of the entity * @param clientSettings client settings * @return IMessageReceiver instance * @throws InterruptedException if the current thread was interrupted while waiting * @throws ServiceBusException if the receiver cannot be created */ public static IMessageReceiver createMessageReceiverFromEntityPath(String namespaceName, String entityPath, ClientSettings clientSettings) throws InterruptedException, ServiceBusException { return Utils.completeFuture(createMessageReceiverFromEntityPathAsync(namespaceName, entityPath, clientSettings)); }
/** * Retrieves the list of topics present in the namespace. * @return the first 100 topics. * @throws TimeoutException - The operation times out. The timeout period is initiated through ClientSettings.operationTimeout * @throws AuthorizationFailedException - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details. * @throws ServerBusyException - The server is busy. You should wait before you retry the operation. * @throws ServiceBusException - An internal error or an unexpected exception occured. */ public List<TopicDescription> getTopics() throws ServiceBusException, InterruptedException { return Utils.completeFuture(this.asyncClient.getTopicsAsync()); }
/** * Creates a message receiver to the entity using the client settings in PeekLock mode * @param namespaceEndpointURI endpoint uri of entity namespace * @param entityPath path of the entity * @param clientSettings client settings * @return IMessageReceiver instance * @throws InterruptedException if the current thread was interrupted while waiting * @throws ServiceBusException if the receiver cannot be created */ public static IMessageReceiver createMessageReceiverFromEntityPath(URI namespaceEndpointURI, String entityPath, ClientSettings clientSettings) throws InterruptedException, ServiceBusException { return Utils.completeFuture(createMessageReceiverFromEntityPathAsync(namespaceEndpointURI, entityPath, clientSettings)); }
/** * Creates a message receiver to the entity. * @param messagingFactory messaging factory (which represents a connection) on which receiver needs to be created * @param entityPath path of the entity * @param receiveMode PeekLock or ReceiveAndDelete * @return IMessageReceiver instance * @throws InterruptedException if the current thread was interrupted while waiting * @throws ServiceBusException if the receiver cannot be created */ public static IMessageReceiver createMessageReceiverFromEntityPath(MessagingFactory messagingFactory, String entityPath, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException { return Utils.completeFuture(createMessageReceiverFromEntityPathAsync(messagingFactory, entityPath, receiveMode)); }
QueueClient(MessagingFactory factory, String queuePath, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException { this(receiveMode, queuePath); Utils.completeFuture(this.createInternals(factory, queuePath, receiveMode)); if (TRACE_LOGGER.isInfoEnabled()) { TRACE_LOGGER.info("Created queue client to queue '{}'", queuePath); } }
/** * Retrieves the list of queues present in the namespace. * @return the first 100 queues. * @throws TimeoutException - The operation times out. The timeout period is initiated through ClientSettings.operationTimeout * @throws AuthorizationFailedException - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details. * @throws ServerBusyException - The server is busy. You should wait before you retry the operation. * @throws ServiceBusException - An internal error or an unexpected exception occured. */ public List<QueueDescription> getQueues() throws ServiceBusException, InterruptedException { return Utils.completeFuture(this.asyncClient.getQueuesAsync()); }
/** * Retrieves the list of rules for a given topic-subscription in the namespace. * @return the first 100 rules. * @throws TimeoutException - The operation times out. The timeout period is initiated through ClientSettings.operationTimeout * @throws AuthorizationFailedException - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details. * @throws ServerBusyException - The server is busy. You should wait before you retry the operation. * @throws ServiceBusException - An internal error or an unexpected exception occured. */ public List<RuleDescription> getRules(String topicName, String subscriptionName) throws ServiceBusException, InterruptedException { return Utils.completeFuture(this.asyncClient.getRulesAsync(topicName, subscriptionName)); }
/** * 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)); }
/** * Create {@link IMessageReceiver} in default {@link ReceiveMode#PEEKLOCK} mode from service bus connection string with <a href="https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-sas">Shared Access Signatures</a> * * @param amqpConnectionString the connection string * @param receiveMode {@link ReceiveMode} PeekLock or ReceiveAndDelete * @return {@link IMessageReceiver} instance * @throws InterruptedException if the current thread was interrupted while waiting * @throws ServiceBusException if the receiver cannot be created */ public static IMessageReceiver createMessageReceiverFromConnectionString(String amqpConnectionString, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException { return Utils.completeFuture(createMessageReceiverFromConnectionStringAsync(amqpConnectionString, receiveMode)); }
/** * Starts a new service side transaction. The {@link TransactionContext} should be passed to all operations that * needs to be in this transaction. * @return a new transaction * @throws ServiceBusException if transaction fails to start * @throws InterruptedException if the current thread was interrupted while waiting */ public TransactionContext startTransaction() throws ServiceBusException, InterruptedException { return Utils.completeFuture(this.startTransactionAsync()); }
/** * Create message sender from service bus connection string with <a href="https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-sas">Shared Access Signatures</a> * * @param amqpConnectionString the connection string * @return {@link IMessageSender} instance * @throws InterruptedException if the current thread was interrupted while waiting * @throws ServiceBusException if the sender cannot be created */ public static IMessageSender createMessageSenderFromConnectionString(String amqpConnectionString) throws InterruptedException, ServiceBusException { return Utils.completeFuture(createMessageSenderFromConnectionStringAsync(amqpConnectionString)); }
/** * Creates a message receiver to the entity using the client settings. * @param namespaceName namespace of entity * @param entityPath path of the entity * @param clientSettings client settings * @param receiveMode PeekLock or ReceiveAndDelete * @return IMessageReceiver instance * @throws InterruptedException if the current thread was interrupted while waiting * @throws ServiceBusException if the receiver cannot be created */ public static IMessageReceiver createMessageReceiverFromEntityPath(String namespaceName, String entityPath, ClientSettings clientSettings, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException { return Utils.completeFuture(createMessageReceiverFromEntityPathAsync(namespaceName, entityPath, clientSettings, receiveMode)); }
/** * Accept a {@link IMessageSession} from service bus using the client settings with specified session id. Session Id can be null, if null, service will return the first available session. * @param messagingFactory messaging factory (which represents a connection) on which the session receiver needs to be created. * @param entityPath path of entity * @param sessionId session id, if null, service will return the first available session, otherwise, service will return specified session * @param receiveMode PeekLock or ReceiveAndDelete * @return IMessageSession instance * @throws InterruptedException if the current thread was interrupted while waiting * @throws ServiceBusException if the session cannot be accepted */ public static IMessageSession acceptSessionFromEntityPath(MessagingFactory messagingFactory, String entityPath, String sessionId, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException { return Utils.completeFuture(acceptSessionFromEntityPathAsync(messagingFactory, entityPath, sessionId, receiveMode)); }
@Override public void sendBatch(Collection<? extends IMessage> messages) throws InterruptedException, ServiceBusException { Utils.completeFuture(this.sendBatchAsync(messages)); }
@Override public void cancelScheduledMessage(long sequenceNumber) throws InterruptedException, ServiceBusException { Utils.completeFuture(this.cancelScheduledMessageAsync(sequenceNumber)); }
public QueueClient(URI namespaceEndpointURI, String queuePath, ClientSettings clientSettings, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException { this(receiveMode, queuePath); CompletableFuture<MessagingFactory> factoryFuture = MessagingFactory.createFromNamespaceEndpointURIAsyc(namespaceEndpointURI, clientSettings); Utils.completeFuture(factoryFuture.thenComposeAsync((f) -> this.createInternals(f, queuePath, receiveMode), MessagingFactory.INTERNAL_THREAD_POOL)); if (TRACE_LOGGER.isInfoEnabled()) { TRACE_LOGGER.info("Created queue client to queue '{}/{}'", namespaceEndpointURI.toString(), queuePath); } }
public SubscriptionClient(ConnectionStringBuilder amqpConnectionStringBuilder, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException { this(receiveMode, amqpConnectionStringBuilder.getEntityPath()); CompletableFuture<MessagingFactory> factoryFuture = MessagingFactory.createFromConnectionStringBuilderAsync(amqpConnectionStringBuilder); Utils.completeFuture(factoryFuture.thenComposeAsync((f) -> this.createPumpAndBrowserAsync(f), MessagingFactory.INTERNAL_THREAD_POOL)); if(TRACE_LOGGER.isInfoEnabled()) { TRACE_LOGGER.info("Created subscription client to connection string '{}'", amqpConnectionStringBuilder.toLoggableString()); } }
public QueueClient(ConnectionStringBuilder amqpConnectionStringBuilder, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException { this(receiveMode, amqpConnectionStringBuilder.getEntityPath()); CompletableFuture<MessagingFactory> factoryFuture = MessagingFactory.createFromConnectionStringBuilderAsync(amqpConnectionStringBuilder); Utils.completeFuture(factoryFuture.thenComposeAsync((f) -> this.createInternals(f, amqpConnectionStringBuilder.getEntityPath(), receiveMode), MessagingFactory.INTERNAL_THREAD_POOL)); if (TRACE_LOGGER.isInfoEnabled()) { TRACE_LOGGER.info("Created queue client to connection string '{}'", amqpConnectionStringBuilder.toLoggableString()); } }