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

JMS

 
hai hello
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a beginner in JMS.Could anyone give me an idea of how to implement a message driven bean in JBoss.plz give a sample ejb and jboss jar file.
i want immediate reply .plz.................
 
Justin joseph
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JBOSS 3.2.5

CREATE A QUEUE BY ADDING ENTRY IN ...\deploy\jmsjbossmq-destinations-service.xml

WRITE MDB. SAMPLE IS:



import javax.ejb.MessageDrivenBean;
import javax.ejb.MessageDrivenContext;
import javax.jms.Message;
import javax.jms.MessageListener;


public abstract class MessageBean1
implements MessageDrivenBean, MessageListener {
MessageDrivenContext ctx;


/**
* Sets the context.
*
* @param ctx MessageDrivenContext Context for bean session
*/
public void setMessageDrivenContext(MessageDrivenContext ctx) {
this.ctx = ctx;
}
/**
* This method is required by the EJB Specification,
*
*/
public void ejbCreate() {

}
/**
* This method is required by the EJB Specification,
*
*
*/
public void ejbRemove() {
}


public void onMessage(Message message) {
//WRITE CODE HERE
}

}


WRITE DEPLOYEMENT DESCRIPTOR AND MENTION QUEUE NAME UNDER:
<destination-jndi-name>

PACKAGE IT AND DEPLOY AS JAR.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic