tag:blogger.com,1999:blog-2931801055574939054.post1970614919104671360..comments2024-03-28T02:26:29.934-07:00Comments on iPaaS@ORACLE.CLOUD: OSB and JMS Correlation Part 2Niall Commiskeyhttp://www.blogger.com/profile/18194777332788452768noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-2931801055574939054.post-89682345942259251572012-11-06T05:31:37.111-08:002012-11-06T05:31:37.111-08:00Yes you can build this in Jdev.
import java.util....Yes you can build this in Jdev.<br /><br />import java.util.Hashtable;<br /><br />import javax.jms.JMSException;<br />import javax.jms.Queue;<br />import javax.jms.QueueConnection;<br />import javax.jms.QueueConnectionFactory;<br />import javax.jms.QueueSender;<br />import javax.jms.QueueSession;<br />import javax.jms.TextMessage;<br /><br />import javax.naming.Context;<br />import javax.naming.InitialContext;<br />import javax.naming.NamingException;<br />Niall Commiskeyhttps://www.blogger.com/profile/18194777332788452768noreply@blogger.comtag:blogger.com,1999:blog-2931801055574939054.post-89552080421587228772012-11-02T19:02:55.489-07:002012-11-02T19:02:55.489-07:00Thanks a lot Niall for your update on my comments....Thanks a lot Niall for your update on my comments. I have few more. <br /><br />1). Do i need to add any imports on top of java class? <br /><br />2). Can i build this Java class in JDEVELOPER using JAVA Application.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2931801055574939054.post-3605237833973638852012-11-02T00:49:52.801-07:002012-11-02T00:49:52.801-07:00Here is sample JMS client code -
public void ...Here is sample JMS client code -<br /><br /> public void write2Q(String msg) throws JMSException, NamingException {<br /> final Context ic = getInitialContext();<br /> System.out.println("*** CONTEXT =");<br /> final QueueConnectionFactory qcf = (QueueConnectionFactory)ic.lookup("jms/MyQCF");<br /> // Lookup should specify the queue name that is mentioned as "mappedName" in MessageDriven Bean.<br /> final Queue destQueue = (Queue)ic.lookup("jms/MyQueue");<br /> <br /> final QueueConnection connection = qcf.createQueueConnection();<br /> try {<br /> final QueueSession session = connection.createQueueSession(false, 0);<br /> final QueueSender sender = session.createSender(destQueue);<br /> final TextMessage message = session.createTextMessage(msg);<br /> sender.send(message);<br /> } catch (Exception ex) {<br /> ex.printStackTrace();<br /> } finally {<br /> ic.close();<br /> connection.close();<br /> }<br /> }<br /><br /> private static Context getInitialContext() throws NamingException {<br /> Hashtable env = new Hashtable();<br /> // Add InitialContext property assignments here.<br /> env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");<br /> // Note that by default WebLogic server is not created with security, so credentials are not needed.<br /> // TODO: Verify the server address and port number<br /> env.put(Context.PROVIDER_URL, "t3://localhost:7101");<br /> env.put(Context.SECURITY_PRINCIPAL, "weblogic");<br /> env.put(Context.SECURITY_CREDENTIALS, "Welcome1");<br /> return new InitialContext(env);<br /> }<br />}Niall Commiskeyhttps://www.blogger.com/profile/18194777332788452768noreply@blogger.comtag:blogger.com,1999:blog-2931801055574939054.post-26655541205639263282012-10-24T18:21:53.489-07:002012-10-24T18:21:53.489-07:00Hi Nell, Its Really a nice post.
Could you please...Hi Nell, Its Really a nice post.<br /><br />Could you please provide in detail about the JAVA CLASS Write2JMS, like where to add this class and how to execute the class, as i am from Mainframe Background it would help me to understand more in detail.<br /><br />Thanks in Advance. <br />ReddyAnonymoushttps://www.blogger.com/profile/12740194474237562502noreply@blogger.comtag:blogger.com,1999:blog-2931801055574939054.post-58428148746454235202012-10-24T18:21:05.068-07:002012-10-24T18:21:05.068-07:00Hi Nell, Its Really a nice post.
Could you please...Hi Nell, Its Really a nice post.<br /><br />Could you please provide in detail about the JAVA CLASS Write2JMS, like where to add this class and how to execute the class, as i am from Mainframe Background it would help me to understand more in detail.<br /><br />Thanks in Advance. <br />ReddyAnonymoushttps://www.blogger.com/profile/12740194474237562502noreply@blogger.comtag:blogger.com,1999:blog-2931801055574939054.post-83561480099825360672012-10-24T16:27:33.060-07:002012-10-24T16:27:33.060-07:00Hi Nell, Its Really a nice post.
Could you please...Hi Nell, Its Really a nice post.<br /><br />Could you please provide in detail about the JAVA CLASS Write2JMS, like where to add this class and how to execute the classs, as i am from Mainframe Background it would help me to understand more in detail.<br /><br />Thanks in Advance. <br />ReddyAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2931801055574939054.post-66173208779177287722012-10-23T18:41:57.403-07:002012-10-23T18:41:57.403-07:00Hi,
If possible could you please elaborate more a...Hi,<br /><br />If possible could you please elaborate more about the Write2JMS Class, like Where to add this class and how to execute the same? to add message into JMS. As i am from Mainframe Background, It would help me to understand more. Thanks in advance<br />ReddyAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2931801055574939054.post-24170086316802670542012-10-23T18:41:15.882-07:002012-10-23T18:41:15.882-07:00Hi,
If possible could you please elaborate more a...Hi,<br /><br />If possible could you please elaborate more about the Write2JMS Class, like Where to add this class and how to execute the same? to add message into JMS. As i am from Mainframe Background, It would help me to understand more. Thanks in advance<br />ReddyAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2931801055574939054.post-49973303858466439842012-10-23T18:39:52.620-07:002012-10-23T18:39:52.620-07:00Hi,
If possible could you please elaborate more a...Hi,<br /><br />If possible could you please elaborate more about the Write2JMS Class, like Where to add this class and how to execute the same? to add message into JMS. As i am from Mainframe Background, It would help me to understand more. Thanks in advance<br />ReddyAnonymousnoreply@blogger.com