I have a little issue about configuring JMS on Thorntail. In my project for development purpose I'm using Wildfly, but for remote server, we are using (my team) IBM Portal. I upgraded the local server from Wildfly to Thorntail and after I want to launch my app locally (using maven), it crashed. I looked into logs and I found that it gives my:
2019-12-04 10:49:50,957 ERROR [org.jboss.as.controller.management-operation] (main) WFLYCTL0013: Operation ("add") failed - address: (("deployment" => "myproject.war")) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.module.myproject.env.jms.notification"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.naming.context.java.module.myproject.env.\"myproject.notifications.service.impl.JmsNotificationServiceImpl\".connectionFactory is missing [jboss.naming.context.java.module.myproject.env.jms.notification]",
"jboss.naming.context.java.module.myproject.env.\"myproject.notifications.service.impl.JmsNotificationServiceImpl\".topic is missing [jboss.naming.context.java.module.myproject.env.jms.notification]"
]
}
2019-12-04 10:49:50,994 ERROR [org.jboss.as.server] (main) WFLYSRV0021: Deploy of deployment "myproject.war" was rolled back with the following failure message:
{
"WFLYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.module.myproject.env.jms.notification"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.naming.context.java.module.myproject.env.\"myproject.notifications.service.impl.JmsNotificationServiceImpl\".connectionFactory is missing [jboss.naming.context.java.module.myproject.env.jms.notification]",
"jboss.naming.context.java.module.myproject.env.\"myproject.notifications.service.impl.JmsNotificationServiceImpl\".topic is missing [jboss.naming.context.java.module.myproject.env.jms.notification]"
]
}
In our local environment we didn't configured any queue for JMS purposes, becouse our main queue mechanism was on remote server (IBM Portal). There is some code we are using:
public class JmsNotificationServiceImpl implements JmsNotificationService {
@Resource(lookup = "jms/notificationCF")
private ConnectionFactory connectionFactory;
@Resource(lookup = "jms/topic/notification")
private Topic topic;
@Override
public void send(String string) throws Exception {
Connection connection = null;
try {
connection = connectionFactory.createConnection();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = session.createProducer(topic);
log.info("Sending JMS message to topic...");
producer.send(session.createObjectMessage(string));
log.info("Message sent succesfull.");
} catch (JMSException e) {
throw new Exception("Error while creation or sending jms message", e);
}
}
}
I found that there is a build in ActiveMQ in Thorntail, but I don't really know how to configure ConnectionFactory and Topic in ActiveMQ. Could anyone help me to understand where put some configuration and how to configure it?
Minimalistic project-defaults.yml That allows your thorntail instance to connect to an remote Message Broker
Requires the following dependency to be included: