I use xms.net 8.0.0.8 and I want to start multithread xms listener in web application.
I start processmessage code with using new Thread t=new Thread()...
but something goes wrong,and threads are stuck and not read message?If someone has multithread xms sample for web application can share or tell my mistake?Or is this any bug for multithread in xms?
public void ProcessMessage()
{
try
{
ConnectionFactory = WsHelper.CreateConnectionFactoryWMQ();
Connection = WsHelper.CreateConnection(ConnectionFactory);
if (QueueMessage.MessageCallType == MessageCallType.WithoutControl)
Session = WsHelper.CreateSessionWithAutoAcknowledge(Connection);
else
Session = WsHelper.CreateSessionWithSessionTransaction(Connection);
Destination = WsHelper.CreateDestination(Session, QueueMessage.QueueName);
MessageConsumer = WsHelper.CreateConsumer(Session, Destination, QueueMessage);
MessageListener messageListener = new MessageListener(NewMessageProcess);
MessageConsumer.MessageListener = messageListener;
this.Connection.Start();
while (true)
{
if (stopping)
{
MessageConsumer.Close();
return;
}
Thread.Sleep(1000);
}
}
catch(ThreadAbortException ex)
{
throw ex;
}
catch (Exception ex)
{
throw ex;
}
}
private void NewMessageProcess(IBM.XMS.IMessage msg)
{