private void SendMsgToMQ(string msgData, int orderId)
{
try
{
string queueName = ConfigurationManager.AppSettings["MSMQ_queue"];
MessageQueue msgQueue = new MessageQueue(queueName);
Message msg = new Message(msgData);
msg.AppSpecific = orderId;
msgQueue.Send(msg, String.Format("Order ID {0}", orderId));
msg.Dispose();
msgQueue.Close();
msgQueue.Dispose();
}
catch (Exception)
{
throw;
}
}
|