HornetQ in Tomcat

Greeting ,

Just came on board Tikal (did not send yet a picture to lee)

 

I need a messaging queue implementation on tomcat

And I'm thinking of Jboss HornetQ.

 

Any one done it lately ?

 

Thanks,

Alon

Comments

 Hello, Alon.

 

Welcome aboard! :)

 

What are your requirements? If you don't have to be JMS compatible, you can also look at RabbitMQ.

Thanks,

I need it for large scle inner (in memory ) aync operations , not really bound to JMS

 if cluster and high availability are not the issue , use RabbitMQ

Can RabbitMQ run ontop tomcat ?

Can you direct me to a setup link? 

 

 

 Hi Alon,

 

We are using HornetQ for NMS application. The application deployed in Tomcat, but the messaging queue is running in yet another JVM.

 

Can you detail more about your requirements ? Are there any firewalls ? Are messages distributed over LAN or WAN ? What are the performance requirements etc?

In this case my Tomcat needs to handle request synchronically .
Internally in the tomcat no clustering , no persistence - an in memory queue - around 1000 messages in queue

 

The HornetQ is deployed on tomcat - copyed the jars and conf file to lib and conf folders

  

TransportConfiguration transportConfiguration = new TransportConfiguration( NettyConnectorFactory.class.getName());

HornetQConnectionFactory cf = HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, transportConfiguration);

 

Queue orderQueue = HornetQJMSClient.createQueue("test");

Connection connection = cf.createConnection();

 

Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

MessageProducer producer = session.createProducer(orderQueue);

MessageConsumer consumer = session.createConsumer(orderQueue);

connection.start();

TextMessage message = session.createTextMessage("This is an order");

producer.send(message);

TextMessage receivedMessage = (TextMessage)consumer.receive();

System.out.println("Got order: " + receivedMessage.getText());

 

 But I get " ......JMSException: Failed to create session factory......Cannot connect to server(s)."  

Got it to work with code sample from 

hornetq-2.2.5.Final\examples\core\embedded\src\org\hornetq\core\example\EmbeddedExample.java