google Analytics

Thursday, July 8, 2010

Message Driven Bean 3.0

Message Driven Bean(MDB) 3.0 Exampe:--

import javax.ejb.MessageDriven;

import javax.ejb.ActivationConfigProperty;

import javax.jms.Message;

import javax.jms.MessageListener;

/**

*

* @author NathA1

*

*/

@MessageDriven(activationConfig =

{

@ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),

@ActivationConfigProperty(propertyName="destination", propertyValue="queue/anish"),

@ActivationConfigProperty(propertyName ="acknowledgeMode",propertyValue = "Auto-acknowledge"),

@ActivationConfigProperty(propertyName ="subscriptionDurability",propertyValue = "NonDurable"),

@ActivationConfigProperty(propertyName = "messageSelector",propertyValue = "Priority = ‘HIGH'"),

@ActivationConfigProperty(propertyName = "minSession",propertyValue = "1"),

@ActivationConfigProperty(propertyName = "maxSession",propertyValue = "15"),

@ActivationConfigProperty(propertyName = "maxMessages",propertyValue = "1")

})

public class MyMdb implements MessageListener {

@Override

public void onMessage(Message arg0) {

// TODO Auto-generated method stub

}

}

No comments:

Post a Comment