You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

The Basic examples demonstrates connectivity and routing between different Spring POJO Components in ServiceMix.

This example runs an embedded ActiveMQ message broker, a JCA Container and a transaction manager (JOTM) together with some simple example components which consume JMS messages using the JCA container.

The example components set 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. There are many more components available to use in ServiceMix.

To Run the basic example:

cd examples/basic
../../bin/servicemix servicemix.xml

What you should see is log infomation being written to the console, followed by infomation from the trace component every few seconds, like this:

[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>}}
  • No labels