Hi I' m trying to port my joram application to ActiveMQ and I'm dissapointed and frustrated.
I've runned away from joram because the lack of documentation and found the same with ActiveMQ (and in Joram documentation is by far more complete than with activeMQ). :( Nevertheless, I'm interested in some features of ActiveMQ and want to try it having in mine what I want to do is not so difficult and may be somebody could help me. I've defined a simple broker like this: [code] <beans xmlns="http://activemq.org/config/1.0"> <broker useJmx="true"> <persistenceAdapter> <journaledJDBC journalLogFiles="5" dataDirectory="../activemq-data"/> </persistenceAdapter> <transportConnectors> <transportConnector uri="tcp://localhost:61666" /> </transportConnectors> </broker> </beans> [/code] My application needs to connect at startup to a RDBM to get topic names and check if them exists in Publisher. If not, they will be created. To accomplish this I used to call Joram AdminModule class that allow me to connect with the server and get all defined Topics (i'm using topics not queues), then with a TopicFactory, create nonexistent topics. After this I used to add binds of topics to Joram JNDI service to allow it to be recovered at the moment of publish a message. For example: AdminModule.connect(publisherHost, publisherPort, "root", "root", 60); User user0 = User.create("anonymous", "anonymous", 0); Topic item = (Topic) Topic.create(1, topicName); javax.jms.ConnectionFactory cf0 = TcpConnectionFactory.create(publisherHost, publisherPort); javax.naming.Context jndiCtx = new javax.naming.InitialContext(getConfiguration()); jndiCtx.bind(topicName, (Topic) item); How could I do this with ActiveMQ ??? I've tried to do this: ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://172.31.112.9:61666"); javax.jms.Connection connection = connectionFactory.createConnection(); connection.start(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); Topic topic = session.createTopic("nuevo1"); session.close(); but I'm not sure how to continue. I couldn't found examples about how to retrieve Topics from server, how to get a JNDI server to bind data, etc, etc. Could please somebody help me ? Thanks in advance J
