Class ClientFactory


  • public final class ClientFactory
    extends Object
    Utility class for creating message senders and receivers.
    • Method Detail

      • createMessageSenderFromConnectionStringBuilder

        public static IMessageSender createMessageSenderFromConnectionStringBuilder​(ConnectionStringBuilder amqpConnectionStringBuilder)
                                                                             throws InterruptedException,
                                                                                    ServiceBusException
        Create message sender from ConnectionStringBuilder
             IMessageSender messageSender = ClientFactory.createMessageSenderFromConnectionStringBuilder(new ConnectionStringBuilder(connectionString, queueName));
         
        Parameters:
        amqpConnectionStringBuilder - the connection string builder
        Returns:
        IMessageSender instance
        Throws:
        InterruptedException - if the current thread was interrupted while waiting
        ServiceBusException - if the sender cannot be created
      • createMessageSenderFromEntityPath

        public static IMessageSender createMessageSenderFromEntityPath​(URI namespaceEndpointURI,
                                                                       String entityPath,
                                                                       ClientSettings clientSettings)
                                                                throws InterruptedException,
                                                                       ServiceBusException
        Creates a message sender to the entity using the client settings.
        Parameters:
        namespaceEndpointURI - endpoint uri of entity namespace
        entityPath - path of entity
        clientSettings - client settings
        Returns:
        IMessageSender instance
        Throws:
        InterruptedException - if the current thread was interrupted while waiting
        ServiceBusException - if the sender cannot be created
      • createTransferMessageSenderFromEntityPath

        public static IMessageSender createTransferMessageSenderFromEntityPath​(MessagingFactory messagingFactory,
                                                                               String entityPath,
                                                                               String viaEntityPath)
                                                                        throws InterruptedException,
                                                                               ServiceBusException
        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.
        Parameters:
        messagingFactory - messaging factory (which represents a connection) on which sender needs to be created.
        entityPath - path of the final destination of the message.
        viaEntityPath - The initial destination of the message.
        Returns:
        IMessageSender instance
        Throws:
        InterruptedException - if the current thread was interrupted while waiting
        ServiceBusException - if the sender cannot be created
      • createMessageSenderFromConnectionStringAsync

        public static CompletableFuture<IMessageSender> createMessageSenderFromConnectionStringAsync​(String amqpConnectionString)
        Create message sender asynchronously from connection string with Shared Access Signatures
        Parameters:
        amqpConnectionString - the connection string
        Returns:
        a CompletableFuture representing the pending creating of IMessageSender instance
      • createMessageSenderFromConnectionStringBuilderAsync

        public static CompletableFuture<IMessageSender> createMessageSenderFromConnectionStringBuilderAsync​(ConnectionStringBuilder amqpConnectionStringBuilder)
        Create message sender asynchronously from ConnectionStringBuilder
        Parameters:
        amqpConnectionStringBuilder - the connection string builder
        Returns:
        a CompletableFuture representing the pending creating of IMessageSender instance
      • createMessageSenderFromEntityPathAsync

        public static CompletableFuture<IMessageSender> createMessageSenderFromEntityPathAsync​(String namespaceName,
                                                                                               String entityPath,
                                                                                               ClientSettings clientSettings)
        Creates a message sender asynchronously to the entity using the client settings.
        Parameters:
        namespaceName - namespace name of entity
        entityPath - path of entity
        clientSettings - client settings
        Returns:
        a CompletableFuture representing the pending creating of IMessageSender instance
      • createMessageSenderFromEntityPathAsync

        public static CompletableFuture<IMessageSender> createMessageSenderFromEntityPathAsync​(URI namespaceEndpointURI,
                                                                                               String entityPath,
                                                                                               ClientSettings clientSettings)
        Creates a message sender asynchronously to the entity using the client settings.
        Parameters:
        namespaceEndpointURI - endpoint uri of entity namespace
        entityPath - path of entity
        clientSettings - client settings
        Returns:
        a CompletableFuture representing the pending creating of IMessageSender instance
      • createMessageSenderFromEntityPathAsync

        public static CompletableFuture<IMessageSender> createMessageSenderFromEntityPathAsync​(MessagingFactory messagingFactory,
                                                                                               String entityPath)
        Creates a message sender asynchronously to the entity using the MessagingFactory
        Parameters:
        messagingFactory - messaging factory (which represents a connection) on which sender needs to be created
        entityPath - path of entity
        Returns:
        a CompletableFuture representing the pending creating of IMessageSender instance
      • createTransferMessageSenderFromEntityPathAsync

        public static CompletableFuture<IMessageSender> createTransferMessageSenderFromEntityPathAsync​(MessagingFactory messagingFactory,
                                                                                                       String entityPath,
                                                                                                       String viaEntityPath)
        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.
        Parameters:
        messagingFactory - messaging factory (which represents a connection) on which sender needs to be created.
        entityPath - path of the final destination of the message.
        viaEntityPath - The initial destination of the message.
        Returns:
        a CompletableFuture representing the pending creating of IMessageSender instance.
      • createMessageReceiverFromEntityPath

        public static IMessageReceiver createMessageReceiverFromEntityPath​(String namespaceName,
                                                                           String entityPath,
                                                                           ClientSettings clientSettings)
                                                                    throws InterruptedException,
                                                                           ServiceBusException
        Creates a message receiver to the entity using the client settings in PeekLock mode
        Parameters:
        namespaceName - namespace of entity
        entityPath - path of the entity
        clientSettings - client settings
        Returns:
        IMessageReceiver instance
        Throws:
        InterruptedException - if the current thread was interrupted while waiting
        ServiceBusException - if the receiver cannot be created
      • createMessageReceiverFromEntityPath

        public static IMessageReceiver createMessageReceiverFromEntityPath​(String namespaceName,
                                                                           String entityPath,
                                                                           ClientSettings clientSettings,
                                                                           ReceiveMode receiveMode)
                                                                    throws InterruptedException,
                                                                           ServiceBusException
        Creates a message receiver to the entity using the client settings.
        Parameters:
        namespaceName - namespace of entity
        entityPath - path of the entity
        clientSettings - client settings
        receiveMode - PeekLock or ReceiveAndDelete
        Returns:
        IMessageReceiver instance
        Throws:
        InterruptedException - if the current thread was interrupted while waiting
        ServiceBusException - if the receiver cannot be created
      • createMessageReceiverFromEntityPath

        public static IMessageReceiver createMessageReceiverFromEntityPath​(URI namespaceEndpointURI,
                                                                           String entityPath,
                                                                           ClientSettings clientSettings)
                                                                    throws InterruptedException,
                                                                           ServiceBusException
        Creates a message receiver to the entity using the client settings in PeekLock mode
        Parameters:
        namespaceEndpointURI - endpoint uri of entity namespace
        entityPath - path of the entity
        clientSettings - client settings
        Returns:
        IMessageReceiver instance
        Throws:
        InterruptedException - if the current thread was interrupted while waiting
        ServiceBusException - if the receiver cannot be created
      • createMessageReceiverFromEntityPath

        public static IMessageReceiver createMessageReceiverFromEntityPath​(URI namespaceEndpointURI,
                                                                           String entityPath,
                                                                           ClientSettings clientSettings,
                                                                           ReceiveMode receiveMode)
                                                                    throws InterruptedException,
                                                                           ServiceBusException
        Creates a message receiver to the entity using the client settings.
        Parameters:
        namespaceEndpointURI - endpoint uri of entity namespace
        entityPath - path of the entity
        clientSettings - client settings
        receiveMode - PeekLock or ReceiveAndDelete
        Returns:
        IMessageReceiver instance
        Throws:
        InterruptedException - if the current thread was interrupted while waiting
        ServiceBusException - if the receiver cannot be created
      • createMessageReceiverFromEntityPath

        public static IMessageReceiver createMessageReceiverFromEntityPath​(MessagingFactory messagingFactory,
                                                                           String entityPath)
                                                                    throws InterruptedException,
                                                                           ServiceBusException
        Creates a message receiver to the entity.
        Parameters:
        messagingFactory - messaging factory (which represents a connection) on which receiver needs to be created
        entityPath - path of the entity
        Returns:
        IMessageReceiver instance
        Throws:
        InterruptedException - if the current thread was interrupted while waiting
        ServiceBusException - if the receiver cannot be created
      • createMessageReceiverFromEntityPath

        public static IMessageReceiver createMessageReceiverFromEntityPath​(MessagingFactory messagingFactory,
                                                                           String entityPath,
                                                                           ReceiveMode receiveMode)
                                                                    throws InterruptedException,
                                                                           ServiceBusException
        Creates a message receiver to the entity.
        Parameters:
        messagingFactory - messaging factory (which represents a connection) on which receiver needs to be created
        entityPath - path of the entity
        receiveMode - PeekLock or ReceiveAndDelete
        Returns:
        IMessageReceiver instance
        Throws:
        InterruptedException - if the current thread was interrupted while waiting
        ServiceBusException - if the receiver cannot be created
      • createMessageReceiverFromConnectionStringBuilderAsync

        public static CompletableFuture<IMessageReceiver> createMessageReceiverFromConnectionStringBuilderAsync​(ConnectionStringBuilder amqpConnectionStringBuilder,
                                                                                                                ReceiveMode receiveMode)
        Create IMessageReceiver asynchronously from ConnectionStringBuilder
        Parameters:
        amqpConnectionStringBuilder - the connection string builder
        receiveMode - ReceiveMode PeekLock or ReceiveAndDelete
        Returns:
        a CompletableFuture representing the pending creating
      • createMessageReceiverFromEntityPathAsync

        public static CompletableFuture<IMessageReceiver> createMessageReceiverFromEntityPathAsync​(String namespaceName,
                                                                                                   String entityPath,
                                                                                                   ClientSettings clientSettings)
        Asynchronously creates a message receiver to the entity using the client settings in PeekLock mode
        Parameters:
        namespaceName - namespace of entity
        entityPath - path of entity
        clientSettings - client settings
        Returns:
        a CompletableFuture representing the pending creation of message receiver
      • createMessageReceiverFromEntityPathAsync

        public static CompletableFuture<IMessageReceiver> createMessageReceiverFromEntityPathAsync​(String namespaceName,
                                                                                                   String entityPath,
                                                                                                   ClientSettings clientSettings,
                                                                                                   ReceiveMode receiveMode)
        Asynchronously creates a message receiver to the entity using the client settings
        Parameters:
        namespaceName - namespace of entity
        entityPath - path of entity
        clientSettings - client settings
        receiveMode - PeekLock or ReceiveAndDelete
        Returns:
        a CompletableFuture representing the pending creation of message receiver
      • createMessageReceiverFromEntityPathAsync

        public static CompletableFuture<IMessageReceiver> createMessageReceiverFromEntityPathAsync​(URI namespaceEndpointURI,
                                                                                                   String entityPath,
                                                                                                   ClientSettings clientSettings)
        Asynchronously creates a message receiver to the entity using the client settings in PeekLock mode
        Parameters:
        namespaceEndpointURI - endpoint uri of entity namespace
        entityPath - path of entity
        clientSettings - client settings
        Returns:
        a CompletableFuture representing the pending creation of message receiver
      • createMessageReceiverFromEntityPathAsync

        public static CompletableFuture<IMessageReceiver> createMessageReceiverFromEntityPathAsync​(URI namespaceEndpointURI,
                                                                                                   String entityPath,
                                                                                                   ClientSettings clientSettings,
                                                                                                   ReceiveMode receiveMode)
        Asynchronously creates a message receiver to the entity using the client settings
        Parameters:
        namespaceEndpointURI - endpoint uri of entity namespace
        entityPath - path of entity
        clientSettings - client settings
        receiveMode - PeekLock or ReceiveAndDelete
        Returns:
        a CompletableFuture representing the pending creation of message receiver
      • createMessageReceiverFromEntityPathAsync

        public static CompletableFuture<IMessageReceiver> createMessageReceiverFromEntityPathAsync​(MessagingFactory messagingFactory,
                                                                                                   String entityPath)
        Asynchronously creates a new message receiver to the entity on the messagingFactory.
        Parameters:
        messagingFactory - messaging factory (which represents a connection) on which receiver needs to be created.
        entityPath - path of entity
        Returns:
        a CompletableFuture representing the pending creation of message receiver
      • createMessageReceiverFromEntityPathAsync

        public static CompletableFuture<IMessageReceiver> createMessageReceiverFromEntityPathAsync​(MessagingFactory messagingFactory,
                                                                                                   String entityPath,
                                                                                                   ReceiveMode receiveMode)
        Asynchronously creates a new message receiver to the entity on the messagingFactory.
        Parameters:
        messagingFactory - messaging factory (which represents a connection) on which receiver needs to be created.
        entityPath - path of entity
        receiveMode - PeekLock or ReceiveAndDelete
        Returns:
        a CompletableFuture representing the pending creation of message receiver
      • acceptSessionFromConnectionString

        public static IMessageSession acceptSessionFromConnectionString​(String amqpConnectionString,
                                                                        String sessionId,
                                                                        ReceiveMode receiveMode)
                                                                 throws InterruptedException,
                                                                        ServiceBusException
        Accept a IMessageSession from service bus connection string with specified session id. Session Id can be null, if null, service will return the first available session.
        Parameters:
        amqpConnectionString - connection string
        sessionId - session id, if null, service will return the first available session, otherwise, service will return specified session
        receiveMode - ReceiveMode PeekLock or ReceiveAndDelete
        Returns:
        IMessageSession instance
        Throws:
        InterruptedException - if the current thread was interrupted while waiting
        ServiceBusException - if the session cannot be accepted
      • acceptSessionFromConnectionStringBuilder

        public static IMessageSession acceptSessionFromConnectionStringBuilder​(ConnectionStringBuilder amqpConnectionStringBuilder,
                                                                               String sessionId,
                                                                               ReceiveMode receiveMode)
                                                                        throws InterruptedException,
                                                                               ServiceBusException
        Accept a 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.
        Parameters:
        amqpConnectionStringBuilder - the connection string builder
        sessionId - session id, if null, service will return the first available session, otherwise, service will return specified session
        receiveMode - ReceiveMode PeekLock or ReceiveAndDelete
        Returns:
        IMessageSession instance
        Throws:
        InterruptedException - if the current thread was interrupted while waiting
        ServiceBusException - if the session cannot be accepted
      • acceptSessionFromEntityPath

        public static IMessageSession acceptSessionFromEntityPath​(String namespaceName,
                                                                  String entityPath,
                                                                  String sessionId,
                                                                  ClientSettings clientSettings)
                                                           throws InterruptedException,
                                                                  ServiceBusException
        Accept a 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.
        Parameters:
        namespaceName - namespace of entity
        entityPath - path of entity
        sessionId - session id, if null, service will return the first available session, otherwise, service will return specified session
        clientSettings - client settings
        Returns:
        IMessageSession instance
        Throws:
        InterruptedException - if the current thread was interrupted while waiting
        ServiceBusException - if the session cannot be accepted
      • acceptSessionFromEntityPath

        public static IMessageSession acceptSessionFromEntityPath​(String namespaceName,
                                                                  String entityPath,
                                                                  String sessionId,
                                                                  ClientSettings clientSettings,
                                                                  ReceiveMode receiveMode)
                                                           throws InterruptedException,
                                                                  ServiceBusException
        Accept a 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.
        Parameters:
        namespaceName - namespace of entity
        entityPath - path of entity
        sessionId - session id, if null, service will return the first available session, otherwise, service will return specified session
        clientSettings - client settings
        receiveMode - PeekLock or ReceiveAndDelete
        Returns:
        IMessageSession instance
        Throws:
        InterruptedException - if the current thread was interrupted while waiting
        ServiceBusException - if the session cannot be accepted
      • acceptSessionFromEntityPath

        public static IMessageSession acceptSessionFromEntityPath​(URI namespaceEndpointURI,
                                                                  String entityPath,
                                                                  String sessionId,
                                                                  ClientSettings clientSettings)
                                                           throws InterruptedException,
                                                                  ServiceBusException
        Accept a 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.
        Parameters:
        namespaceEndpointURI - endpoint uri of entity namespace
        entityPath - path of entity
        sessionId - session id, if null, service will return the first available session, otherwise, service will return specified session
        clientSettings - client settings
        Returns:
        IMessageSession instance
        Throws:
        InterruptedException - if the current thread was interrupted while waiting
        ServiceBusException - if the session cannot be accepted
      • acceptSessionFromEntityPath

        public static IMessageSession acceptSessionFromEntityPath​(URI namespaceEndpointURI,
                                                                  String entityPath,
                                                                  String sessionId,
                                                                  ClientSettings clientSettings,
                                                                  ReceiveMode receiveMode)
                                                           throws InterruptedException,
                                                                  ServiceBusException
        Accept a 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.
        Parameters:
        namespaceEndpointURI - endpoint uri of entity namespace
        entityPath - path of entity
        sessionId - session id, if null, service will return the first available session, otherwise, service will return specified session
        clientSettings - client settings
        receiveMode - PeekLock or ReceiveAndDelete
        Returns:
        IMessageSession instance
        Throws:
        InterruptedException - if the current thread was interrupted while waiting
        ServiceBusException - if the session cannot be accepted
      • acceptSessionFromEntityPath

        public static IMessageSession acceptSessionFromEntityPath​(MessagingFactory messagingFactory,
                                                                  String entityPath,
                                                                  String sessionId)
                                                           throws InterruptedException,
                                                                  ServiceBusException
        Accept a 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.
        Parameters:
        messagingFactory - messaging factory (which represents a connection) on which the session receiver needs to be created.
        entityPath - path of entity
        sessionId - session id, if null, service will return the first available session, otherwise, service will return specified session
        Returns:
        IMessageSession instance
        Throws:
        InterruptedException - if the current thread was interrupted while waiting
        ServiceBusException - if the session cannot be accepted
      • acceptSessionFromEntityPath

        public static IMessageSession acceptSessionFromEntityPath​(MessagingFactory messagingFactory,
                                                                  String entityPath,
                                                                  String sessionId,
                                                                  ReceiveMode receiveMode)
                                                           throws InterruptedException,
                                                                  ServiceBusException
        Accept a 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.
        Parameters:
        messagingFactory - messaging factory (which represents a connection) on which the session receiver needs to be created.
        entityPath - path of entity
        sessionId - session id, if null, service will return the first available session, otherwise, service will return specified session
        receiveMode - PeekLock or ReceiveAndDelete
        Returns:
        IMessageSession instance
        Throws:
        InterruptedException - if the current thread was interrupted while waiting
        ServiceBusException - if the session cannot be accepted
      • acceptSessionFromConnectionStringAsync

        public static CompletableFuture<IMessageSession> acceptSessionFromConnectionStringAsync​(String amqpConnectionString,
                                                                                                String sessionId)
        Accept a IMessageSession in default 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.
        Parameters:
        amqpConnectionString - the connection string
        sessionId - session id, if null, service will return the first available session, otherwise, service will return specified session
        Returns:
        a CompletableFuture representing the pending session accepting
      • acceptSessionFromConnectionStringAsync

        public static CompletableFuture<IMessageSession> acceptSessionFromConnectionStringAsync​(String amqpConnectionString,
                                                                                                String sessionId,
                                                                                                ReceiveMode receiveMode)
        Accept a 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.
        Parameters:
        amqpConnectionString - the connection string
        sessionId - session id, if null, service will return the first available session, otherwise, service will return specified session
        receiveMode - ReceiveMode PeekLock or ReceiveAndDelete
        Returns:
        a CompletableFuture representing the pending session accepting
      • acceptSessionFromConnectionStringBuilderAsync

        public static CompletableFuture<IMessageSession> acceptSessionFromConnectionStringBuilderAsync​(ConnectionStringBuilder amqpConnectionStringBuilder,
                                                                                                       String sessionId)
        Accept a IMessageSession in default 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.
        Parameters:
        amqpConnectionStringBuilder - the connection string builder
        sessionId - session id, if null, service will return the first available session, otherwise, service will return specified session
        Returns:
        a CompletableFuture representing the pending session accepting
      • acceptSessionFromConnectionStringBuilderAsync

        public static CompletableFuture<IMessageSession> acceptSessionFromConnectionStringBuilderAsync​(ConnectionStringBuilder amqpConnectionStringBuilder,
                                                                                                       String sessionId,
                                                                                                       ReceiveMode receiveMode)
        Accept a IMessageSession 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.
        Parameters:
        amqpConnectionStringBuilder - connection string builder
        sessionId - session id, if null, service will return the first available session, otherwise, service will return specified session
        receiveMode - ReceiveMode PeekLock or ReceiveAndDelete
        Returns:
        a CompletableFuture representing the pending session accepting
      • acceptSessionFromEntityPathAsync

        public static CompletableFuture<IMessageSession> acceptSessionFromEntityPathAsync​(String namespaceName,
                                                                                          String entityPath,
                                                                                          String sessionId,
                                                                                          ClientSettings clientSettings)
        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.
        Parameters:
        namespaceName - namespace of entity
        entityPath - path of entity
        sessionId - session id, if null, service will return the first available session, otherwise, service will return specified session
        clientSettings - client settings
        Returns:
        a CompletableFuture representing the pending session accepting
      • acceptSessionFromEntityPathAsync

        public static CompletableFuture<IMessageSession> acceptSessionFromEntityPathAsync​(String namespaceName,
                                                                                          String entityPath,
                                                                                          String sessionId,
                                                                                          ClientSettings clientSettings,
                                                                                          ReceiveMode receiveMode)
        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.
        Parameters:
        namespaceName - namespace of entity
        entityPath - path of entity
        sessionId - session id, if null, service will return the first available session, otherwise, service will return specified session
        clientSettings - client settings
        receiveMode - PeekLock or ReceiveAndDelete
        Returns:
        a CompletableFuture representing the pending session accepting
      • acceptSessionFromEntityPathAsync

        public static CompletableFuture<IMessageSession> acceptSessionFromEntityPathAsync​(URI namespaceEndpointURI,
                                                                                          String entityPath,
                                                                                          String sessionId,
                                                                                          ClientSettings clientSettings)
        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.
        Parameters:
        namespaceEndpointURI - endpoint uri of entity namespace
        entityPath - path of entity
        sessionId - session id, if null, service will return the first available session, otherwise, service will return specified session
        clientSettings - client settings
        Returns:
        a CompletableFuture representing the pending session accepting
      • acceptSessionFromEntityPathAsync

        public static CompletableFuture<IMessageSession> acceptSessionFromEntityPathAsync​(URI namespaceEndpointURI,
                                                                                          String entityPath,
                                                                                          String sessionId,
                                                                                          ClientSettings clientSettings,
                                                                                          ReceiveMode receiveMode)
        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.
        Parameters:
        namespaceEndpointURI - endpoint uri of entity namespace
        entityPath - path of entity
        sessionId - session id, if null, service will return the first available session, otherwise, service will return specified session
        clientSettings - client settings
        receiveMode - PeekLock or ReceiveAndDelete
        Returns:
        a CompletableFuture representing the pending session accepting
      • acceptSessionFromEntityPathAsync

        public static CompletableFuture<IMessageSession> acceptSessionFromEntityPathAsync​(MessagingFactory messagingFactory,
                                                                                          String entityPath,
                                                                                          String sessionId)
        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.
        Parameters:
        messagingFactory - messaging factory (which represents a connection) on which the session receiver needs to be created.
        entityPath - path of entity
        sessionId - session id, if null, service will return the first available session, otherwise, service will return specified session
        Returns:
        a CompletableFuture representing the pending session accepting
      • acceptSessionFromEntityPathAsync

        public static CompletableFuture<IMessageSession> acceptSessionFromEntityPathAsync​(MessagingFactory messagingFactory,
                                                                                          String entityPath,
                                                                                          String sessionId,
                                                                                          ReceiveMode receiveMode)
        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.
        Parameters:
        messagingFactory - messaging factory (which represents a connection) on which the session receiver needs to be created.
        entityPath - path of entity
        sessionId - session id, if null, service will return the first available session, otherwise, service will return specified session
        receiveMode - PeekLock or ReceiveAndDelete
        Returns:
        a CompletableFuture representing the pending session accepting