Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. MSMQ

MSMQ

Scheduled Pinned Locked Moved C#
data-structures
14 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A AB7771

    the application is not on the server i more thing is that i am not able to create a queue on the server by executing the application from my machine Thanks Pramod

    S Offline
    S Offline
    S Akif Kamal
    wrote on last edited by
    #4

    If you are using a private queue then the format of the path for the queue will be: "FormatName:DIRECT=OS:machinename\private$\queuename" and if you are using a public queue, then the format of the path will be: "ServerName\QueueName" but remember one thing, you cannot use a private queue in ActiveDirectory environment. It can only be used in workgroup environment. Hope it will help you. Akif

    A 1 Reply Last reply
    0
    • S S Akif Kamal

      If you are using a private queue then the format of the path for the queue will be: "FormatName:DIRECT=OS:machinename\private$\queuename" and if you are using a public queue, then the format of the path will be: "ServerName\QueueName" but remember one thing, you cannot use a private queue in ActiveDirectory environment. It can only be used in workgroup environment. Hope it will help you. Akif

      A Offline
      A Offline
      AB7771
      wrote on last edited by
      #5

      The server which i am using is a XP professional machine and it does not shows Public Queue, I wanted to know whether i can create a private queue from my code on that machine, I created a queue manually by going to the computer management window, but i want to check whether a specified queue exists or not if not then it should be created Is there a way to do that. Thanks Pramod

      S 1 Reply Last reply
      0
      • A AB7771

        The server which i am using is a XP professional machine and it does not shows Public Queue, I wanted to know whether i can create a private queue from my code on that machine, I created a queue manually by going to the computer management window, but i want to check whether a specified queue exists or not if not then it should be created Is there a way to do that. Thanks Pramod

        S Offline
        S Offline
        S Akif Kamal
        wrote on last edited by
        #6

        If it is a private queue then you can check whether it exists or not. You just need to use: "FormatName:DIRECT=OS:machinename\private$\queuename" as its path and then check IsExists property. Akif

        A 1 Reply Last reply
        0
        • S S Akif Kamal

          If it is a private queue then you can check whether it exists or not. You just need to use: "FormatName:DIRECT=OS:machinename\private$\queuename" as its path and then check IsExists property. Akif

          A Offline
          A Offline
          AB7771
          wrote on last edited by
          #7

          i cannot find the isExists property can u please send me the code Thanks Pramod

          S 1 Reply Last reply
          0
          • A AB7771

            i cannot find the isExists property can u please send me the code Thanks Pramod

            S Offline
            S Offline
            S Akif Kamal
            wrote on last edited by
            #8

            Use MessageQueue.Exists(QueueName) to check whether the queue exists or not. Sorry;) it is not a property infact a static method. There is a good article on the usuage of MSMQ. Check it out[^] Akif

            A 1 Reply Last reply
            0
            • S S Akif Kamal

              Use MessageQueue.Exists(QueueName) to check whether the queue exists or not. Sorry;) it is not a property infact a static method. There is a good article on the usuage of MSMQ. Check it out[^] Akif

              A Offline
              A Offline
              AB7771
              wrote on last edited by
              #9

              i have already tried that but that throws an Exception saying "Invalid Queue PAth name" i am not able to check the existence of the Queue on the server i am able to send and Receive msgs Thanks Pramod

              S 1 Reply Last reply
              0
              • A AB7771

                i have already tried that but that throws an Exception saying "Invalid Queue PAth name" i am not able to check the existence of the Queue on the server i am able to send and Receive msgs Thanks Pramod

                S Offline
                S Offline
                S Akif Kamal
                wrote on last edited by
                #10

                "Exists cannot be called to verify the existence of a remote private queue" Syntex of the QueueNamePath is: Public queue: MachineName\QueueName Private queue: MachineName\Private$\QueueName Journal queue: MachineName\QueueName\Journal$ Machine journal queue: MachineName\Journal$ Machine dead-letter queue: MachineName\Deadletter$ Machine transactional dead-letter queue: MachineName\XactDeadletter$ Akif

                A 1 Reply Last reply
                0
                • S S Akif Kamal

                  "Exists cannot be called to verify the existence of a remote private queue" Syntex of the QueueNamePath is: Public queue: MachineName\QueueName Private queue: MachineName\Private$\QueueName Journal queue: MachineName\QueueName\Journal$ Machine journal queue: MachineName\Journal$ Machine dead-letter queue: MachineName\Deadletter$ Machine transactional dead-letter queue: MachineName\XactDeadletter$ Akif

                  A Offline
                  A Offline
                  AB7771
                  wrote on last edited by
                  #11

                  then how should one check whether a Queue exists or not we cannot directly send or receive msgs whether checking the existence of the queue Thanks, Pramod

                  S 1 Reply Last reply
                  0
                  • A AB7771

                    then how should one check whether a Queue exists or not we cannot directly send or receive msgs whether checking the existence of the queue Thanks, Pramod

                    S Offline
                    S Offline
                    S Akif Kamal
                    wrote on last edited by
                    #12

                    You can go for public queues. In that case, you ll be able to check its existance. If you want to use private queues, the dirty way of finding whether the queue exists is to create the queue with the path specified and then catching the exception. If the path is wrong, then its object will not be created and an exception will be raised. Hope it will help you :) Akif

                    R 1 Reply Last reply
                    0
                    • S S Akif Kamal

                      You can go for public queues. In that case, you ll be able to check its existance. If you want to use private queues, the dirty way of finding whether the queue exists is to create the queue with the path specified and then catching the exception. If the path is wrong, then its object will not be created and an exception will be raised. Hope it will help you :) Akif

                      R Offline
                      R Offline
                      Ricardo Casquete
                      wrote on last edited by
                      #13

                      Ugly but true the biggest problem is the that you have to use a different "SYNTAX" when accessing the queue depending if you are reading / creating.... Basically to create the queue you have to use PATH NAME, tipically when you are reading you are using Format Name instance.msmq = new MessageQueue ( @"FormatName:DIRECT=OS:vircs-d2gs01\private$\InstrumentationQueue" ); MessageQueue.Create ( @".\private$\InstrumentationQueue" ); Good link about Queues names http://blogs.msdn.com/johnbreakwell/archive/2009/02/26/difference-between-path-name-and-format-name-when-accessing-msmq-queues.aspx[^]

                      Ricardo Casquete

                      1 Reply Last reply
                      0
                      • A AB7771

                        Hi all, i have written a small program in which i want to check whether a Queue exists and for this i used the Exists method of the MessageQueue but i throws an Exception saying that " Cannot determine whether a queue with the specified format name exists" Anyone knows wht is the right way to check that Thanks Pramod

                        R Offline
                        R Offline
                        Ricardo Casquete
                        wrote on last edited by
                        #14

                        the biggest problem is the that you have to use a different "SYNTAX" when accessing the queue depending if you are reading / creating.... Basically to create the queue you have to use PATH NAME, tipically when you are reading you are using Format Name instance.msmq = new MessageQueue ( @"FormatName:DIRECT=OS:vircs-d2gs01\private$\InstrumentationQueue" ); MessageQueue.Create ( @".\private$\InstrumentationQueue" ); Good link about Queues names http://blogs.msdn.com/johnbreakwell/archive/2009/02/26/difference-between-path-name-and-format-name-when-accessing-msmq-queues.aspx[^]

                        Ricardo Casquete

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups