Friday, May 1, 2009

JMS Tooling in FUSE 1.2 Release


JMS Tooling in FUSE 1.2 Release

One of the new things in FUSE 1.2 release is JMS Tooling. This allows you to quickly connect to FUSE Messaging Broker, send and receive Text, XML messages on different JMS destinations in a user friendly manner. It is very handy when you want to diagnose/inspect if some things go wrong with your messaging applications.

There is no eclipse based tooling available around Eclipse currently. FUSE 1.2 takes the pride in providing this for the first time.

What is provided in JMS Tooling?

It follows entirely a new approach in providing a tooling for JMS embracing the common, standard and user-friendly approaches. It works as JMS Test Client, where-in you create JMS Message Producers, JMS Message Consumers and send/receive different kinds of messages.


List of Features:


Message Editor to compose JMS Messages

    • Compose JMS Message, JMS Text and XML messages
    • Set required JMS Headers
    • Set required JMS Properties
  • Messages Editor to visualize the received messages
    • Manage received messages – save, remove etc.,
    • Send a message to JMSReplyTo destination
    • Set a Message History count to purge the old messages automatically
  • Create your messaging application as Projects
    • Easy way to keep your messaging applications as separate project
    • Integrate with source control system to persist and reuse the projects
    • No tight coupling between the messaging project and the messaging broker
    • Ability to create projects in offline mode
  • Create your JMS Message Producers/Consumers
    • Support to create Queue/Topic/Durable Topic destinations as producers & consumers
    • Ability to set producer/consumer properties like Time To Live, Delivery Mode and Message Selectors etc.,
  • Create your connection to FUSE Messaging Broker
    • Servers view allows you to create connections to FUSE Messaging Broker.
    • Deploy your messaging applications in FUSE Messaging Broker Connections


"Try-It" - Trying your hands on JMS Tooling:


You can download FUSE 1.2 from http://fusesource.com/products/fuse-integration-designer/

  • Extract the zip file to desired location on your system.
  • Run fuse.exe from \fuse-integration-designer-1.2\bin\


In this “Try-It” session, we will do the following…

  • Choosing Messaging Perspective
  • Creating a FUSE Messaging Connection
  • Creating a Messaging Project
  • Creating Message Producers and Consumers
  • Creating test JMS messages
  • Sending Messages
  • Viewing Received Messages


Choosing Messaging Perspective:


By default FUSE 1.2 starts in “FUSE” perspective, click on Open Perspective icon on the top right hand corner of FUSE product and choose “Messaging”. This will bring up the Project Explorer View and the Servers View.


Creating a FUSE Messaging Connection:


Go to Servers View, launch context-menu of Servers View and Choose "New.." option, you will see the following dialog.




Enter a desired name (e.g. FUSE Message Broker) to the Server and click on Next button. Enter the connection details for FUSE Messaging Broker and click Finish.

This will create a node in the Server's View. Note that the FUSE Messaging Broker should be started from outside of FUSE. We will start & connect to the server later, so that we will see how to create Messaging Projects in offline mode.

Creating a Messaging Project:

This is what you create as an equilavent to your Messaging Application. As an example let us assume that we have a JMS based appliation say "TrainEnquirySystem" which responds to customers requests by providing the requested information. To test the health of this system, we want to send test messages and inspect the received messages.
  • Launch Project Creation wizard from File -> New -> Messaging
  • Enter desired name for the project say "TrainEnquirySystem"
  • The same wizard allows you to choose existing FUSE Messaging Connections or create a new Connection.
  • Select the connection we created in the previous section from the drop down list.
  • After finishing the wizard, the project gets deployed under the chosen connection (in this case FUSE Message Broker)
  • Under the project two nodes will be created with the names "Senders" & "Listeners"

Creating Message Producers/Consumers:
  • As mentioned earlier, you can create Queue/Topic as Producers and Queue/Topic/Durable Topic as Consumers.
  • To Create a message producer, select "Senders" node, on the right click menu options choose "Add Destination" action.
  • This action will launch the following dialog. Enter destination name as "queryByPNR" and click OK.


  • To Create a message consumer, select "Listeners" node, on the right click menu options choose "Add Destination" action.
  • This action will launch the following dialog. Enter destination name as "queryByPNR" and click OK.


  • You can later explore the context menu of the senders and listeners you created.

Creating test JMS messages:
  • Launch Message Wizard from File -> New -> Message
  • Enter a file name say "testInput_queryByPNR.message" and click on Next button
  • In the next page you can choose the message type - choose XML (FUSE Message Broker) type for this example
  • Note - Only JMS based messages can be sent over JMS destinations.
  • Enter the message content in the body section. OR you can directly point to the file which you want to be sent as JMS message.

Sending Messages:
  • If you try to drag and drop "testInput_queryByPNR.message" on "queryByPNR" under "Senders" node, it will show a warning message saying Connection is unavailable.
  • This is because we did not connect to the server yet. The project is just using an offline connection. If you observe the project shows a red flag and all the listeners show a red dot prompting the user that there is no active connection available.

  • Start your FUSE messaging Broker from outside.
  • To bring the project to online mode, go to Servers View, select "Fuse Message Broker" and choose Messaging -> Connect option to really connect to the server.
  • If you observe, the project shows a green flag and all consumers become active.
  • At this stage your project should look similar to the following screen

  • To send a message, just drag and drop the testInput_queryByPNR.message on "queryByPNR" under "Senders" node

Viewing Received Messages:
  • Double click on "queryByPNR" under "Listeners"
  • This will open a Messages Editor, the top section shows the list of all received messages and the bottom section shows the details of the selected message.
  • You can explore the tool bar options and try on your own.
  • The following screen shows the Messages Editor


Conclusion:

This post is just the introduction to the JMS Elicpse Tools in FUSE1.2, look forward to see advanced use-cases in future.

If you have trouble using this tool, please post in FUSE tools forum