aspose file tools*
The moose likes JBoss/WildFly and the fly likes JMS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JMS" Watch "JMS" New topic
Author

JMS

hai hello
Greenhorn

Joined: Sep 01, 2004
Posts: 5
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

Joined: Aug 03, 2004
Posts: 27
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.


thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JMS