Creating JMS Servers
Creating JMS Servers
Creating JMS Servers
Messagi
Creating JMS Servers
ng
Services
Similar Way Create JMS-2 with FS2 targeting to MS2
Note: If Health is not showing for JMS Servers targeted on managed server then you must apply
Patch 21830665 from oracle
Creating JMS System Module
Adding Resources to System_Module
Adding Connection Factory as Resource
Adding Queue as Resource
Adding Topic as Resource
Now run the below Program to Test
JmsUtil.java [select by ctrl+A and paste to eclipse]
package com.ktport;
import java.util.Hashtable;
import javax.jms.JMSException;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueSession;
import javax.jms.Session;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
throws NamingException
return initialContext;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.TextMessage;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import com.ktport.JmsUtil;
queueSender = queueSession.createSender(queue);
textMessage = queueSession.createTextMessage();
textMessage.setText(message);
queueSender.send(textMessage);
if(queueSender !=null)
queueSender.close();
JmsUtil.cleanUp();
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.Queue;
import javax.jms.QueueReceiver;
import javax.jms.QueueSession;
import javax.jms.TextMessage;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import com.ktport.JmsUtil;
@Override
try {
String jmsTextMessage;
} else {
jmsTextMessage = message.toString();
if (jmsTextMessage.equalsIgnoreCase("quit")) {
synchronized (this) {
quit = true;