activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Dynamic Topic or just Temporary topic ?
Date Tue, 04 Apr 2006 10:51:18 GMT
A temporary topic exists only on one client JVM and ceases to exist
when the client goes away.

A topic can be created at any time in various ways (using
createTopic(), JNDI or JMX).

Only topics with persistent messages on them survive broker re-starts.
For non-durable topics, they are just created on demand first time
they are used.

James

On 4/4/06, guillermolalsacien <guillermo@sun.com> wrote:
>
> I need to create Topics dynamically with the following code:
>
> Topic topic = null;
> connectionFactory = new ActiveMQConnectionFactory( PROVIDER_URL  );
> Connection connection = connectionFactory.createConnection();
> Session s = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
> topic = s.createTopic(name);
>
> I have checked in the JConsole that the topic was succesfully created.
> I run this code in another to machine to locate the Topic:
>
> Topic topic = (Topic) ctx.lookup("dynamicTopics/" + name);
>
> It also works fine, the problem is that when I stop the broker the Topic
> isn't there once restarted.
>
> So my question is what is the difference between a temporary topic and this
> kind of topic ? How can I create and share a dynamic topic and make it last
> ?
>
> I've also seen in the documents that it is possible to bind destinations in
> the JNDI context like other JMS providers do, but since it is a
> ReadOnlyContext how should I do that ?
> --
> View this message in context: http://www.nabble.com/Dynamic-Topic-or-just-Temporary-topic--t1392171.html#a3741731
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


--

James
-------
http://radio.weblogs.com/0112098/

Mime
View raw message