Through my use of other JMS providers such as OpenJMS, SonicMQ and a few others
I've never seen a provider deny the creation of a topic through session.createTopic()
if the topic hasn't been administratively added. I thought this was quite interesting
as it doesn't make much sense having to administratively create non-durable topics.
Looking through the code I came across JMSDestinationManager.java. I changed the
code to automatically create the destination if it doesn't exist. Here are the
relevant changes.
file: org/jboss/mq/server/JMSDestinationManager.java
|
| /**
| * #Description of the Method
| *
| * @param dc Description of Parameter
| * @param name Description of Parameter
| * @return Description of the Returned Value
| * @exception JMSException Description of Exception
| */
| public Topic createTopic(ConnectionToken dc, String name) throws JMSException
| {
| SpyTopic newTopic = new SpyTopic(name);
| if (!destinations.containsKey(newTopic))
| {
| /** Instead of denying the topic, just add a new topic if it
didnt exist */
| JMSTopic jmsTopic = new JMSTopic (newTopic, null, this, new
BasicQueueParameters());
|
| // throw new JMSException("This destination does not exist !");
| addDestination (jmsTopic);
| }
| return newTopic;
| }
|
Now this appears to work so that JBossMQ is a little more consistent with other
providers that allow true dynamic topic creation through session.createTopic (). I
understand the JMS Spec doesn't say that createTopic needs to create a new topic if it
doesn't exist but it's always nice to place well with others. :)
There is one problem with this approach that I see off hand and that is no MBean
gets associated with the Topic. In and of itself that isn't too bad because I dont
want to admin these topics anyways. What other problems could arise from this solution
that I may not be aware of?
Andrew T. Finnell
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3835952#3835952
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3835952
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user