Showing posts with label JMS. Show all posts
Showing posts with label JMS. Show all posts

Saturday, April 02, 2016

Reading Messages from JMS Queue in Weblogic 12.1.1 using Java

Links to this post
Suppose I have Queue configured in Weblogic and I want to write application in which Program A will put messages to this queue and Program B will read data from this Queue.

 There are multiple Persistence Store options availble in WL like The file or database in which this JMS server stores persistent messages. If unspecified, the JMS server uses the default persistent store that is configured on each targeted WebLogic Server instance As part of below example We will be using default one.

In order to retrieve messages from queue, you have should queue containing messages.
Please refer to previous article to send messages to JMS Queue.

Write Java Program to send message to Queue

  •   Get QueueConnectionFactory
  •   Create QueueConnection 
  •   Create QueueSession
  •   Create QueueReceiver
  •   Retrieve Message to Queue

Sending Message to JMS Queue in Weblogic 12.1.1 using Java

Links to this post
Suppose I have Queue configured in Weblogic and I want to write application in which
Program A will put messages to this queue and Program B will read data from this Queue.

There are multiple Persistence Store options availble in WL like The file or database in which this JMS server stores persistent messages.If unspecified, the JMS server uses the default persistent store that is configured on each targeted WebLogic Server instance. As part of below example We will be using default one.

In order to put mesage to Queue using JMS Apis, Please follow below steps.

  • Create JMS Server --> Services -> Messaging -> JMS Server -> create new Ex. TestJMSServer
  • Create new JMS Module --> Services -> Messaging -> JMS Modules -> Create new JMS Module Ex. TestJMSModule 
  • Create Connection Factory ex. ConnectionFactory1 --> JNDI as jms/ConnectionFactory1
  • Create Queue ex. Queue1 --> JNDI as jms/Queue1 with target services as JMS Server ex. TestJMSServer
  • Write Java Program to send message to Queue
    •   Get QueueConnectionFactory
    •   Create QueueConnection 
    •   Create QueueSession
    •   Create QueueSender
    •   Send Message to Queue