Runtime tools : Service components : Smart channel services : Smart data collector : JMS : JMS handler in server side
  
JMS handler in server side
Prerequisite: To collect the data by JMS pattern in the client side, perform the following steps:
1 Refer to the general steps in Server collector, and configure the JMS collecting pattern using the following codes:
<SmartDataCollectJMSImpl id="jmsDAOImpl" jmsConnectionFactory="jms/SmartChannelCF" jmsSendQueue="jms/SmartQueue"></SmartDataCollectJMSImpl>
<SmartDataCollectDefaultImpl
id="smartDAOImpl"> </SmartDataCollectDefaultImpl>
<SmartCollectorConfig id="smartCollectorConfig" smartDAO="jmsDAOImpl ">
<ref Injection="transactionCollectorConfig"
refId="TransactionDataCollectorConfig"></ref>
</SmartCollectorConfig>
The smartDAO should be set as smartDAOImpl or jmsDAOImpl. If it's set as jmsDAOImpl, it uses the JMS collecting pattern.
2 Create an MDBEJB project named SmartChannelJMSHandlerEJB and create a Bean implementation class for Enterprise Bean. Following is the sample code for the Bean class SmartDataJMSHandlerMDB:
package com.ibm.btt.channel.smart.dao.jms;
import com.ibm.btt.channel.smart.jmshandler.SmartJMSHandler;
/**
* Bean implementation class for Enterprise Bean: SmartDataJMSHandlerMDB
*/
public class SmartDataJMSHandlerMDBBean extends SmartJMSHandler implements javax.ejb.MessageDrivenBean,javax.jms.MessageListener{
/**
* ejbRemove
*/
public void ejbRemove() {
}
/**
* ejbCreate
*/
public void ejbCreate() {
}
private javax.ejb.MessageDrivenContext fMessageDrivenCtx;

/**
* getMessageDrivenContext
*/
public javax.ejb.MessageDrivenContext getMessageDrivenContext() {
return fMessageDrivenCtx;
}
/**
* setMessageDrivenContext
*/
public void setMessageDrivenContext(javax.ejb.MessageDrivenContext ctx) {
fMessageDrivenCtx = ctx;
}
}
Configure the file ibm-ejb-jar-bnd.xml as following codes:
<ejbbnd:EJBJarBinding
xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ejb="ejb.xmi"
xmlns:ejbbnd="ejbbnd.xmi" xmi:id="EJBJarBinding_1260934833875">
<ejbJar href="META-INF/ejb-jar.xml#ejb-jar_ID"/>
<ejbBindings xmi:type="ejbbnd:MessageDrivenBeanBinding"
xmi:id="MessageDrivenBeanBinding_1260934833875"activationSpecJndiName="jms/SmartActSpec" destinationJndiName="jms/SmartQueue"> <enterpriseBean xmi:type="ejb:MessageDriven"
href="META-INF/ejb-jar.xml#SmartDataJMSHandlerMDB"/>
</ejbBindings>
</ejbbnd:EJBJarBinding>
3 Configure the JMS in WebSphere admin console as following configuration:
<SmartDataCollectJMSImpl id="jmsDAOImpl" jmsConnectionFactory="jms/SmartChannelCF" jmsSendQueue="jms/SmartQueue">
Create a connection factory: JNDI name:jms/SmartChannelCF(should be the same with the jmsConnectionFactory field that set in the smart configuration file. In this case, the file is SmartChannelDataCollect.xml);
Create a queue: JNDI name:jms/SmartQueue (should be the same with the jmsSendQueue field that set in the smart configuration file. In this case, the file is SmartChannelDataCollect.xml);
Create an activation specification: JNDI name:jms/SmartActSpec (should be the same with the activationSpecJndiName field that set in the MDB EJB project ibm-ejb-jar-bnd.xml).
Go up to
JMS