Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help need with JMS Listener in WSAD

 
Max Tomlinson
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi �
I�m trying to activate the pre-configured JMS Listener in WSADIE 5 with a JSP.
I coded the Sample: �Creating a JMS enterprise service from a Java class (JMS service)� which uses the stock quote example and it works fine with the Session Bean client.
Now I want to invoke the MDB with a JSP but the MDB does not get invoked:
It appears to write to the queue but I the MDB does not get invoked:
Note: If I uncomment the qSession.commit(), I get a transactional error:
MQJMS1019: invalid operation for non-transacted session
JSP code:
QueueConnectionFactory qcf = (QueueConnectionFactory) env.lookup("jms/QCF");
QueueConnection qc = qcf.createQueueConnection();
out.println("
jms/QCF "+" found");
QueueSession qSession = qc.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
//Queue q = (Queue) env.lookup("jms/receiverQ");
//out.println("
jms/receiverQ "+" found");
Queue q = (Queue) env.lookup("jms/senderQ");
out.println("
jms/senderQ "+" found");

QueueSender sender = qSession.createSender(q);
TextMessage msg = qSession.createTextMessage();
msg.setText("bla bla bla");
sender.send(msg);
//qSession.commit();
out.println("
msg sent");
 
Matthias Hein
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Max,
have you ever found a solution to this problem?
I ran into the same message MQJMS1019 trying to do a queueSession.commit().
I have thread A sending messages into the queue and thread B retrieving those messages. Problem is, that without the commit() thread B only starts getting messages after thread A disconnects.
Both threads run within WAS 5.1 EJB-Containers.


Originally posted by Max Tomlinson:
Hi �
I�m trying to activate the pre-configured JMS Listener in WSADIE 5 with a JSP.

I coded the Sample: �Creating a JMS enterprise service from a Java class (JMS service)� which uses the stock quote example and it works fine with the Session Bean client.

Now I want to invoke the MDB with a JSP but the MDB does not get invoked:

It appears to write to the queue but I the MDB does not get invoked:

Note: If I uncomment the qSession.commit(), I get a transactional error:

MQJMS1019: invalid operation for non-transacted session

JSP code:

QueueConnectionFactory qcf = (QueueConnectionFactory) env.lookup("jms/QCF");
QueueConnection qc = qcf.createQueueConnection();
out.println("
jms/QCF "+" found");
QueueSession qSession = qc.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
//Queue q = (Queue) env.lookup("jms/receiverQ");
//out.println("
jms/receiverQ "+" found");
Queue q = (Queue) env.lookup("jms/senderQ");
out.println("
jms/senderQ "+" found");

QueueSender sender = qSession.createSender(q);

TextMessage msg = qSession.createTextMessage();
msg.setText("bla bla bla");
sender.send(msg);
//qSession.commit();
out.println("
msg sent");
 
Vikrama Sanjeeva
Ranch Hand
Posts: 760
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Do true in the following code



Viki
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic