Versions Compared

Key

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

...

Component or Bean ID

Description

jbi

jbi is the "id" of the JBI container and provides the basic infrastructure services for 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 jbi container are activated, starting with the timer component.

timer

Every 5 seconds, until the program is terminated, the timer component kicks off an instance of a SimpleTrigger, which is associated with an instance of JobDetail. 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 resulting message is converted to a normalized message and routed through the NMR.

inputSender

This is a component inside the JBI container. It receives the normalized message (the message from the trigger), converts it to a JMS message, and publishes it to the topic called demo.org.servicemix.source. It uses the jmsTemplate bean to handle the publish.

inputReceiver

This component uses the bean called jencks , which is a the 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 theremessages. It then marshals the message into a normalized message and routes it via the NMR to the trace component.

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. The JCA container allows you to configure thread pool size, configure a transaction manager, and configure a resource adapter. In this example, the resource adapter is an ActiveMQ adapter, however, another JMS listener could be configured instead. This adapter listens on port 61616 for JMS messages.

broker

The broker bean ...

transactionManager

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

jmsFactory

This bean listens on port 61616.

...