|
Home > Archive > BizTalk Server General > March 2004 > Enumerate MSMQ Journal entries with a Private Queue?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Enumerate MSMQ Journal entries with a Private Queue?
|
|
| Steve Yetter 2004-03-18, 1:58 pm |
|
I am trying to enumerate messages in a journal for a private queue but I
keep getting an exception that states there is an invalid parameter passed
to a function. Here is the code.
path contains a string like
" FormatName:DIRECT=OS:bizsql1\private$\to
_biztalk\journal$"
private int GetNumMsgsInQueue( string path )
{
int count = 0;
try
{
msgQueue = new MessageQueue( path );
// Get a cursor into the messages in the queue.
msgEnumerator = msgQueue.GetMessageEnumerator();
// Move to the next message and count it Doing this statement causes the
exception!!!!!!
while( msgEnumerator.MoveNext() )
{
count++;
}
}
catch( Exception ex )
{
MessageBox.Show( ex.Message, this.Text, MessageBoxButtons.OK,
MessageBoxIcon.Warning );
}
return count;
}
Any help would be greatly appreciated.
--
The opinions stated above do not necessarily reflect those of St. Joseph's
Hospital,
The aforementioned institution takes no responsibility for the contents of
this message.
| |
| Steve Yetter 2004-03-18, 1:58 pm |
| Solution is that the format name was incorrect. Should be:
FormatName:DIRECT=OS:bizsql1\private$\to
_biztalk;journal
"Steve Yetter" <yetters@hotmail.com> wrote in message
news:e6kODXFCEHA.2560@TK2MSFTNGP12.phx.gbl...
>
> I am trying to enumerate messages in a journal for a private queue but I
> keep getting an exception that states there is an invalid parameter passed
> to a function. Here is the code.
>
> path contains a string like
> ""
>
> private int GetNumMsgsInQueue( string path )
> {
> int count = 0;
> try
> {
>
> msgQueue = new MessageQueue( path );
>
> // Get a cursor into the messages in the queue.
> msgEnumerator = msgQueue.GetMessageEnumerator();
>
> // Move to the next message and count it Doing this statement causes
the
> exception!!!!!!
> while( msgEnumerator.MoveNext() )
> {
> count++;
> }
> }
> catch( Exception ex )
> {
> MessageBox.Show( ex.Message, this.Text, MessageBoxButtons.OK,
> MessageBoxIcon.Warning );
> }
> return count;
> }
>
>
> Any help would be greatly appreciated.
> --
> The opinions stated above do not necessarily reflect those of St. Joseph's
> Hospital,
> The aforementioned institution takes no responsibility for the contents of
> this message.
>
>
| |
| Steve Yetter 2004-03-18, 1:58 pm |
| Solution is that the format name was incorrect. Should be:
FormatName:DIRECT=OS:bizsql1\private$\to
_biztalk;journal
"Steve Yetter" <yetters@hotmail.com> wrote in message
news:e6kODXFCEHA.2560@TK2MSFTNGP12.phx.gbl...
>
> I am trying to enumerate messages in a journal for a private queue but I
> keep getting an exception that states there is an invalid parameter passed
> to a function. Here is the code.
>
> path contains a string like
> " FormatName:DIRECT=OS:bizsql1\private$\to
_biztalk\journal$"
>
> private int GetNumMsgsInQueue( string path )
> {
> int count = 0;
> try
> {
>
> msgQueue = new MessageQueue( path );
>
> // Get a cursor into the messages in the queue.
> msgEnumerator = msgQueue.GetMessageEnumerator();
>
> // Move to the next message and count it Doing this statement causes
the
> exception!!!!!!
> while( msgEnumerator.MoveNext() )
> {
> count++;
> }
> }
> catch( Exception ex )
> {
> MessageBox.Show( ex.Message, this.Text, MessageBoxButtons.OK,
> MessageBoxIcon.Warning );
> }
> return count;
> }
>
>
> Any help would be greatly appreciated.
> --
> The opinions stated above do not necessarily reflect those of St. Joseph's
> Hospital,
> The aforementioned institution takes no responsibility for the contents of
> this message.
>
>
|
|
|
|
|