Package com.microsoft.azure.servicebus
Class ClientFactory
- java.lang.Object
-
- com.microsoft.azure.servicebus.ClientFactory
-
public final class ClientFactory extends Object
Utility class for creating message senders and receivers.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IMessageSession
acceptSessionFromConnectionString(String amqpConnectionString, String sessionId)
Accept aIMessageSession
in defaultReceiveMode.PEEKLOCK
mode from service bus connection string with specified session id.static IMessageSession
acceptSessionFromConnectionString(String amqpConnectionString, String sessionId, ReceiveMode receiveMode)
Accept aIMessageSession
from service bus connection string with specified session id.static CompletableFuture<IMessageSession>
acceptSessionFromConnectionStringAsync(String amqpConnectionString, String sessionId)
Accept aIMessageSession
in defaultReceiveMode.PEEKLOCK
mode asynchronously from service bus connection string with specified session id.static CompletableFuture<IMessageSession>
acceptSessionFromConnectionStringAsync(String amqpConnectionString, String sessionId, ReceiveMode receiveMode)
Accept aIMessageSession
asynchronously from service bus connection string with specified session id.static IMessageSession
acceptSessionFromConnectionStringBuilder(ConnectionStringBuilder amqpConnectionStringBuilder, String sessionId)
Accept aIMessageSession
in defaultReceiveMode.PEEKLOCK
mode from service bus connection string builder with specified session id.static IMessageSession
acceptSessionFromConnectionStringBuilder(ConnectionStringBuilder amqpConnectionStringBuilder, String sessionId, ReceiveMode receiveMode)
Accept aIMessageSession
from service bus connection string builder with specified session id.static CompletableFuture<IMessageSession>
acceptSessionFromConnectionStringBuilderAsync(ConnectionStringBuilder amqpConnectionStringBuilder, String sessionId)
Accept aIMessageSession
in defaultReceiveMode.PEEKLOCK
mode asynchronously from service bus connection string builder with specified session id.static CompletableFuture<IMessageSession>
acceptSessionFromConnectionStringBuilderAsync(ConnectionStringBuilder amqpConnectionStringBuilder, String sessionId, ReceiveMode receiveMode)
Accept aIMessageSession
asynchronously from service bus connection string builder with specified session id.static IMessageSession
acceptSessionFromEntityPath(MessagingFactory messagingFactory, String entityPath, String sessionId)
Accept aIMessageSession
from service bus using the client settings with specified session id.static IMessageSession
acceptSessionFromEntityPath(MessagingFactory messagingFactory, String entityPath, String sessionId, ReceiveMode receiveMode)
Accept aIMessageSession
from service bus using the client settings with specified session id.static IMessageSession
acceptSessionFromEntityPath(String namespaceName, String entityPath, String sessionId, ClientSettings clientSettings)
Accept aIMessageSession
from service bus using the client settings with specified session id in PeekLock mode.static IMessageSession
acceptSessionFromEntityPath(String namespaceName, String entityPath, String sessionId, ClientSettings clientSettings, ReceiveMode receiveMode)
Accept aIMessageSession
from service bus using the client settings with specified session id.static IMessageSession
acceptSessionFromEntityPath(URI namespaceEndpointURI, String entityPath, String sessionId, ClientSettings clientSettings)
Accept aIMessageSession
from service bus using the client settings with specified session id in PeekLock mode.static IMessageSession
acceptSessionFromEntityPath(URI namespaceEndpointURI, String entityPath, String sessionId, ClientSettings clientSettings, ReceiveMode receiveMode)
Accept aIMessageSession
from service bus using the client settings with specified session id.static CompletableFuture<IMessageSession>
acceptSessionFromEntityPathAsync(MessagingFactory messagingFactory, String entityPath, String sessionId)
Asynchronously accepts a session from service bus using the client settings.static CompletableFuture<IMessageSession>
acceptSessionFromEntityPathAsync(MessagingFactory messagingFactory, String entityPath, String sessionId, ReceiveMode receiveMode)
Asynchronously accepts a session from service bus using the client settings.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.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.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.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.static IMessageReceiver
createMessageReceiverFromConnectionString(String amqpConnectionString)
CreateIMessageReceiver
in defaultReceiveMode.PEEKLOCK
mode from service bus connection string with Shared Access Signaturesstatic IMessageReceiver
createMessageReceiverFromConnectionString(String amqpConnectionString, ReceiveMode receiveMode)
CreateIMessageReceiver
in defaultReceiveMode.PEEKLOCK
mode from service bus connection string with Shared Access Signaturesstatic CompletableFuture<IMessageReceiver>
createMessageReceiverFromConnectionStringAsync(String amqpConnectionString)
CreateIMessageReceiver
in defaultReceiveMode.PEEKLOCK
mode asynchronously from connection string with Shared Access Signaturesstatic CompletableFuture<IMessageReceiver>
createMessageReceiverFromConnectionStringAsync(String amqpConnectionString, ReceiveMode receiveMode)
CreateIMessageReceiver
in defaultReceiveMode.PEEKLOCK
mode asynchronously from connection string with Shared Access Signaturesstatic IMessageReceiver
createMessageReceiverFromConnectionStringBuilder(ConnectionStringBuilder amqpConnectionStringBuilder)
CreateIMessageReceiver
in defaultReceiveMode.PEEKLOCK
mode from ConnectionStringBuilderstatic IMessageReceiver
createMessageReceiverFromConnectionStringBuilder(ConnectionStringBuilder amqpConnectionStringBuilder, ReceiveMode receiveMode)
CreateIMessageReceiver
from ConnectionStringBuilderstatic CompletableFuture<IMessageReceiver>
createMessageReceiverFromConnectionStringBuilderAsync(ConnectionStringBuilder amqpConnectionStringBuilder)
CreateIMessageReceiver
in defaultReceiveMode.PEEKLOCK
mode asynchronously from ConnectionStringBuilderstatic CompletableFuture<IMessageReceiver>
createMessageReceiverFromConnectionStringBuilderAsync(ConnectionStringBuilder amqpConnectionStringBuilder, ReceiveMode receiveMode)
CreateIMessageReceiver
asynchronously from ConnectionStringBuilderstatic IMessageReceiver
createMessageReceiverFromEntityPath(MessagingFactory messagingFactory, String entityPath)
Creates a message receiver to the entity.static IMessageReceiver
createMessageReceiverFromEntityPath(MessagingFactory messagingFactory, String entityPath, ReceiveMode receiveMode)
Creates a message receiver to the entity.static IMessageReceiver
createMessageReceiverFromEntityPath(String namespaceName, String entityPath, ClientSettings clientSettings)
Creates a message receiver to the entity using the client settings in PeekLock modestatic IMessageReceiver
createMessageReceiverFromEntityPath(String namespaceName, String entityPath, ClientSettings clientSettings, ReceiveMode receiveMode)
Creates a message receiver to the entity using the client settings.static IMessageReceiver
createMessageReceiverFromEntityPath(URI namespaceEndpointURI, String entityPath, ClientSettings clientSettings)
Creates a message receiver to the entity using the client settings in PeekLock modestatic IMessageReceiver
createMessageReceiverFromEntityPath(URI namespaceEndpointURI, String entityPath, ClientSettings clientSettings, ReceiveMode receiveMode)
Creates a message receiver to the entity using the client settings.static CompletableFuture<IMessageReceiver>
createMessageReceiverFromEntityPathAsync(MessagingFactory messagingFactory, String entityPath)
Asynchronously creates a new message receiver to the entity on the messagingFactory.static CompletableFuture<IMessageReceiver>
createMessageReceiverFromEntityPathAsync(MessagingFactory messagingFactory, String entityPath, ReceiveMode receiveMode)
Asynchronously creates a new message receiver to the entity on the messagingFactory.static CompletableFuture<IMessageReceiver>
createMessageReceiverFromEntityPathAsync(String namespaceName, String entityPath, ClientSettings clientSettings)
Asynchronously creates a message receiver to the entity using the client settings in PeekLock modestatic CompletableFuture<IMessageReceiver>
createMessageReceiverFromEntityPathAsync(String namespaceName, String entityPath, ClientSettings clientSettings, ReceiveMode receiveMode)
Asynchronously creates a message receiver to the entity using the client settingsstatic CompletableFuture<IMessageReceiver>
createMessageReceiverFromEntityPathAsync(URI namespaceEndpointURI, String entityPath, ClientSettings clientSettings)
Asynchronously creates a message receiver to the entity using the client settings in PeekLock modestatic CompletableFuture<IMessageReceiver>
createMessageReceiverFromEntityPathAsync(URI namespaceEndpointURI, String entityPath, ClientSettings clientSettings, ReceiveMode receiveMode)
Asynchronously creates a message receiver to the entity using the client settingsstatic IMessageSender
createMessageSenderFromConnectionString(String amqpConnectionString)
Create message sender from service bus connection string with Shared Access Signaturesstatic CompletableFuture<IMessageSender>
createMessageSenderFromConnectionStringAsync(String amqpConnectionString)
Create message sender asynchronously from connection string with Shared Access Signaturesstatic IMessageSender
createMessageSenderFromConnectionStringBuilder(ConnectionStringBuilder amqpConnectionStringBuilder)
Create message sender from ConnectionStringBuilderstatic CompletableFuture<IMessageSender>
createMessageSenderFromConnectionStringBuilderAsync(ConnectionStringBuilder amqpConnectionStringBuilder)
Create message sender asynchronously from ConnectionStringBuilderstatic IMessageSender
createMessageSenderFromEntityPath(MessagingFactory messagingFactory, String entityPath)
Creates a message sender to the entity.static IMessageSender
createMessageSenderFromEntityPath(String namespaceName, String entityPath, ClientSettings clientSettings)
Creates a message sender to the entity using the client settings.static IMessageSender
createMessageSenderFromEntityPath(URI namespaceEndpointURI, String entityPath, ClientSettings clientSettings)
Creates a message sender to the entity using the client settings.static CompletableFuture<IMessageSender>
createMessageSenderFromEntityPathAsync(MessagingFactory messagingFactory, String entityPath)
Creates a message sender asynchronously to the entity using theMessagingFactory
static CompletableFuture<IMessageSender>
createMessageSenderFromEntityPathAsync(String namespaceName, String entityPath, ClientSettings clientSettings)
Creates a message sender asynchronously to the entity using the client settings.static CompletableFuture<IMessageSender>
createMessageSenderFromEntityPathAsync(URI namespaceEndpointURI, String entityPath, ClientSettings clientSettings)
Creates a message sender asynchronously to the entity using the client settings.static IMessageSender
createTransferMessageSenderFromEntityPath(MessagingFactory messagingFactory, String entityPath, String viaEntityPath)
Creates a transfer message sender.static CompletableFuture<IMessageSender>
createTransferMessageSenderFromEntityPathAsync(MessagingFactory messagingFactory, String entityPath, String viaEntityPath)
Creates a transfer message sender asynchronously.
-
-
-
Method Detail
-
createMessageSenderFromConnectionString
public static IMessageSender createMessageSenderFromConnectionString(String amqpConnectionString) throws InterruptedException, ServiceBusException
Create message sender from service bus connection string with Shared Access Signatures- Parameters:
amqpConnectionString
- the connection string- Returns:
IMessageSender
instance- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if the sender cannot be created
-
createMessageSenderFromConnectionStringBuilder
public static IMessageSender createMessageSenderFromConnectionStringBuilder(ConnectionStringBuilder amqpConnectionStringBuilder) throws InterruptedException, ServiceBusException
Create message sender from ConnectionStringBuilderIMessageSender 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 waitingServiceBusException
- if the sender cannot be created
-
createMessageSenderFromEntityPath
public static IMessageSender createMessageSenderFromEntityPath(String namespaceName, String entityPath, ClientSettings clientSettings) throws InterruptedException, ServiceBusException
Creates a message sender to the entity using the client settings.- Parameters:
namespaceName
- namespace of entityentityPath
- path of entityclientSettings
- client settings- Returns:
- IMessageSender instance
- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- 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 namespaceentityPath
- path of entityclientSettings
- client settings- Returns:
- IMessageSender instance
- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if the sender cannot be created
-
createMessageSenderFromEntityPath
public static IMessageSender createMessageSenderFromEntityPath(MessagingFactory messagingFactory, String entityPath) throws InterruptedException, ServiceBusException
Creates a message sender to the entity.- Parameters:
messagingFactory
- messaging factory (which represents a connection) on which sender needs to be createdentityPath
- path of entity- Returns:
- IMessageSender instance
- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- 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 waitingServiceBusException
- 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 entityentityPath
- path of entityclientSettings
- 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 namespaceentityPath
- path of entityclientSettings
- 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 theMessagingFactory
- Parameters:
messagingFactory
- messaging factory (which represents a connection) on which sender needs to be createdentityPath
- 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.
-
createMessageReceiverFromConnectionString
public static IMessageReceiver createMessageReceiverFromConnectionString(String amqpConnectionString) throws InterruptedException, ServiceBusException
CreateIMessageReceiver
in defaultReceiveMode.PEEKLOCK
mode from service bus connection string with Shared Access Signatures- Parameters:
amqpConnectionString
- the connection string- Returns:
IMessageReceiver
instance- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if the receiver cannot be created
-
createMessageReceiverFromConnectionString
public static IMessageReceiver createMessageReceiverFromConnectionString(String amqpConnectionString, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException
CreateIMessageReceiver
in defaultReceiveMode.PEEKLOCK
mode from service bus connection string with Shared Access Signatures- Parameters:
amqpConnectionString
- the connection stringreceiveMode
-ReceiveMode
PeekLock or ReceiveAndDelete- Returns:
IMessageReceiver
instance- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if the receiver cannot be created
-
createMessageReceiverFromConnectionStringBuilder
public static IMessageReceiver createMessageReceiverFromConnectionStringBuilder(ConnectionStringBuilder amqpConnectionStringBuilder) throws InterruptedException, ServiceBusException
CreateIMessageReceiver
in defaultReceiveMode.PEEKLOCK
mode from ConnectionStringBuilderIMessageReceiver messageReceiver = ClientFactory.createMessageReceiverFromConnectionStringBuilder(new ConnectionStringBuilder(connectionString, queueName));
- Parameters:
amqpConnectionStringBuilder
-ConnectionStringBuilder
- Returns:
- The
IMessageReceiver
instance - Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if the receiver cannot be created
-
createMessageReceiverFromConnectionStringBuilder
public static IMessageReceiver createMessageReceiverFromConnectionStringBuilder(ConnectionStringBuilder amqpConnectionStringBuilder, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException
CreateIMessageReceiver
from ConnectionStringBuilderIMessageReceiver messageReceiver = ClientFactory.createMessageReceiverFromConnectionStringBuilder(new ConnectionStringBuilder(connectionString, queueName), ReceiveMode.PEEKLOCK);
- Parameters:
amqpConnectionStringBuilder
-ConnectionStringBuilder
receiveMode
-ReceiveMode
PeekLock or ReceiveAndDelete- Returns:
- The
IMessageReceiver
instance - Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if the receiver cannot be created
-
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 entityentityPath
- path of the entityclientSettings
- client settings- Returns:
- IMessageReceiver instance
- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- 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 entityentityPath
- path of the entityclientSettings
- client settingsreceiveMode
- PeekLock or ReceiveAndDelete- Returns:
- IMessageReceiver instance
- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- 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 namespaceentityPath
- path of the entityclientSettings
- client settings- Returns:
- IMessageReceiver instance
- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- 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 namespaceentityPath
- path of the entityclientSettings
- client settingsreceiveMode
- PeekLock or ReceiveAndDelete- Returns:
- IMessageReceiver instance
- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- 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 createdentityPath
- path of the entity- Returns:
- IMessageReceiver instance
- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- 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 createdentityPath
- path of the entityreceiveMode
- PeekLock or ReceiveAndDelete- Returns:
- IMessageReceiver instance
- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if the receiver cannot be created
-
createMessageReceiverFromConnectionStringAsync
public static CompletableFuture<IMessageReceiver> createMessageReceiverFromConnectionStringAsync(String amqpConnectionString)
CreateIMessageReceiver
in defaultReceiveMode.PEEKLOCK
mode asynchronously from connection string with Shared Access Signatures- Parameters:
amqpConnectionString
- the connection string- Returns:
- a CompletableFuture representing the pending creating
-
createMessageReceiverFromConnectionStringAsync
public static CompletableFuture<IMessageReceiver> createMessageReceiverFromConnectionStringAsync(String amqpConnectionString, ReceiveMode receiveMode)
CreateIMessageReceiver
in defaultReceiveMode.PEEKLOCK
mode asynchronously from connection string with Shared Access Signatures- Parameters:
amqpConnectionString
- the connection stringreceiveMode
-ReceiveMode
PeekLock or ReceiveAndDelete- Returns:
- a CompletableFuture representing the pending creating
-
createMessageReceiverFromConnectionStringBuilderAsync
public static CompletableFuture<IMessageReceiver> createMessageReceiverFromConnectionStringBuilderAsync(ConnectionStringBuilder amqpConnectionStringBuilder)
CreateIMessageReceiver
in defaultReceiveMode.PEEKLOCK
mode asynchronously from ConnectionStringBuilder- Parameters:
amqpConnectionStringBuilder
- the connection string builder- Returns:
- a CompletableFuture representing the pending creating
-
createMessageReceiverFromConnectionStringBuilderAsync
public static CompletableFuture<IMessageReceiver> createMessageReceiverFromConnectionStringBuilderAsync(ConnectionStringBuilder amqpConnectionStringBuilder, ReceiveMode receiveMode)
CreateIMessageReceiver
asynchronously from ConnectionStringBuilder- Parameters:
amqpConnectionStringBuilder
- the connection string builderreceiveMode
-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 entityentityPath
- path of entityclientSettings
- 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 entityentityPath
- path of entityclientSettings
- client settingsreceiveMode
- 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 namespaceentityPath
- path of entityclientSettings
- 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 namespaceentityPath
- path of entityclientSettings
- client settingsreceiveMode
- 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 entityreceiveMode
- PeekLock or ReceiveAndDelete- Returns:
- a CompletableFuture representing the pending creation of message receiver
-
acceptSessionFromConnectionString
public static IMessageSession acceptSessionFromConnectionString(String amqpConnectionString, String sessionId) throws InterruptedException, ServiceBusException
Accept aIMessageSession
in defaultReceiveMode.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.- Parameters:
amqpConnectionString
- connection stringsessionId
- 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 waitingServiceBusException
- if the session cannot be accepted
-
acceptSessionFromConnectionString
public static IMessageSession acceptSessionFromConnectionString(String amqpConnectionString, String sessionId, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException
Accept aIMessageSession
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 stringsessionId
- session id, if null, service will return the first available session, otherwise, service will return specified sessionreceiveMode
-ReceiveMode
PeekLock or ReceiveAndDelete- Returns:
IMessageSession
instance- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if the session cannot be accepted
-
acceptSessionFromConnectionStringBuilder
public static IMessageSession acceptSessionFromConnectionStringBuilder(ConnectionStringBuilder amqpConnectionStringBuilder, String sessionId) throws InterruptedException, ServiceBusException
Accept aIMessageSession
in defaultReceiveMode.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.- Parameters:
amqpConnectionStringBuilder
- the connection string buildersessionId
- 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 waitingServiceBusException
- if the session cannot be accepted
-
acceptSessionFromConnectionStringBuilder
public static IMessageSession acceptSessionFromConnectionStringBuilder(ConnectionStringBuilder amqpConnectionStringBuilder, String sessionId, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException
Accept aIMessageSession
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 buildersessionId
- session id, if null, service will return the first available session, otherwise, service will return specified sessionreceiveMode
-ReceiveMode
PeekLock or ReceiveAndDelete- Returns:
IMessageSession
instance- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if the session cannot be accepted
-
acceptSessionFromEntityPath
public static IMessageSession acceptSessionFromEntityPath(String namespaceName, String entityPath, String sessionId, ClientSettings clientSettings) throws InterruptedException, ServiceBusException
Accept aIMessageSession
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 entityentityPath
- path of entitysessionId
- session id, if null, service will return the first available session, otherwise, service will return specified sessionclientSettings
- client settings- Returns:
- IMessageSession instance
- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- 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 aIMessageSession
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 entityentityPath
- path of entitysessionId
- session id, if null, service will return the first available session, otherwise, service will return specified sessionclientSettings
- client settingsreceiveMode
- PeekLock or ReceiveAndDelete- Returns:
- IMessageSession instance
- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if the session cannot be accepted
-
acceptSessionFromEntityPath
public static IMessageSession acceptSessionFromEntityPath(URI namespaceEndpointURI, String entityPath, String sessionId, ClientSettings clientSettings) throws InterruptedException, ServiceBusException
Accept aIMessageSession
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 namespaceentityPath
- path of entitysessionId
- session id, if null, service will return the first available session, otherwise, service will return specified sessionclientSettings
- client settings- Returns:
- IMessageSession instance
- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- 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 aIMessageSession
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 namespaceentityPath
- path of entitysessionId
- session id, if null, service will return the first available session, otherwise, service will return specified sessionclientSettings
- client settingsreceiveMode
- PeekLock or ReceiveAndDelete- Returns:
- IMessageSession instance
- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if the session cannot be accepted
-
acceptSessionFromEntityPath
public static IMessageSession acceptSessionFromEntityPath(MessagingFactory messagingFactory, String entityPath, String sessionId) throws InterruptedException, ServiceBusException
Accept aIMessageSession
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 entitysessionId
- 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 waitingServiceBusException
- if the session cannot be accepted
-
acceptSessionFromEntityPath
public static IMessageSession acceptSessionFromEntityPath(MessagingFactory messagingFactory, String entityPath, String sessionId, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException
Accept aIMessageSession
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 entitysessionId
- session id, if null, service will return the first available session, otherwise, service will return specified sessionreceiveMode
- PeekLock or ReceiveAndDelete- Returns:
- IMessageSession instance
- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if the session cannot be accepted
-
acceptSessionFromConnectionStringAsync
public static CompletableFuture<IMessageSession> acceptSessionFromConnectionStringAsync(String amqpConnectionString, String sessionId)
Accept aIMessageSession
in defaultReceiveMode.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 stringsessionId
- 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 aIMessageSession
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 stringsessionId
- session id, if null, service will return the first available session, otherwise, service will return specified sessionreceiveMode
-ReceiveMode
PeekLock or ReceiveAndDelete- Returns:
- a CompletableFuture representing the pending session accepting
-
acceptSessionFromConnectionStringBuilderAsync
public static CompletableFuture<IMessageSession> acceptSessionFromConnectionStringBuilderAsync(ConnectionStringBuilder amqpConnectionStringBuilder, String sessionId)
Accept aIMessageSession
in defaultReceiveMode.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 buildersessionId
- 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 aIMessageSession
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 buildersessionId
- session id, if null, service will return the first available session, otherwise, service will return specified sessionreceiveMode
-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 entityentityPath
- path of entitysessionId
- session id, if null, service will return the first available session, otherwise, service will return specified sessionclientSettings
- 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 entityentityPath
- path of entitysessionId
- session id, if null, service will return the first available session, otherwise, service will return specified sessionclientSettings
- client settingsreceiveMode
- 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 namespaceentityPath
- path of entitysessionId
- session id, if null, service will return the first available session, otherwise, service will return specified sessionclientSettings
- 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 namespaceentityPath
- path of entitysessionId
- session id, if null, service will return the first available session, otherwise, service will return specified sessionclientSettings
- client settingsreceiveMode
- 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 entitysessionId
- 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 entitysessionId
- session id, if null, service will return the first available session, otherwise, service will return specified sessionreceiveMode
- PeekLock or ReceiveAndDelete- Returns:
- a CompletableFuture representing the pending session accepting
-
-