//How to Create a MessageQueue ?_______________________ static string myQueue = ".\\private$\\EmailQueue"; if (!MessageQueue.Exists(myQueue)) { MessageQueue.Create(myQueue, false); } Console.WriteLine("Server is up and running on port 32578"); //How to Add MessageQueue :__________________________ MessageQueue messageQueue = new MessageQueue(myQueue); messageQueue.Send(emailDetail, "Email"); //How to Receive a MessageQueue :_____________________________________ private static EmailDetails ReceiveMessage(string queueName) { log.Info(DateTime.Now + " Queue checking"); MessageQueue messageQueue = new MessageQueue(queueName); EmailDetails emailDetail = null; try { messageQueue.Formatter = new XmlMessageFormatter(new Type[] { typeof(EmailDetails) }); emailDetail = (EmailDetails)messageQueue.Receive().Body; //emailDetail is class obect where i have recieved object from queueu } } catch(Exception ex) { } finally { messageQueue.Close(); } return emailDetail; }
Introduction In this tutorial, we will learn how to add @author comments to every new class that we create. We can achieve it using either of the following two solutions Solution 1: Automatically add @author comments to every new class using Files and Code Templates Open File -> Settings -> Editor -> File and Code Templates -> Includes Click on Includes . Under File Header , enter the following comments text /** * @author ${USER} * @Date ${DATE} */ Intellij - add @author comments Solution 2: Autocompletion of @author Open File -> Settings -> Editor -> Live Templates Select Java and then click on + button In Abbreviation, enter @a In template text , enter the following comments /** * @author ${USER} * @Date ${DATE} */ In option , Expands with select SPACE Intellij - Autocompletion @author You can simply add the @author comments by typing @a and then click SPACE
Comments
Post a Comment