2016-04-21 116 views

回答

1

这个工作对我来说:

@MessageDriven(name = "VerySimpleMDB", activationConfig = { 
     @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"), 
     @ActivationConfigProperty(propertyName = "destination", propertyValue = "/jms/topic/targetTopic"), 
     @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"), 
     @ActivationConfigProperty(propertyName = "useJNDI",propertyValue = "true"), 
     @ActivationConfigProperty(propertyName = "clientID", propertyValue = "quickuser"), 
     @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"), 
     @ActivationConfigProperty(propertyName = "subscriptionName", propertyValue = "topicBridge"), 
     @ActivationConfigProperty(propertyName = "shareSubscriptions", propertyValue="true"), 
     @ActivationConfigProperty(propertyName = "hA", propertyValue = "true") 
},mappedName = "java:jboss/jms/topic/targetTopic") 

public class VerySimpleMDB implements MessageListener {