August 2018
Intermediate to advanced
314 pages
8h 9m
English
The following is an example of a JMS message sender. This is a CDI bean that is responsible for sending messages:
public class MessageSender { @Inject @JMSConnectionFactory("jms/connectionFactory") JMSContext context; @Resource(mappedName = "jms/myQueue") Destination queue; public void sendSomeMessage (String message) { context.createProducer().send(queue, message); }}
The @JMSConnectionFactory annotation indicates which ConnectionFactory should be used to create the JMSContext. The following code block shows an MDB that receives the message generated by the producer described earlier:
@MessageDriven( activationConfig = { @ActivationConfigProperty( propertyName = "destinationType", propertyValue ...Read now
Unlock full access