vichandoko
Sep 12th, 2005, 11:31 PM
Hi,
Am using Spring 1.0, which doesnt have JMS module included.
How could i integrate my application with Spring for the version 1.0?
Following are the portion of the codes that i would write without Spring consideration:
try{
QueueConnectionFactory qcf = (QueueConnectionFactory)
(new InitialContext().lookup("ConnectionFactory"));
QueueConnection conn = qcf.createQueueConnection();
Queue queue = (Queue) (new InitialContext().lookup("queue/A"));
QueueSession session = conn.createQueueSession(false,
QueueSession.AUTO_ACKNOWLEDGE);
conn.start();
QueueSender send = session.createSender(queue);
TextMessage message = session.createTextMessage();
send.send(message);
}catch(JMSException e1){
} catch (NamingException e) {
}
Instead of doing JNDI lookup for the Queue and Connection Factory, could i look it up from Spring bean factory instead? How should i write my bean factory xml then?
Any other suggestion?
And i've tried to extend my MDB from AbstractJmsMessageDrivenBean. However during deployment (in Jboss) it still forces me to implement a ejbCreate() method. Should that be the case?
Thanks much.
Veny
Am using Spring 1.0, which doesnt have JMS module included.
How could i integrate my application with Spring for the version 1.0?
Following are the portion of the codes that i would write without Spring consideration:
try{
QueueConnectionFactory qcf = (QueueConnectionFactory)
(new InitialContext().lookup("ConnectionFactory"));
QueueConnection conn = qcf.createQueueConnection();
Queue queue = (Queue) (new InitialContext().lookup("queue/A"));
QueueSession session = conn.createQueueSession(false,
QueueSession.AUTO_ACKNOWLEDGE);
conn.start();
QueueSender send = session.createSender(queue);
TextMessage message = session.createTextMessage();
send.send(message);
}catch(JMSException e1){
} catch (NamingException e) {
}
Instead of doing JNDI lookup for the Queue and Connection Factory, could i look it up from Spring bean factory instead? How should i write my bean factory xml then?
Any other suggestion?
And i've tried to extend my MDB from AbstractJmsMessageDrivenBean. However during deployment (in Jboss) it still forces me to implement a ejbCreate() method. Should that be the case?
Thanks much.
Veny