Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Distinguishing between topics and queues

3 views
Skip to first unread message

Riad

unread,
Feb 3, 2004, 4:11:38 PM2/3/04
to

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 <new_JMSTopic_1>
queue name: <new_JMSTopic_1>
weblogic.jms.common.InvalidDestinationException: Destination must be a queue,
ne
w_JMSTopic_1
at weblogic.jms.common.Destination.checkDestinationType(Destination.java
:113)
at weblogic.jms.client.JMSSession.createBrowser(JMSSession.java:1516)
at weblogic.jms.client.JMSSession.createBrowser(JMSSession.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

Tom Barnes

unread,
Feb 3, 2004, 5:53:36 PM2/3/04
to Riad
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

unread,
Feb 3, 2004, 6:56:42 PM2/3/04
to

Cool. Thanks for your help Tom.

Riad

0 new messages