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