Wrox Programmer Forums
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 11th, 2004, 09:01 PM
Authorized User
 
Join Date: Aug 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rosalynb
Default Creating Queue Messaging!

Guys ... I know how to create Private Queue on my box but how am I gonna create one on another box ?
here is what I have

syntax: [computer name]\private$\[queue name]

it's not working .. I am getiing the following error:
Error: System.Messaging: Invalid queue path name.
   at System.Messaging.MessageQueue.ResolveFormatNameFro mQueuePath(String queueP
ath, Boolean throwException)
   at System.Messaging.MessageQueue.Exists(String path)
   at AIQueueCreate.AIQueueCreate.Main(String[] args)

please let me know

Roz
__________________
--------------------
Thanks
Rose
[email protected]
 
Old November 7th, 2005, 10:19 PM
Registered User
 
Join Date: Nov 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello,

Great Question. I had the same problem and was also frustrated with the
lack of postings.

The problem is the MessageQueue.FormatName is now read-only in .net.

In the good old days of COM msmq, one could use the:
MSMQQueueInfo.FormatName = "DIRECT=OS:MyServer\private$\someQ"
where "MyServer" is a remote machine name. You had to do it this was for remote
machines. MSMQQueueInfo.pathname would bomb when trying to access private queues from remote machines.

In .net, it still bombs;however, MessageQueue doesn't expose a write property for .FormatName.

That sucks!!!

The answer, which works in .net, not COM msmq is:

//c# code begin==========================
string lsTemp = @"FormatName:DIRECT=OS:MyServer\private$\someQ" ;
if (mQueue == null)
          mQueue = new MessageQueue(lsTemp);
//c# code end==============================
where MyServer is the UNC name of some remote computer & someQ is a private queue on MyServer.

Remember, for COM MSMQ, you have to

vb6 code begin===================
mMSMQQueueInfo.FormatName = "DIRECT=OS:MyServer\private$\someQ"
vb6 code end ===================

In summary, in vb6 ALWAYS USE THE .FORMATNAME property over the PATHNAME property.
In .net, use the "FormatName:DIRECT=OS:" prefix in the constructor as seen above.

I hope this helps.

whattheheck

whattheheck in the house
 
Old January 28th, 2006, 08:13 AM
Registered User
 
Join Date: Jan 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Here I am using the same kind of code to send a message to a remote machine.

I have created the transactional queue "TestAtMANDYATALUKA" in the machine TKServer.

I am executing the following code from other machine.

string QueueName = @"FORMATNAME:DIRECT=OS:TKServer\private$\TestAtMAN DYATALUKA";
if (MessageQueue.Exists(QueueName))
{
MessageQueue myQueue = new MessageQueue(QueueName);
myQueue.Send(message);
}

When It is checking for existence, it is giving me the error as "Cannot determine whether a queue with the specified name exists".

Thanks in advance.




-Subhash Kotu





Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Messaging anukagni Access 10 September 1st, 2006 11:54 PM
Messaging in JAVA salahu J2EE 0 July 22nd, 2006 11:01 PM
Messaging in JAVA salahu BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 July 22nd, 2006 10:59 PM
instant messaging with System.Messaging connect2sandep General .NET 35 March 1st, 2006 01:11 PM
sms messaging dev_sept ASP.NET 1.0 and 1.1 Professional 0 August 28th, 2005 11:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.