There are some books available but I haven't read any of them so I have
no idea how much detail they provide. Still that would be one place to
start. The MSDN Magazine has published some MSMQ articles over the
years, you could search there:
http://msdn.microsoft.com/en-us/magazine/default.aspx
There are some useful blogs as well. John Breakwell has a good one and
his blog also offers links to various other ones
http://blogs.msdn.com/johnbreakwell/
The SDK also has some how to and background articles, start here and
drill down
http://msdn.microsoft.com/en-us/library/ms711472(VS.85).aspx
> I would like to see if there is any console
> for this MSMQ like explorer or some thing else? I
Go to the Computer Management snap-in (e.g., Administrative Tools |
Computer management). Expand the "Services and Applications" node.
Expand Message Queuing, then expand Private Queues and finally expand
one of your private queues..
Right click on "Message Queuing" for various commands pertaining to MSMQ
as a whole, and to get access to MSMQ properties. Right click on
Private Queues to get a command to let you manually create a new private
queue. Right click on a private queue to view the properties of the
queue itself. Right click on "Queue messages" to get a command to purge
the queue and a command to refresh the right hand panel.
Click on the "Queue messages" node to select it and the right hand panel
will display the contents of the queue 9actually it will only show you
the first thousand messages or so). Double click on an individual
message to view its properties.
I'm sorry, I don't understand the question. I'll try answering a few
and hope I hit on the right one.
Can I install MSMQ and SQL Server on the same system? Yes
Can a client program access MSMQ and SQL server at the same time? Yes
Can an SQL server stored procedure make MSMQ calls? Yes (I think)
If I haven't answered the question you wanted to ask, could you ask
again please?
There isn't any configuration required for SQL and MSMQ to work
together.
Here's a KB article that shows one technique for sending a message to an
MSMQ queue from an SQL stored procedure
http://support.microsoft.com/kb/555070
The MqTrans sample application in the Platform SDK shows how to
manipulate a queue and an SQL database as part of a coordinated
transaction using C++. For example you could remove a message from a
queue and update an SQL database based on the contents of that message
or else you could send a message and update an SQL database. In either
case, if the transaction commits both the MSMQ action and the SQL action
are commited (or neither is)
http://msdn.microsoft.com/en-us/library/ms701547(VS.85).aspx
You can't really get the size of the whole message, you can get the size
of the message body which makes up most of the message (usually). Use
Peek to retrieve the first message from the queue without removing it
(or use PeekCurrent and PeekNext to work your way down the queue to the
message you want). Then, access the BodyLength property.
> 2)how can i get out of the Q a message if i want and delete it.
Call Receive to remove the message. The trick is to make sure you
remove the message you want to remove. One way to do that is to use
ReceiveByLooupId.
The following script demonstrates the basics. I've left out error
handling, timeouts, etc. If the queue is empty this script will hang
until a message appears in the queue.
Option Explicit
const MQ_RECEIVE_ACCESS = 1
const MQ_SEND_ACCESS = 2
const MQ_DENY_NONE = 0
Dim qi
set qi = WScript.CreateObject("MSMQ.MSMQQueueInfo")
'qi.FormatName = "DIRECT=OS:BadWolf\private$\testqueue"
'qi.FormatName = "DIRECT=TCP:192.168.1.2\private$\testqueue"
'qi.FormatName =
"DIRECT=HTTP://BadWolf.example.com/msmq/private$/testqueue"
qi.PathName = ".\private$\testQueue"
Dim q
set q = qi.Open(MQ_RECEIVE_ACCESS, MQ_DENY_NONE)
Dim msg
set msg = q.Peek
' show the size of the message body
WScript.Echo "Body Size: " & CStr (msg.BodyLength) & " bytes"
' remove msg from the queue
q.ReceiveByLookupId (msg.LookupId)
thanks i nadvance
Peleg
I don't think that information is saved in the registry, it's kept in an
MMC stored console (.msc) file.
You can temporarily change the view quite easily. With the current view
displayed, right click on the selected node in the left-hand panel then
select View | Add/Remove columns. That will let you add new columns to
the view, change the order of the columns and change the width of
columns. The problem is, you lose all those alterations when you shut
down the snap-in.
To create your own mmc console, start by running MMC with the /a command
line switch to run in 'author' mode. Then, use File | Add/Remove
snap-in to add the "Computer Management" snap-in to your Console. Drill
down to the private queue view you want to modify and use Add/Remove
Columns to change it the way you want. Finally, use File | Save As to
save your creation as a .msc file.
Now, when you want to see your view, open the .msc file you created
instead of the usual admin snap-in (you can use the command MMC
yourFile.msc or just double click on the .msc file in Explorer). If you
want to change your view again, run MMC against your .msc file with the
/a switch again (MMC yourFile.msc /a).
I don't recommend this but, if you want to modify the 'real' Computer
Management views edit the file %SystemRoot%\system32\compmgmt.msc
Sorry, there aren't a lot of code samples available for VBScript. If
you are familiar with VB and with scripting you can often adapt a VB
sample to VBScript.
> 2)can you refer me to a documnetation aon each proptety of the object
> you
> gave me in the scriptt and moe...
What you want is the Message Queuing COM Component documentation
http://msdn.microsoft.com/en-us/library/ms704064(VS.85).aspx
From there you can drill into a component like MSMQQueue and examine the
methods and properties of that object. The documentation for a
particular property or method sometimes has sample code for C++ and
Visual Basic.
To determine the values of constants like MQ_DENY_NONE you need to look
at the type library using a tool like OleView or Visual basic's Object
Browser or else look in the mq.h header file in the SDK.