Versions Compared

Key

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

...

  1. The timer component sends a Normalized Message (NM) normalized message to inputSender through the Normalized Message Router (NMR).
  2. inputSender converts the message (marshals it) into a JMS message, then uses the jmsTemplate bean to publish the message.
  3. jmsTemplate uses the jmsFactory bean to get a connection factory to the port associated with the JMS topic called "demo.org.servicemix.source." The message is published on the "demo.org.servicemix.source" topic.
  4. jencks listens on port 61616 for messages.
  5. inputReceiver subscribes to the "demo.org.servicemix.source" topic via the jencks bean and receives the JMS message.
  6. inputReceiver normalizes the JMS message and sends it to outputSender via the NMR.
  7. outputSender marshals the NM to a JMS message and uses jmsTemplate to publish the message on the "demo.org.servicemix.result" topic.
  8. jmsTemplate publishes it on the "demo.org.servicemix.result" topic using jmsFactory to get a connection factory to the result topic.
  9. jencks listens on port 61616 for messages.
  10. jmsTrace, via jencks, subscribes to the "demo.org.servicemix.result" topic and receives the JMS message.
  11. jmsTrace converts the JMS message into a normalized message and sends it to trace via the NMR.
  12. trace transforms the normalized message into a string and logs it to the console.

...

Component or Bean ID

Description

jbi

The jbi container contains the following components: timer, inputSender, inputReceiver, outputSender, jmsTrace, and trace. During initialization, several singletons are instantiated: transactionManager , broker, jencks, jmsFactory, and jbi. After initialization, the components in the Basic example begin running, starting with the timer component.

transactionManager

The transactionManager provides ... to the JBI container.

timer

Every 5 seconds, until the program is terminated, the timer component kicks off a trigger. The job has a property called "name" with a value of "My Example Job" and another property called "group" with a value of "ServiceMix." The trigger is converted to a normalized message and routed through the Normalized Message Router ( NMR).

inputSender

Receives the normalized message (the trigger), converts it to a JMS message, and publishes it to the topic called demo.org.servicemix.source.

inputReceiver

This component uses the bean called jencks , which is a JCA container, to listen on port 61616 for a JMS message on the topic called "demo.org.servicemix.source." Essentially, inputReceiver subscribes to the demo.org.servicemix.source topic. It takes the message, normalizes it, and routes it to outputSender via the NMR. This component combined with outputSender and some supporting beans creates a JMS bridge between two topics.

outputSender

This component receives a normalized message from the NMR, marshals it into a JMS message using jmsTemplate, then publishes it on the ActiveMQ (JMS) topic called "demo.org.servicemix.result."

jmsTrace

This component uses the jencks bean to subscribe to the "demo.org.servicemix.result" topic and get the message that is there. It then marshals the message into a Normalized Message and routes it via the NMR to the trace component.

jmsTrace

This component uses jencks to listen to port 61616 for the purposes of tracing the messages received on that port.

trace

Receives normalized messages from jmsTrace via the NMR. It transforms the normalized message into a string and logs it to the console.

 

 

 

 

jencks

The jencks bean defines a JCA container. This bean has two properties, one of which is an ActiveMQ listener, which listens on port 61616. In general a JCA container must provide threading, The JCA

broker

The broker bean ...

transactionManager

This bean is invoked in the jbi containers container's initialization. It instantiates the
org.jencks.factory.TransactionManagerFactoryBean. This bean provides XA transactions between the resource adapter (in this case the ActiveMQ resource adapter) and the jbi container.

jmsFactory

This bean listens on port 61616.

...