Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-3817

QueueBrowser creation does not work with Address syntax via 'destination.' entries in JNDI properties files

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.15
    • 0.15
    • Broker-J

    Description

      I create my queue using the JNDI properties, and when I try to create a queue browser from the Destination object, I get the
      java.lang.ClassCastException: org.apache.qpid.client.AMQAnyDestination cannot be cast to org.apache.qpid.client.AMQQueue
      at org.apache.qpid.client.AMQSession.createBrowser(AMQSession.java:963)
      at org.apache.qpid.client.AMQSession.createBrowser(AMQSession.java:950)

      A sample code snippet is below; (just to give an idea).

      Properties properties = new Properties();
      String queueAddress = "T1;{create: always , node : {type : queue, durable : true}}"
      properties.put("destination.T1", queueAddress);
      InitialContext ctx = new InitialContext(properties);
      Destination queue = (Destination) ctx.lookup(queueName);

      QueueBrowser queueBrowser = qpidSession.createBrowser(queueRef);

      triggers =>
      java.lang.ClassCastException: org.apache.qpid.client.AMQAnyDestination cannot be cast to org.apache.qpid.client.AMQQueue
      at org.apache.qpid.client.AMQSession.createBrowser(AMQSession.java:963)
      at org.apache.qpid.client.AMQSession.createBrowser(AMQSession.java:950)

      The createBrowser call is part of JMS. However this part of the API cannot
      be used with Destinations defined using the addressing scheme.

      Attachments

        1. QueueBrowserPatch.patch
          2 kB
          Praveen Murugesan

        Activity

          People

            robbie Robbie Gemmell
            lefthandmagic Praveen Murugesan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: