JMS Step 1 - How to Create a Simple JMS Queue in Weblogic Server 11g
- by John-Brown.Evans
JMS Step 1 - How to Create a Simple JMS Queue in Weblogic Server 11g
    
    ol{margin:0;padding:0}
    .c5{vertical-align:top;width:156pt;border-style:solid;border-color:#000000;border-width:1pt;padding:0pt 2pt 0pt 2pt}
    .c7{list-style-type:disc;margin:0;padding:0}
    .c4{background-color:#ffffff}
    .c14{color:#1155cc;text-decoration:underline}
    .c6{height:11pt;text-align:center}
    .c13{color:inherit;text-decoration:inherit}
    .c3{padding-left:0pt;margin-left:36pt}
    .c0{border-collapse:collapse}
    .c12{text-align:center}
    .c1{direction:ltr}
    .c8{background-color:#f3f3f3}
    .c2{line-height:1.0}
    .c11{font-style:italic}
    .c10{height:11pt}
    .c9{font-weight:bold}
    .title{padding-top:24pt;line-height:1.15;text-align:left;color:#000000;font-size:36pt;font-family:"Arial";font-weight:bold;padding-bottom:6pt}.subtitle{padding-top:18pt;line-height:1.15;text-align:left;color:#666666;font-style:italic;font-size:24pt;font-family:"Georgia";padding-bottom:4pt}
    li{color:#000000;font-size:10pt;font-family:"Arial"}
    p{color:#000000;font-size:10pt;margin:0;font-family:"Arial"}
    h1{padding-top:0pt;line-height:1.15;text-align:left;color:#666;font-size:18pt;font-family:"Arial";font-weight:normal;padding-bottom:0pt}
    h2{padding-top:0pt;line-height:1.15;text-align:left;color:#666;font-size:14pt;font-family:"Arial";font-weight:normal;padding-bottom:0pt}
    h3{padding-top:0pt;line-height:1.15;text-align:left;color:#666;font-size:12pt;font-family:"Arial";font-weight:normal;padding-bottom:0pt}
    h4{padding-top:0pt;line-height:1.15;text-align:left;color:#666;font-style:italic;font-size:11pt;font-family:"Arial";padding-bottom:0pt}
    h5{padding-top:0pt;line-height:1.15;text-align:left;color:#666;font-size:10pt;font-family:"Arial";font-weight:normal;padding-bottom:0pt}
    h6{padding-top:0pt;line-height:1.15;text-align:left;color:#666;font-style:italic;font-size:10pt;font-family:"Arial";padding-bottom:0pt}
  
  
    
      This example shows the steps to create a simple JMS queue in
            WebLogic Server 11g for testing purposes. For example, to use with
            the two sample programs QueueSend.java and QueueReceive.java which
            will be shown in later examples.
    
    
      Additional, detailed information on JMS can be found in the
            following Oracle documentation:
    
    
      Oracle® Fusion Middleware Configuring and Managing
                        JMS for Oracle WebLogic Server
11g Release 1 (10.3.6)
Part Number E13738-06
        http://docs.oracle.com/cd/E23943_01/web.1111/e13738/toc.htm
    
    
      
      1. Introduction and Definitions
    
    
      A JMS queue in Weblogic Server is associated with a number of
            additional resources:
    
    
      
      JMS Server
    
    
      A JMS server acts as a management container for resources within JMS
            modules. Some of its responsibilities include the maintenance of
            persistence and state of messages and subscribers. A JMS server is
            required in order to create a JMS module.
    
    
      
      JMS Module
    
    
      A JMS module is a definition which contains JMS resources such as
            queues and topics. A JMS module is required in order to create a JMS
            queue.
    
    
      
      Subdeployment
    
    
      JMS modules are targeted to one or more WLS instances or a cluster.
            Resources within a JMS module, such as queues and topics are also
            targeted to a JMS server or WLS server instances. A subdeployment is a
            grouping of targets. It is also known as advanced targeting.
    
    
      
      Connection Factory
    
    
      A connection factory is a resource that enables JMS clients to
            create connections to JMS destinations.
    
    
      
      JMS Queue
    
    
      A JMS queue (as opposed to a JMS topic) is a point-to-point
            destination type. A message is written to a specific queue or
            received from a specific queue.
    
    
      The objects used in this example are:
    
    
    
      
        
          
            
              Object Name
            
          
          
            
              Type
            
          
          
            
              JNDI Name
            
          
        
        
          
            
              TestJMSServer
            
          
          
            
              JMS Server
            
          
          
            
              
            
          
        
        
          
            
              TestJMSModule
            
          
          
            
              JMS Module
            
          
          
            
              
            
          
        
        
          
            
              TestSubDeployment
            
          
          
            
              Subdeployment
            
          
          
            
              
            
          
        
        
          
            
              TestConnectionFactory
            
          
          
            
              Connection Factory
            
          
          
            
              jms/TestConnectionFactory
            
          
        
        
          
            
              TestJMSQueue
            
          
          
            
              JMS Queue
            
          
          
            
              jms/TestJMSQueue
            
          
        
      
    
    
      
      2. Configuration Steps
    
    
      The following steps are done in the WebLogic Server Console,
            beginning with the left-hand navigation menu.
    
    
      
      2.1 Create a JMS Server
    
    
      
        Services > Messaging > JMS Servers
        
      
      
        Select 
        New
      
      
        Name: 
        TestJMSServer
        
          Persistent Store: (none)
      
      
        Target: 
        soa_server1
         (or choose an available server)
      
        Finish
      
    
    
      The JMS server should now be visible in the list with Health OK.
    
    
      
    
    
      
      2.2 Create a JMS Module
    
    
      
        Services > Messaging > JMS Modules
      
        Select 
        New
      
        Name: 
        TestJMSModule
        
          Leave the other options empty
      
        Targets: 
        soa_server1
         (or choose the same one as the JMS server)Press 
        Next
      
        Leave “Would you like to add resources to this JMS system
              module” unchecked and  press 
        Finish
        .
      
    
    
      
      2.3 Create a SubDeployment
    
    
      A subdeployment is not necessary for the JMS queue to work, but it
            allows you to easily target subcomponents of the JMS module to a
            single target or group of targets. We will use the subdeployment in
            this example to target the following connection factory and JMS
            queue to the JMS server we created earlier.
    
    
      
        Services > Messaging > JMS Modules
      
        Select 
        TestJMSModule
      
        Select the 
        Subdeployments
         tab and 
        New
      
        Subdeployment Name: 
        TestSubdeployment
      
        Press 
        Next
      
        Here you can select the target(s) for the subdeployment. You can
              choose either Servers (i.e. WebLogic managed servers, such as the
              soa_server1) or JMS Servers such as the JMS Server created
              earlier. As the purpose of our subdeployment in this example is to
              target a specific JMS server, we will choose the JMS Server option.
        Select the 
        TestJMSServer 
        created earlier
      
        Press 
        Finish
      
    
    
      
      2.4
       Create a Connection Factory
    
    
      
        Services > Messaging > JMS Modules
      
        Select 
        TestJMSModule
         and press 
        New
      
        Select 
        Connection Factory
         and 
        Next
      
        Name: 
        TestConnectionFactory
        
          JNDI Name: 
        jms/TestConnectionFactory
        
          Leave the other values at default
      
        On the Targets page, select the 
        Advanced Targeting
         button and select 
        TestSubdeployment
      
        Press Finish
      
    
    
      The connection factory should be listed on the following page with
            TestSubdeployment and TestJMSServer as the target.
    
    
      
      2.5 Create a JMS Queue
    
    
      
        Services > Messaging > JMS Modules
      
      
        Select 
        TestJMSModule
         and press 
        New
      
      
        Select 
        Queue 
        and 
        Next
      
      
        Name: TestJMSQueueJNDI Name: jms/TestJMSQueueTemplate:
                                                                             NonePress 
        Next
      
      
        Subdeployments: 
        TestSubdeployment
      
      
        Finish
      
    
    
      The TestJMSQueue should be listed on the following page with
            TestSubdeployment and TestJMSServer.
    
    
      Confirm the resources for the TestJMSModule. Using the Domain
            Structure tree, navigate to soa_domain > Services > Messaging
            > JMS Modules then select TestJMSModule
    
    
      
    
    
      
    
    
      You should see the following resources
    
    
      
    
    
      The JMS queue is now complete and can be accessed using the JNDI
            names
    
    
      jms/TestConnectionFactory andjms/TestJMSQueue.
    
    
      In the following blog post in this series, I will show you how to 
      write a message to this queue, using the WebLogic sample Java program
      QueueSend.java.