Well, if I use ActiveMQ's "dynamicTopics/xxx" naming scheme at both ends (pub
and sub connect to "dynamicTopic/SmsTopic") it works.
I would like to use JMS for portability, though.
hretter wrote:
>
> Using tomcat/openejb, I'm trying to create a JMS Topic for use by a web
> application and remote clients. So far, I have the following code that
> returns a valid TopicConnectionFactory.
>
> Properties properties = new Properties();
> properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
> "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
> properties.setProperty(Context.PROVIDER_URL,
> "tcp://localhost:61616");
>
> InitialContext context = new InitialContext(properties);
> TopicConnectionFactory conFactory =
> (TopicConnectionFactory)
> context.lookup("TopicConnectionFactory");
>
> // this code lifted from openejb examples JNDIServlet
> Map<String, Object> bindings = new TreeMap<String,
> Object>(String.CASE_INSENSITIVE_ORDER);
> addBindings("", bindings, context);
> printBindings(bindings);
>
> printBindings outputs this:
>
> JNDI Context:
>
> connectionfactory=org.apache.activemq.activemqconnectionfact...@1d686c1
> dynamicQueues=
> dynamicTopics=
>
> queueconnectionfactory=org.apache.activemq.activemqconnectionfact...@128edf2
>
> topicconnectionfactory=org.apache.activemq.activemqconnectionfact...@1dddba
>
> What do I have to add to openejb.xml to define my topic "jms/SmsTopic"?
> I have tried putting this in openejb.xml:
>
> <Resource id="jms/SmsTopic" type="javax.jms.Topic">
> destination smsTopic
> </Resource>
>
>
> Thanks.
>
>
--
View this message in context:
http://www.nabble.com/JMS-Topic-and-ActiveMQ-tp21728285p21732376.html
Sent from the OpenEJB User mailing list archive at Nabble.com.