/** * Accept a {@link IMessageSession} in default {@link ReceiveMode#PEEKLOCK} mode from service bus connection string with specified session id. Session Id can be null, if null, service will return the first available session. * * @param amqpConnectionString connection string * @param sessionId session id, if null, service will return the first available session, otherwise, service will return specified session * @return {@link IMessageSession} instance * @throws InterruptedException if the current thread was interrupted while waiting * @throws ServiceBusException if the session cannot be accepted */ public static IMessageSession acceptSessionFromConnectionString(String amqpConnectionString, String sessionId) throws InterruptedException, ServiceBusException { return acceptSessionFromConnectionString(amqpConnectionString, sessionId, DEFAULTRECEIVEMODE); }
/** * Accept a {@link IMessageSession} in default {@link ReceiveMode#PEEKLOCK} mode asynchronously from service bus connection string with specified session id. Session Id can be null, if null, service will return the first available session. * * @param amqpConnectionString the connection string * @param sessionId session id, if null, service will return the first available session, otherwise, service will return specified session * @return a CompletableFuture representing the pending session accepting */ public static CompletableFuture<IMessageSession> acceptSessionFromConnectionStringAsync(String amqpConnectionString, String sessionId) { return acceptSessionFromConnectionStringAsync(amqpConnectionString, sessionId, DEFAULTRECEIVEMODE); }
/** * Accept a {@link IMessageSession} in default {@link ReceiveMode#PEEKLOCK} mode from service bus connection string builder with specified session id. Session Id can be null, if null, service will return the first available session. * * @param amqpConnectionStringBuilder the connection string builder * @param sessionId session id, if null, service will return the first available session, otherwise, service will return specified session * @return {@link IMessageSession} instance * @throws InterruptedException if the current thread was interrupted while waiting * @throws ServiceBusException if the session cannot be accepted */ public static IMessageSession acceptSessionFromConnectionStringBuilder(ConnectionStringBuilder amqpConnectionStringBuilder, String sessionId) throws InterruptedException, ServiceBusException { return acceptSessionFromConnectionStringBuilder(amqpConnectionStringBuilder, sessionId, DEFAULTRECEIVEMODE); }
/** * Asynchronously accepts a session from service bus using the client settings. 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 * @return a CompletableFuture representing the pending session accepting */ public static CompletableFuture<IMessageSession> acceptSessionFromEntityPathAsync(MessagingFactory messagingFactory, String entityPath, String sessionId) { return acceptSessionFromEntityPathAsync(messagingFactory, entityPath, sessionId, DEFAULTRECEIVEMODE); }
/** * Accept a {@link IMessageSession} in default {@link ReceiveMode#PEEKLOCK} mode asynchronously from service bus connection string builder with specified session id. Session Id can be null, if null, service will return the first available session. * * @param amqpConnectionStringBuilder the connection string builder * @param sessionId session id, if null, service will return the first available session, otherwise, service will return specified session * @return a CompletableFuture representing the pending session accepting */ public static CompletableFuture<IMessageSession> acceptSessionFromConnectionStringBuilderAsync(ConnectionStringBuilder amqpConnectionStringBuilder, String sessionId) { return acceptSessionFromConnectionStringBuilderAsync(amqpConnectionStringBuilder, sessionId, DEFAULTRECEIVEMODE); }
/** * Create {@link IMessageReceiver} in default {@link ReceiveMode#PEEKLOCK} mode asynchronously from ConnectionStringBuilder * * @param amqpConnectionStringBuilder the connection string builder * @return a CompletableFuture representing the pending creating */ public static CompletableFuture<IMessageReceiver> createMessageReceiverFromConnectionStringBuilderAsync(ConnectionStringBuilder amqpConnectionStringBuilder) { return createMessageReceiverFromConnectionStringBuilderAsync(amqpConnectionStringBuilder, DEFAULTRECEIVEMODE); }
/** * Create {@link IMessageReceiver} in default {@link ReceiveMode#PEEKLOCK} mode asynchronously from 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 a CompletableFuture representing the pending creating */ public static CompletableFuture<IMessageReceiver> createMessageReceiverFromConnectionStringAsync(String amqpConnectionString) { return createMessageReceiverFromConnectionStringAsync(amqpConnectionString, DEFAULTRECEIVEMODE); }
/** * 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 * @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) throws InterruptedException, ServiceBusException { return acceptSessionFromEntityPath(messagingFactory, entityPath, sessionId, DEFAULTRECEIVEMODE); }
/** * 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 * @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) throws InterruptedException, ServiceBusException { return createMessageReceiverFromConnectionString(amqpConnectionString, DEFAULTRECEIVEMODE); }
/** * Create {@link IMessageReceiver} in default {@link ReceiveMode#PEEKLOCK} mode from ConnectionStringBuilder * <pre> * IMessageReceiver messageReceiver = ClientFactory.createMessageReceiverFromConnectionStringBuilder(new ConnectionStringBuilder(connectionString, queueName)); * </pre> * * @param amqpConnectionStringBuilder {@link ConnectionStringBuilder} * @return The {@link IMessageReceiver} instance * @throws InterruptedException if the current thread was interrupted while waiting * @throws ServiceBusException if the receiver cannot be created */ public static IMessageReceiver createMessageReceiverFromConnectionStringBuilder(ConnectionStringBuilder amqpConnectionStringBuilder) throws InterruptedException, ServiceBusException { return createMessageReceiverFromConnectionStringBuilder(amqpConnectionStringBuilder, DEFAULTRECEIVEMODE); }
/** * Asynchronously accepts a session from service bus using the client settings. 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 a CompletableFuture representing the pending session accepting */ public static CompletableFuture<IMessageSession> acceptSessionFromEntityPathAsync(MessagingFactory messagingFactory, String entityPath, String sessionId, ReceiveMode receiveMode) { return acceptSessionFromEntityPathAsync(messagingFactory, entityPath, null, sessionId, receiveMode); }
/** * Accept a {@link IMessageSession} from service bus connection string builder with specified session id. Session Id can be null, if null, service will return the first available session. * * @param amqpConnectionStringBuilder the connection string builder * @param sessionId session id, if null, service will return the first available session, otherwise, service will return specified session * @param receiveMode {@link ReceiveMode} PeekLock or ReceiveAndDelete * @return {@link IMessageSession} instance * @throws InterruptedException if the current thread was interrupted while waiting * @throws ServiceBusException if the session cannot be accepted */ public static IMessageSession acceptSessionFromConnectionStringBuilder(ConnectionStringBuilder amqpConnectionStringBuilder, String sessionId, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException { return Utils.completeFuture(acceptSessionFromConnectionStringBuilderAsync(amqpConnectionStringBuilder, sessionId, receiveMode)); }
/** * Create {@link IMessageReceiver} from ConnectionStringBuilder * <pre> * IMessageReceiver messageReceiver = ClientFactory.createMessageReceiverFromConnectionStringBuilder(new ConnectionStringBuilder(connectionString, queueName), ReceiveMode.PEEKLOCK); * </pre> * * @param amqpConnectionStringBuilder {@link ConnectionStringBuilder} * @param receiveMode {@link ReceiveMode} PeekLock or ReceiveAndDelete * @return The {@link IMessageReceiver} instance * @throws InterruptedException if the current thread was interrupted while waiting * @throws ServiceBusException if the receiver cannot be created */ public static IMessageReceiver createMessageReceiverFromConnectionStringBuilder(ConnectionStringBuilder amqpConnectionStringBuilder, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException { return Utils.completeFuture(createMessageReceiverFromConnectionStringBuilderAsync(amqpConnectionStringBuilder, receiveMode)); }
/** * 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)); }
/** * Asynchronously accepts a session in PeekLock mode from service bus using the client settings. Session Id can be null, if null, service will return the first available session. * @param namespaceName namespace of entity * @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 clientSettings client settings * @return a CompletableFuture representing the pending session accepting */ public static CompletableFuture<IMessageSession> acceptSessionFromEntityPathAsync(String namespaceName, String entityPath, String sessionId, ClientSettings clientSettings) { return acceptSessionFromEntityPathAsync(namespaceName, entityPath, sessionId, clientSettings, DEFAULTRECEIVEMODE); }
/** * Accept a {@link IMessageSession} asynchronously from service bus connection string with specified session id. Session Id can be null, if null, service will return the first available session. * * @param amqpConnectionString the connection string * @param sessionId session id, if null, service will return the first available session, otherwise, service will return specified session * @param receiveMode {@link ReceiveMode} PeekLock or ReceiveAndDelete * @return a CompletableFuture representing the pending session accepting */ public static CompletableFuture<IMessageSession> acceptSessionFromConnectionStringAsync(String amqpConnectionString, String sessionId, ReceiveMode receiveMode) { Utils.assertNonNull("amqpConnectionString", amqpConnectionString); return acceptSessionFromConnectionStringBuilderAsync(new ConnectionStringBuilder(amqpConnectionString), sessionId, receiveMode); }
/** * Create {@link IMessageReceiver} in default {@link ReceiveMode#PEEKLOCK} mode asynchronously from 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 a CompletableFuture representing the pending creating */ public static CompletableFuture<IMessageReceiver> createMessageReceiverFromConnectionStringAsync(String amqpConnectionString, ReceiveMode receiveMode) { Utils.assertNonNull("amqpConnectionString", amqpConnectionString); return createMessageReceiverFromConnectionStringBuilderAsync(new ConnectionStringBuilder(amqpConnectionString), receiveMode); }
/** * Accept a {@link IMessageSession} from service bus connection string with specified session id. Session Id can be null, if null, service will return the first available session. * * @param amqpConnectionString connection string * @param sessionId session id, if null, service will return the first available session, otherwise, service will return specified session * @param receiveMode {@link ReceiveMode} PeekLock or ReceiveAndDelete * @return {@link IMessageSession} instance * @throws InterruptedException if the current thread was interrupted while waiting * @throws ServiceBusException if the session cannot be accepted */ public static IMessageSession acceptSessionFromConnectionString(String amqpConnectionString, String sessionId, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException { return Utils.completeFuture(acceptSessionFromConnectionStringAsync(amqpConnectionString, sessionId, receiveMode)); }
/** * Asynchronously accepts a session in PeekLock mode from service bus using the client settings. Session Id can be null, if null, service will return the first available session. * @param namespaceEndpointURI endpoint uri of entity namespace * @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 clientSettings client settings * @return a CompletableFuture representing the pending session accepting */ public static CompletableFuture<IMessageSession> acceptSessionFromEntityPathAsync(URI namespaceEndpointURI, String entityPath, String sessionId, ClientSettings clientSettings) { return acceptSessionFromEntityPathAsync(namespaceEndpointURI, entityPath, sessionId, clientSettings, DEFAULTRECEIVEMODE); }
/** * Accept a {@link IMessageSession} from service bus using the client settings with specified session id in PeekLock mode. Session Id can be null, if null, service will return the first available session. * @param namespaceEndpointURI endpoint uri of entity namespace * @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 clientSettings client settings * @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(URI namespaceEndpointURI, String entityPath, String sessionId, ClientSettings clientSettings) throws InterruptedException, ServiceBusException { return Utils.completeFuture(acceptSessionFromEntityPathAsync(namespaceEndpointURI, entityPath, sessionId, clientSettings)); }