it is absolutely no problem to connect to a ActiveMQ as standalone client. The only thing you need is to add the activemq-all-5.4.1.jar and there you go...
...
prop.put(Context.SECURITY_AUTHENTICATION , "system");
prop.put(Context.SECURITY_CREDENTIALS,"manager");
prop.put(Context.INITIAL_CONTEXT_FACTORY,"org.apache.activemq.jndi.ActiveMQInitialContextFactory");
prop.put(Context.PROVIDER_URL,"tcp://localhost:61616");
prop.put("connectionFactoryNames", "TopicCF");
prop.put("topic.topic1", "topic1");
InitialContext ctx = new InitialContext(prop);
...
Now you want to connect to Glassfish V3.x and it seems impossible to get the right libraries and classes in order to connect. While it still was possible in Glassfish V2.x I did not succeed yet to get the equivalent of above code running for Glassfish !
...
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.appserv.naming.S1ASCtxFactory");
properties.put(Context.PROVIDER_URL, "iiop://localhost:3700");
InitialContext context = new InitialContext(properties)
...
Does anyone have an answer on this ? No, I dont want to deploy an enterprise app-client just to read from a Glassfish queue. There are similar threads here, but none guides anywhere.
Thanks for any tips
Sven