Distinguishing between topics and queues - Weblogic

This is a discussion on Distinguishing between topics and queues - Weblogic ; Hi, I have a generic piece of code that takes a javax.jms.Destination that does different things depending if the destination is a queue or a topic. The problem is that it seems that destinations in Weblogic implement both queue and ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Distinguishing between topics and queues

  1. Distinguishing between topics and queues


    Hi,

    I have a generic piece of code that takes a javax.jms.Destination that does different
    things depending if the destination is a queue or a topic.

    The problem is that it seems that destinations in Weblogic implement both queue
    and topic:
    instanceof queue
    queue name:
    weblogic.jms.common.InvalidDestinationException: Destination must be a queue,
    ne
    w_JMSTopic_1
    at weblogic.jms.common.Destination.checkDestinationTy pe(Destination.java
    :113)
    at weblogic.jms.client.JMSSession.createBrowser(JMSSe ssion.java:1516)
    at weblogic.jms.client.JMSSession.createBrowser(JMSSe ssion.java:1500)
    at Test.run(Test.java:100)
    at Test.main(Test.java:311)

    Is there anyway for me to programatically distinguish between queues and topics
    as there seems not to be any javadoc on weblogic.jms.common.Destination and instanceof
    does not work? I would prefer not to rely on exceptions.

    I'm using Weblogic 8.1 sp2.

    Thanks
    Riad

  2. Re: Distinguishing between topics and queues

    Hi Riad,

    This has come up before.

    For now, you may cast dest to weblogic.jms.common.DestinationImpl
    and call "isQueue()". Normally, only the javadoc'd methods
    in weblogic.jms.extensions are intended for public use,
    but for this case we make an exception.

    In the next release, this method will be exposed through
    a new public WL JMS API extension:
    weblogic.jms.extensions.WLDestination,
    and might not be available otherwise.

    Tom, BEA

    P.S. A java tip: The JDK's built-in "javap"
    is useful for viewing an arbitrary class api.
    As in "javap weblogic.jms.extensions.JMSHelper".

    Riad wrote:
    > Hi,
    >
    > I have a generic piece of code that takes a javax.jms.Destination that does different
    > things depending if the destination is a queue or a topic.
    >
    > The problem is that it seems that destinations in Weblogic implement both queue
    > and topic:
    > instanceof queue
    > queue name:
    > weblogic.jms.common.InvalidDestinationException: Destination must be a queue,
    > ne
    > w_JMSTopic_1
    > at weblogic.jms.common.Destination.checkDestinationTy pe(Destination.java
    > :113)
    > at weblogic.jms.client.JMSSession.createBrowser(JMSSe ssion.java:1516)
    > at weblogic.jms.client.JMSSession.createBrowser(JMSSe ssion.java:1500)
    > at Test.run(Test.java:100)
    > at Test.main(Test.java:311)
    >
    > Is there anyway for me to programatically distinguish between queues and topics
    > as there seems not to be any javadoc on weblogic.jms.common.Destination and instanceof
    > does not work? I would prefer not to rely on exceptions.
    >
    > I'm using Weblogic 8.1 sp2.
    >
    > Thanks
    > Riad



  3. Re: Distinguishing between topics and queues


    Cool. Thanks for your help Tom.

    Riad

    Tom Barnes wrote:
    >Hi Riad,
    >
    >This has come up before.
    >
    >For now, you may cast dest to weblogic.jms.common.DestinationImpl
    >and call "isQueue()". Normally, only the javadoc'd methods
    >in weblogic.jms.extensions are intended for public use,
    >but for this case we make an exception.
    >
    >In the next release, this method will be exposed through
    >a new public WL JMS API extension:
    >weblogic.jms.extensions.WLDestination,
    >and might not be available otherwise.
    >
    >Tom, BEA
    >
    >P.S. A java tip: The JDK's built-in "javap"
    >is useful for viewing an arbitrary class api.
    >As in "javap weblogic.jms.extensions.JMSHelper".
    >
    >Riad wrote:
    >> Hi,
    >>
    >> I have a generic piece of code that takes a javax.jms.Destination that

    >does different
    >> things depending if the destination is a queue or a topic.
    >>
    >> The problem is that it seems that destinations in Weblogic implement

    >both queue
    >> and topic:
    >> instanceof queue
    >> queue name:
    >> weblogic.jms.common.InvalidDestinationException: Destination must be

    >a queue,
    >> ne
    >> w_JMSTopic_1
    >> at weblogic.jms.common.Destination.checkDestinationTy pe(Destination.java
    >> :113)
    >> at weblogic.jms.client.JMSSession.createBrowser(JMSSe ssion.java:1516)
    >> at weblogic.jms.client.JMSSession.createBrowser(JMSSe ssion.java:1500)
    >> at Test.run(Test.java:100)
    >> at Test.main(Test.java:311)
    >>
    >> Is there anyway for me to programatically distinguish between queues

    >and topics
    >> as there seems not to be any javadoc on weblogic.jms.common.Destination

    >and instanceof
    >> does not work? I would prefer not to rely on exceptions.
    >>
    >> I'm using Weblogic 8.1 sp2.
    >>
    >> Thanks
    >> Riad

    >



+ Reply to Thread