1
Vote

Problem while re-connecting to Queue

description

I have downloaded MsmqJava v1.2 and using it to send the messages through my Java code to
private queue on my local machine.
 
It just works fine. I have implemented re-connect functionality in my code. I constantly check
the status of the queue through another thread. The status is checked by creating a temporary
Queue object with the same name, and if I don't get any exception there it means that queue is
opened and able to receive.
 
However, there is one problem I am facing. While running my application, I explicitly stopped
the Message Queuing service to test the re-connect functionality. The re-connect functionality
in my code did detect that service has stopped and threw exception, good. But when I re-started
the Message Queuing service and tried to send the messages again, they don't get delivered. I
don't get any exception too, so don't know what is the problem. When the service is stopped I
close the queue and set it to null. When the service is re-started I create a new Queue object
there.
 
My first guess is creating new Queue object is causing a problem? However I cannot just close
 
and open the queue with the same Queue object as there is no open method in the API and it has
 
to be done with the constructor only.
 
I am using JDK 1.6.0_22 and JRE 1.6.0_22-b04.
 
It would be really appreciated if someone could throw some focus on it.
 
Regards,
Parag

comments