Valid 1Z0-895 Dumps shared by ExamDiscuss.com for Helping Passing 1Z0-895 Exam! ExamDiscuss.com now offer the newest 1Z0-895 exam dumps, the ExamDiscuss.com 1Z0-895 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com 1Z0-895 dumps with Test Engine here:
You are writing a client that sends a message to a JMS queue. Which statement is true?
Correct Answer: A
Explanation/Reference: Note: The SimpleMessageClient sends messages to the queue that the SimpleMessageBean listens to. The client starts by injecting the connection factory and queue resources: @ Resource(mappedName="jms/ConnectionFactory") private static ConnectionFactory connectionFactory; @ Resource(mappedName="jms/Queue") private static Queue queue; Next, the client creates the connection, session, and message producer: connection = connectionFactory.createConnection(); session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); messageProducer = session.createProducer(queue); Finally, the client sends several messages to the queue: message = session.createTextMessage(); for (int i = 0; i < NUM_MSGS; i++) { message.setText("This is message " + (i + 1)); System.out.println("Sending message: " + message.getText()); messageProducer.send(message); }