tag:blogger.com,1999:blog-5532324792230149469.post2620650728056783266..comments2023-05-31T14:13:53.872+01:00Comments on Monster Sandwich: WebSphere SIB, JMS queues and connection factory configurationAnonymoushttp://www.blogger.com/profile/13723216682713567244noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-5532324792230149469.post-33086185416166485992012-04-23T12:30:16.466+01:002012-04-23T12:30:16.466+01:00Also, if you can provide some samples with ejb2.* ...Also, if you can provide some samples with ejb2.* with MDB along with configuration ,that would be much helpfulS_K_Bnoreply@blogger.comtag:blogger.com,1999:blog-5532324792230149469.post-85797356651297793882012-04-23T12:22:29.992+01:002012-04-23T12:22:29.992+01:00Where is the use of "user" inside the sa...Where is the use of "user" inside the sample code & activation spec definition? S_K_Bnoreply@blogger.comtag:blogger.com,1999:blog-5532324792230149469.post-28663542268070494622011-12-07T10:06:26.038+00:002011-12-07T10:06:26.038+00:00thanks for sharing Tamonasthanks for sharing Tamonasrmahonynoreply@blogger.comtag:blogger.com,1999:blog-5532324792230149469.post-77586773537714002492011-12-07T08:19:40.996+00:002011-12-07T08:19:40.996+00:001. Create one Dynamic web project.
2. Create one s...1. Create one Dynamic web project.<br />2. Create one servlet<br />3. Put the following code in the init method of the servlet <br /> public void init() throws ServletException {<br /> try{<br /> //code for creating the connection<br /> InitialContext init = new InitialContext();<br /> <br /> javax.jms.Queue destination =(javax.jms.Queue) init.lookup("jms/myFirstQ");<br /> connectionFactory = (ConnectionFactory) init.lookup("jms/MyConnectionFactory");<br /> connection = connectionFactory.createConnection();<br /> session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);<br /> connection.start();<br /> System.out.println("connection is ready");<br /> <br /> //code for message producer<br /> TextMessage message = session.createTextMessage();<br /> message.setText("My text message for send and received");<br /> MessageProducer producer = session.createProducer(destination);<br /> producer.setDeliveryMode(DeliveryMode.PERSISTENT);<br /> producer.send(message);<br /> System.out.println("message is sent to the queue");<br /> <br /> //code for consumer<br /> MessageConsumer consumer = session.createConsumer(destination);<br /> Message receivedMessage = consumer.receive(1000);<br /> connection.close();<br /> System.out.println("received message "+receivedMessage); <br /> }catch (Exception e) {<br /> System.out.println(e.getMessage());<br /> }<br /> } <br /><br /><br />From the console u will get the logs that message was sent and received using the JMS.Tamonas Dattanoreply@blogger.comtag:blogger.com,1999:blog-5532324792230149469.post-29740144738693592922011-12-07T08:12:33.401+00:002011-12-07T08:12:33.401+00:00 Following are the next steps to send a message th... Following are the next steps to send a message the queue and received the message from the queue :Tamonasnoreply@blogger.com