CSharp/C# >> MSMQ listener

by Kimmo Laine » Thu, 26 Feb 2004 21:52:47 GMT


is there a way to add MessageQueue listeners?

Lets say that i have a app named A, which creates a queue named "TheQueue".
Then i have a app named C, which will recd and remove message from this

Is there a way to add app B, which would also recd those messages? This B
would be a monitoring sowtware which is not always present.

I try to use Peek and ReceiveCompleted/PeekCompleted events, but...


Kimmo Laine

Similar Threads

1. Writing MSMQ Listener as Windows Service in C#


Can any one tell me how to write a msmq listener as a windows service
in C#? 

Thanks in Advance, 

2. MSMQ 3.0 and multiple listeners? - CSharp/C#

3. MSMQ binding Stop processing after Cluster MSMQ failover

I am having an issue with WCF and clustered MSMQ and hoping someone could 
help me here.  

I have a Service with MSMQ binding hosted in IIS 7 using WAS listing to a 
cluster MSMQ.  Everything works fine, when I start my server/service.  
Messages come into system and service receives it and processes it.

Now, active server in cluster dies and it fails over to second server.  
After failover, 
no new messages will be processed until I restart the IIS or WAS.  

I do not see any errors in Event Log or Trace.  Everything seems to be 
working as normal.  WAS is able receive messages from both servers.

I created a console host and I was able to catch a Service Host exception 
and restart the host after failover.  During Failover, the Service Host is 
not able to query MSMQ and throws a MSMQ missing exception.

Does anyone know how to catch Service Host Faulted exception in WAS process?

Thanks for your help

4. Debug.Listeners: Listener can't hear anything (solved) - VB.Net

5. Debug.Listeners: Listener can't hear anything


I add a TraceListener to Debug.Listeners. After that I use Debug.writeline.
Problem: Nothing arrives at the listener.

    Dim ts As New TraceStream
    Debug.Listeners.Add(New TextWriterTraceListener(ts))

Class Tracestream is a class inherited from IO.Stream:

Public Class TraceStream
   Inherits IO.Stream

   Public Overrides ReadOnly Property CanRead() As Boolean
         Return False
      End Get
   End Property

   Public Overrides ReadOnly Property CanWrite() As Boolean
         Return True
      End Get
   End Property

    '....other overrides

   Public Overrides Sub Write( _
      ByVal buffer() As Byte, ByVal offset As Integer, _
        ByVal count As Integer)
   End Sub
End Class

I expect method Write to be called whenever Debug.Writeline is called, but
this doesn't happen. CanRead and CanWrite do get called.

Do I have a problem in understanding the Listeners concept?


6. how to add an c# object as a listener of a com object

7. Can't hear vb6 winsock connect request in C# listener

8. Web Page listener for POST message problem - CSharp/C#