protected void ReconnectSession()
{
if(this.session != null)
{
this.session.Close();
}
this.session = this.connection.CreateSession(AcknowledgementMode.Transactional);
if( this.Topic == true )
{
this.destination = this.session.GetTopic(this.DestinationName);
}
else
{
this.destination = this.session.GetQueue(this.DestinationName);
}
this.producer = this.session.CreateProducer(destination);
this.consumer = CreateMessageConsumer();
}