Versions Compared

Key

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

Overview of the ServiceMix

...

2.x Quartz Example

This document describes how to run the Qaurtz example and provides details about what it does. For information on the business use case, please refer to: Use Case for Quartz.

The Quartz example illustrates the following:

  • use of declarative programming
  • how to use a Quartz timer
  • how to use tracing

The source code for the Quartz example is located in the ServiceMix installation directory under the examples\quartz-binding directory in the servicemix.xml file. It is recommended that you refer to the source code while reading this document.

This example shows how to use a Quartz component to set off a trigger that sends messages to a trace component. The trace component logs the messages to the console as they arrive

...

Stopping the Quartz Example

To terminate the Basic Quartz example type "CTRL-C" in the command shell in which it is running and answer "y" to the "Terminate batch job (y/n)?" question.

...

Messages flow through the components as follows:

  1. For every Every 5 seconds the timer component sends a message to trace through the Normalized Message Router (NMR).
  2. trace transforms the normalized message into a string and logs it to the console.

    Code Block
     
    [INFO] TraceComponent - -Exchange: org.servicemix.jbi.messaging.InOnlyImpl@4fdf11 received IN message: 
    org.servicemix.jbi.messaging.NormalizedMessageImpl@1be0369{properties: {org.servicemix.jms.message=ACTIVEMQ_TEXT_MESSAGE: 
    id = 0 ActiveMQMessage{ , jmsMessageID = null, bodyAsBytes = org.activemq.io.util.ByteArray@1d1fc02, 
    readOnlyMessage = true, jmsClientID = 'ID:Lisas-2828-1126207917359-23:0' ,
     jmsCorrelationID = 'null' , jmsDestination = demo.org.servicemix.result, jmsReplyTo = null, jmsDeliveryMode = 2, 
     jmsRedelivered = false, jmsType = 'null' , jmsExpiration = 0, jmsPriority = 4, jmsTime
    stamp = 1126207938593, properties = {}, readOnlyProperties = true, entryBrokerName = 'ID:Lisas-2828-1126207917359-0:0' , 
    entryClusterName = 'default' , consumerNos = [0], transactionId = 'null' , xaTransacted = false, 
    consumerIdentifer = 'ID:Lisas-2828-1126207917359-14:0' , messageConsumed = false, transientConsumed = true, 
    sequenceNumber = 7, deliveryCount = 1, dispatchedFromDLQ = false, messageAcknowledge = org.activemq.ActiveMQSession@1de7497,
    jmsMessageIdentity = null, producerKey = ID:Lisas-2828-1126207917359-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>
    Thu Sep 08 12:32:18 PDT 2005</fireTime></timer>}}
    
    

...