Queued Component issue whith MSMQ installed in workgroup mode

  • Thread starter Thread starter Girish G
  • Start date Start date
G

Girish G

I am trying to invoke a queued component and to my surprise the call
succeeds locally but fails when the component resides on a separate box.

Both the machines (client and server) in use have MSMQ installed in
workgroup mode.
I dont seem to get any exceptions or event messages. The outgoing queue
on the client shows that messages were sent but no acknowledgements were
received.
Heres the client code

IQComponent iQc = null;
try
{
iQc = (IQComponent)
Marshal.BindToMoniker("queue:FormatName=DIRECT=OS:GirishG_Srv2\\PRIVATE$
\\SampleQueuedApplication/new:SampleQueuedLibrary.SampleQueuedComponent"
);
}
catch( Exception e )
{
MessageBox.Show( "Cannot create Queued Component: " + e.Message );
return;
}
iQc.DisplayMessage ("Hello World!!");
Marshal.ReleaseComObject(iQc);

Thanks
 
I dont think thats particularly true and besides I am running MSMQ in
workgroup mode.

I can directly access private queues of remote box using following code.

MessageQueue mQueue = new MessageQueue(
"FormatName:DIRECT=OS:GirishG_Srv2\\PRIVATE$\\Test" );
mQueue.Send( "Hello" );
 
Ofcourse Willy, heres the server code

using System;
using System.EnterpriseServices;
using System.Windows.Forms;

namespace SampleQueuedLibrary
{
public interface IQComponent
{
void DisplayMessage(string msg);
}

[InterfaceQueuing(Interface = "IQComponent")]
public class SampleQueuedComponent: ServicedComponent, IQComponent
{
public SampleQueuedComponent()
{
}

public void DisplayMessage(string msg)
{
try
{
MessageBox.Show( null, msg, "Processing
message",MessageBoxButtons.OK,
MessageBoxIcon.Information,MessageBoxDefaultButton.Button1,
MessageBoxOptions.ServiceNotification );
}
catch( Exception e )
{
string err = e.Message;
}
}
}
}
 
I just found out you are correct. Having read most MSDN's resources on MSMQ
I've never hit upon anything stating access to private queues is not only
local.
 
Back
Top