I'm quite new to JMS and WildFly 10.0.0.CR5
I've started with a very simple task: adding a topic to the default
server shipped with WildFly and deploy a MDB (in an EJB jar, and the EJB jar is inside an EAR) that listens on that topic. The code of the MDB is:
@MessageDriven(
activationConfig = {
@ActivationConfigProperty(propertyName = "destination", propertyValue = "java:/jms/topic/test"),
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
@ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"),
@ActivationConfigProperty(propertyName = "subscriptionName", propertyValue = "mdbTestSubscription")
},
mappedName = "java:/jms/topic/test")
public class MessageDrivenBeanTest implements MessageListener {
private static final Logger log = LoggerFactory.getLogger(MessageDrivenBeanTest.class);
/**
* Default constructor.
*/
public MessageDrivenBeanTest() {
log.info(String.format("Building <%s>", this.getClass()));
}
/**
* @see MessageListener#onMessage(Message)
*/
public void onMessage(Message message) {
log.info("Message received");
}
}
Also, I disabled the ExampleDS
that comes shipped. I will have to use mine ones.
When I try to deploy the EAR package I get the following error:
WFLYCTL0184: New missing/unsatisfied dependencies:
service jboss.naming.context.java.jboss.datasources.ExampleDS (missing) dependents: [service jboss.naming.context.java.comp."mytest-ear-0.0.1-SNAPSHOT"."mytest-jms-0.0.1-SNAPSHOT".MessageDrivenBeanTest.DefaultDataSource]
I got two questions, actually.
The first is: how do I configure correctly this DefaultDatasource
mentioned in the error?
And a more general question: why is the MDB looking for a datasource, when I never asked for that?