c# - How can i send message to different ip's through microsoft message queue -
i working on intranet based application ( visitor management system of university), messages sending , recieving through message queue , want send message particular department selected in dropdown menu chemistry department can view visitors or department can view visitors only..
i have system central server , several clients connected on same network through ip address , @ backend have defined ip addresses of department send message particular ip messages sending departments .
this code of queue service
public class queueservice { public void queuemessage(historymodel hmsgs) { message msg = new message(); msg.body = hmsgs; msg.recoverable = true; //msg.formatter = new binarymessageformatter(); msg.formatter = new xmlmessageformatter(); string machine = environment.machinename; iphostentry host; string localip = ""; host = dns.gethostentry(dns.gethostname()); foreach (ipaddress ip in host.addresslist) { if (ip.addressfamily == addressfamily.internetwork) { localip = ip.tostring(); break; } } string queuepath = "formatname:direct=tcp:" + localip + @"\private$\websiteemails"; messagequeue msgq; insurequeueexists(queuepath); msgq = new messagequeue(queuepath); //msgq.formatter = new binarymessageformatter(); msgq.formatter = new xmlmessageformatter(); msgq.send(msg); // end sending } public static void insurequeueexists(string queuepath) { //if queue doesn't exist create if (!messagequeue.exists(queuepath)) messagequeue.create(queuepath); } }
}
the view code visitor form
<h3>add history</h3> </legend> <div class="row"> <div class="col-lg-4"> <label class="control-label" for="visitpurporse">department<span class="messages">@html.validationmessagefor(m => m.visitpurporse)</span></label> <div> <select id="department_id" name="department_id" class="form-control"> <option value="1">chemistry</option> <option value="2">computer science</option> <option value="3">information technology</option> </select> </div> </div> </div>
please help. scenario if want send message particular department selected in dropdown menu
Comments
Post a Comment