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 There are several components in the servicemix.xml file. One component sets off a timer trigger 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. \ \h2. 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 There are several components in the servicemix.xml file. One component sets off a timer trigger 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. \ \h2. 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.
\\
\\
h2. Stopping the _Basic_ Example
To terminate the Basic example type "CTRL-C" in the command shell in which it is running.
\\
\\

h2. 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 message through the components is as follows:
# The _timer_ component sends a Normalized Message (NM) to _inputSender_ through the Normalized Message Router (NMR).
# _inputSender_ converts the message (marshals it) into a JMS message, then uses the _jmsTemplate_ bean
to publish the message and publishes it to the JMS.
# _jmsTemplate_ uses the _jmsFactory_ bean to get a connection factory to the port associated with the ActiveMQ (JMS) topic called "demo.org.servicemix.source."
# The message is published on the "demo.org.servicemix.source" topic.
# _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.
\\

...