Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note
It is helpful to look at the source code while reading this description\ The Basic example illustrates the following concepts:* use of declarative programming* how to use an ActiveMQ message broker * how to use a Quartz timer* how to use the jencks JCA container* how to use a JOTM transaction manager* how to use tracing The example has several components. One component sets off a timer to send messages to a source destination. Then those messages are consumed by another component and sent to a different output destination - along with a trace component displaying the output messages as they arrive. This demonstrates a simple JMS bridge in action along with timers and tracing. \ \h3h2. Running the _Basic_ ExampleTo run Basic:From a command shell, go to the Basic example directory:{code
It is helpful to look at the source code while reading this description\ The Basic example illustrates the following concepts:* use of declarative programming* how to use an ActiveMQ message broker * how to use a Quartz timer* how to use the jencks JCA container* how to use a JOTM transaction manager* how to use tracing The example has several components. One component sets off a timer to send messages to a source destination. Then those messages are consumed by another component and sent to a different output destination - along with a trace component displaying the output messages as they arrive. This demonstrates a simple JMS bridge in action along with timers and tracing. \ \h3h2. Running the _Basic_ ExampleTo run Basic:From a command shell, go to the Basic example directory:{code

...

Code Block
where {{servicemix_install_dir}} is the directory in which Service Mix was installed.
\\
\\
h3h2. Stopping the _Basic_ Example
To terminate the Basic example type "CTRL-C" in the command shell in which it is running.
\\
\\

h3h2. How it Works
The diagram illustrates the components of the Basic example and how they interact with each other within the JBI container.
\\
\\

{panel:title= Basic Example Flow Diagram|borderStyle=solid|borderColor=#ccc}
!basicflow.jpg|align=center!
{panel}

\\
\\

The flow of the program is:
# The _timer_ component sends a Normalized Message (NM) to _inputSender_.
# _inputSender_ converts the message (marshals it) into a JMS message and publishes it to the JMS topic called "demo.org.servicemix.source."
# _jencks_ listens on port 61616 for messages
# _inputReceiver_ subscribes to the "demo.org.servicemix.source" topic via the _jencks_ bean and receives the JMS message.
# _inputReceiver_ normalizes the JMS message and sends it to _outputSender_ via the Normalized Message Router (NMR).
# _outputSender_ marshals the NM to a JMS message and publishes it on the "demo.org.servicemix.result" topic.
# _jmsTrace_, via _jencks_, subscribes to the "demo.org.servicemix.result" topic and receives the JMS message.
# _jmsTrace_ converts the JMS message into a normalized message and sends it to _trace_ via the NMR.
# _trace_ logs the message to a log file. ??????
\\

Typical output looks like the following. Every 5 seconds logging information is written to the console, followed by information from the trace component. Note, that the triggers' property values of "name", "My Example Job", "group", and "ServiceMix" are displayed along with a timestamp.
\\

...