/** * 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); }