Objective
To demonstrate working of an application which uses JMSIn and JMSOut adapters to send and receive messages using BEA WebLogic.
Prerequisites
- Start Fiorano Enterprise Server (FES) and Fiorano Peer Server (FPS).
- Login to eStudio application.
- Understand the basic menus and perspectives (panels) in eStudio application.
- Start Weblogic Server and note down the username, password and the URL.
- Add the resources: wljmsclient.jar and wlthint3client.jar to JMS adapters. Refer Add Resources to a Microservice section for the instructions.
Scenario
Create JMS module 'SystemModule1' with Destination name 'Queue1' and Destination Type 'Queue' in Weblogic server. Send message using Feeder component to Destination 'Queue1' using JMSIn component in the BEA Weblogic server. JMSOut component fetches this message from Queue1.
Components Used
- JMSIn Version 4.0
- JMSOut Version 4.0
- Feeder to send message to the destination
- 2 Display components, one to display the message sent to destination and the other to display the message fetched from the destination.
How it Works
JMSIn component retrieves messages (as Text, Bytes or Map) from a component and sends them to a JMS Topic/Queue and configure the component to publish or send a message on a JMS Server at runtime.
JMSOut component retrieves messages from a JMS Topic/Queue and sends the message received from a Topic/Queue to another component.
Setting up the Example
Configuring JMSIn and JMSOut components
To configure JMSIn component, perform the following action in eStudio:
- Add a new Event Process with name 'WebLogic_Example'.
- Drag the JMSIn component from MOMs category in the Micro Service Palette to the Fiorano Orchestrator.
Figure 1: Adding JMSIn component to Fiorano Orchestrator
- Double-click the JMSIn component in the Orchestrator to open Configuration Property Sheet (CPS).
Figure 2: Managed Connection Factory in CPS
- Perform the following actions under Provider URL Settings section:
- From JMS Provider drop-down, select 'BEA WebLogic'.
- Click the Connection Configuration Ellipsis button, provide the values for Server URL, JMS username and JMS password in ConnectionConfig dialog box and click OK.
Figure 3: Component Configuration in ConnectionConfig dialog box
- Under JNDI Settings section, click the JNDI Configuration Ellipsis button.
Figure 4: JNDI Configuration
- In the JndiConfig dialog box, provide values for JNDI Username, JNDI Password and click OK.
Figure 5: Component Configuration in JNDIConfig dialog box
- Click the Test button to test the connection. XML message indicating successful connection appears in Test Connection Configuration dialog box. Click Close.
Figure 6: Connection Successful message
- Under Connection Properties section, select ClientID '<auto-generated>' to generate unique ClientID (same ID for JMSIn and JMSOut may create connection issues) and click Next.
Figure 7: ClientID changed to <auto-generated> to generate unique ID
- In the Interaction Configurations screen, click the Destination Configuration Ellipsis button.
Figure 8: Destination Configuration
- In the DestinationConfig dialog box, provide the following values and click OK.
- Destination Name: ./SystemModule1!Queue1 (format is ./<ModuleName>!<DestinationName>)
- Destination Type: QUEUE (use QUEUE for single receiver and 'TOPIC' for multicasting the message).
Figure 9: Component Configuration in DestinationConfig dialog box
- Click the Test button to send sample input message. Notice the message displayed in Test Interaction Specifications dialog box.
Figure 10: Test message
- Click Execute. Notice the confirmation message 'Message sent to Destination' with the destination name as provided.
Figure 11: Confirmation message that the message has reached the destination
- Configure JMSOut component by performing the same actions as mentioned above. After completing the configuration, notice that only the output port will be attached to the component as Scheduling is enabled by default.
Figure 12: Scheduler Configurations settings enabled by default for JMSOut component
Figure 13: JMSOut component with only the output port after configuration
Composing the Event Process
To work with the JMSIn and JMSOut components, compose the Event Process by performing the below actions:
- Drag one Feeder component and two Display components from Util category in the Micro Service Palette to the WebLogic_Example Fiorano Orchestrator.
- Connect the Feeder1 component output port to JMSIn component input port and connect the JMSIn component output port to Display1 component input port. Default configuration in Feeder component helps to run WebLogic_Example succesfully.
- Connect the JMSOut component output port to Display2 component input port.
Figure 14: JMSIn and JMSOut after connecting with supporting components
Running the Example
To run the example, perform the following actions in the Fiorano Orchestrator:
- Click Check Resource and Connectivity icon (or press ALT+SHIFT+C) to check resource and connectivity.
- Click Run Event Process icon (ALT+SHIFT+R) to run the event process.
- One Feeder window and two Display windows appear.
- Open Feeder1, replace text 'Input Text' with 'Test Message' and click the Send button.
Figure 15: Sending custom message using Feeder
- Confirmation message 'Message sent to Destination' with the destination name gets displayed in Display1.
Figure 16: Confirmation of message reaching the destination
- Message sent to Destination through feeder gets displayed in Display2.
Figure 17: Message received from Destination displayed in Display2
Reference
- Please note that the options used in this example are minimum, which helps you to get an overview of the application. To explore the other options present in the JMSIn 4.0 and JMSOut 4.0, Feeder and Display components, refer: JMSIn4.0, JMSOut4.0, Feeder and Display sections.