Java Reference
In-Depth Information
try {
final String text =
message.getBody(String.class);
logger.info("Received message " + text);
} catch (JMSException ex) {
logger.severe(ex.toString());
}
}
}
Once a message is received, it is written to a console. This means that it is time to deploy
our application. If your ActiveMQ broker is running, you should see the following similar
messages during the deployment phase:
19:59:59,452 INFO
[org.apache.activemq.ra.ActiveMQEndpointWorker]
(ServerService Thread Pool -- 65) Starting
19:59:59,458 INFO
[org.apache.activemq.ra.ActiveMQEndpointWorker]
(default-threads - 1) Establishing connection to broker
[tcp://localhost:61616]
19:59:59,573 INFO
[javax.enterprise.resource.webcontainer.jsf.config] (MSC
service thread 1-5) Initializing Mojarra 2.2.5-jbossorg-3
20140128-1641 for context '/ticket-agency-jms'
19:59:59,618 INFO
[org.apache.activemq.ra.ActiveMQEndpointWorker]
(default-threads - 1) Successfully established connection
to broker [tcp://localhost:61616]
20:00:00,053 INFO [org.wildfly.extension.undertow] (MSC
service thread 1-5) JBAS017534: Registered web context:
/ticket-agency-jms
20:00:00,081 INFO [org.jboss.as.server]
(DeploymentScanner-threads - 1) JBAS018559: Deployed
"ticket-agency-jms.war" (runtime-name :
"ticket-agency-jms.war")
Now it is time to test our connection using the ActiveMQ console, which will send a mes-
sage straight to the ActiveMQ broker. ActiveMQ 5.9.0 is equipped with a bundled
Search WWH ::




Custom Search