Qpid
  1. Qpid
  2. QPID-3817

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

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.15
    • Fix Version/s: 0.15
    • Component/s: Java Broker
    • Labels:

      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.

      1. QueueBrowserPatch.patch
        2 kB
        Praveen Murugesan

        Activity

          People

          • Assignee:
            Robbie Gemmell
            Reporter:
            Praveen Murugesan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development