June 2018
Intermediate to advanced
252 pages
6h 45m
English
As mentioned earlier, the consumer in JMS can be any object or component; however, it's typically an MDB in Java EE. We will discuss message-driven beans in a separate section, but we are going to create a simple one now for the purpose of our demonstration example:
@MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destinationLookup", propertyValue = "jms/ticketsReservationTopic") , @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic") }) public class ReservationBean implements MessageListener { @Override public void onMessage(Message msg) { try { System.out.println("********* " + ((TextMessage) msg).getText()); } catch (JMSException ex) { ex.printStackTrace(); ...Read now
Unlock full access