/// <summary>
/// Creates a new session to work on this connection
/// </summary>
public ISession CreateSession(AcknowledgementMode sessionAcknowledgementMode)
{
SessionInfo info = CreateSessionInfo(sessionAcknowledgementMode);
SyncRequest(info, this.RequestTimeout);
Session session = new Session(this, info, sessionAcknowledgementMode, this.dispatchAsync);
// Set propertieDs on session using parameters prefixed with "session."
if (!String.IsNullOrEmpty(brokerUri.Query) && !brokerUri.OriginalString.EndsWith(")"))
{
string query = brokerUri.Query.Substring(brokerUri.Query.LastIndexOf(")") + 1);
StringDictionary options = URISupport.ParseQuery(query);
options = URISupport.GetProperties(options, "session.");
URISupport.SetProperties(session, options);
}
session.ConsumerTransformer = this.ConsumerTransformer;
session.ProducerTransformer = this.ProducerTransformer;
if (IsStarted)
{
session.Start();
}
sessions.Add(session);
return(session);
}