c# - ActiveMQ delete specific message -


I use the following code to get messages without deleting. Now I need to add some filtering and delete some messages. My question is how to delete a specific message, while the other message should be in queue?

  Ury connectivity = new URI ("activemq: tcp: //model.net: 61616"); IConnectionFactory factory = new NMSConnectionFactory (connectivity); & Lt; ModelBuilderBase & gt; Results = new list & amp; ;; Modelbindersbase & gt; (); (Using the connection connection = factory.Contact connection ()) (Asynchronous session = connection. Crete session ()) {IDestination Destination = Session. Get Destination (Session, "Qi: // Sid ModelBulderQue"); (Using imessage consumer consumer = session.CreateConsumer (destination)) {connection.Start (); Var q = session.GetQueue ("cidModelbuilderQ"); Var B = session Create Braaser (Q); Var msgs = b.GetEnumerator (); While (msgs.MoveNext ()) {iText Message Message = Messages. In the form of iText Message; If (messages. Properties [mail]] == faucet || message properties [REFCODE] == zero;); Var mandator = message.Properties [MANDATOR]. Ostring (); Var refCode = message.Properties [REFCODE]. Ostring (); result. Add (model builderfighter.instance.gateinstance (refode, compulsory)); Use the selectors and get these messages.  

When creating a consumer, make it from the iMessage Consumer Consumer = session. Based on the need to look for Creteconferrer (Destination, "Rephode> 200") or similarly. So just call the customer. Receive (timeout_value); Unless you drag all selected messages in the queue

Comments