Versions Compared

Key

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

...

To terminate the Basic example type "CTRL-C" in the command shell in which it is running.

How it Works

The diagram below illustrates the flow of messages through the Basic components.

...

  1. The timer component sends a 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 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 (the JCA resource adapter) listens on port 61616 for messages.
  5. inputReceiver subscribes to the "demo.org.servicemix.source" topic via jencks and receives the JMS message.
  6. inputReceiver normalizes the JMS message and sends it to outputSender via the NMR.
  7. outputSender marshals the normalized message 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 to the result topic.
  9. jencks listens on port 61616 for messages.
  10. jmsTrace subscribes to the "demo.org.servicemix.result" topic and receives the JMS message via jencks.
  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.

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. Typical output looks like the following:

Code Block
[INFO] TraceComponent - -Exchange: org.servicemix.jbi.messaging.InOnlyImpl@b55129 received IN message: 
org.servicemix.jbi.messaging.NormalizedMessageImpl@8c9b49{properties: {org.servicemix.jms.message=ACTIVEMQ_TEXT_MESSAGE: id = 0 ActiveMQMessage
{ , jmsMessageID = ID:redmac-2.local-50615-1123857186823-29:1, bodyAsBytes = org.activemq.io.util.ByteArray@b1a22, 
readOnlyMessage = true, jmsClientID = 'ID:redmac-2.local-50615-1123857186823-22:0' , jmsCorrelationID = 'null' , 
jmsDestination = demo.org.servicemix.result, jmsReplyTo = null, jmsDeliveryMode = 2, jmsRedelivered = false, jmsType = 'null' 
, jmsExpiration = 0, jmsPriority = 4, jmsTimestamp = 1123857193312, properties = {}, readOnlyProperties = true, entryBrokerName = 
'ID:redmac-2.local-50615-1123857186823-0:0' , entryClusterName = 'default' , consumerNos = [0], transactionId = 'null' ,
 xaTransacted = false, consumerIdentifer = 'ID:redmac-2.local-50615-1123857186823-14:0' , messageConsumed = false, 
transientConsumed = true, sequenceNumber = 1, deliveryCount = 1, dispatchedFromDLQ = false, messageAcknowledge = 
org.activemq.ActiveMQSession@74b5ee, jmsMessageIdentity = null, producerKey = ID:redmac-2.local-50615-1123857186823-29: }, 
text = <?xml version="1.0" encoding="UTF-8"?><timer><name>My Example Job</name><group>ServiceMix</group><fullname>ServiceMix.My Example Job
</fullname><description/><fireTime>Fri Aug 12 15:33:12 BST 2005</fireTime></timer>}}

...