Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 54110 invoked from network); 4 May 2007 07:23:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 May 2007 07:23:36 -0000 Received: (qmail 50792 invoked by uid 500); 4 May 2007 07:23:43 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 50769 invoked by uid 500); 4 May 2007 07:23:42 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 50760 invoked by uid 99); 4 May 2007 07:23:42 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 May 2007 00:23:42 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 May 2007 00:23:35 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 402ED1A9838; Fri, 4 May 2007 00:23:15 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r535119 - /activemq/camel/trunk/camel-eg-jms-file/src/main/java/org/apache/camel/samples/jmstofile/CamelJmsToFileSample.java Date: Fri, 04 May 2007 07:23:13 -0000 To: commits@activemq.apache.org From: rajdavies@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070504072315.402ED1A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rajdavies Date: Fri May 4 00:23:03 2007 New Revision: 535119 URL: http://svn.apache.org/viewvc?view=rev&rev=535119 Log: added some snippets Modified: activemq/camel/trunk/camel-eg-jms-file/src/main/java/org/apache/camel/samples/jmstofile/CamelJmsToFileSample.java Modified: activemq/camel/trunk/camel-eg-jms-file/src/main/java/org/apache/camel/samples/jmstofile/CamelJmsToFileSample.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-eg-jms-file/src/main/java/org/apache/camel/samples/jmstofile/CamelJmsToFileSample.java?view=diff&rev=535119&r1=535118&r2=535119 ============================================================================== --- activemq/camel/trunk/camel-eg-jms-file/src/main/java/org/apache/camel/samples/jmstofile/CamelJmsToFileSample.java (original) +++ activemq/camel/trunk/camel-eg-jms-file/src/main/java/org/apache/camel/samples/jmstofile/CamelJmsToFileSample.java Fri May 4 00:23:03 2007 @@ -18,7 +18,7 @@ package org.apache.camel.samples.jmstofile; -import static org.apache.camel.component.jms.JmsComponent.jmsComponentAutoAcknowledge; +import org.apache.camel.component.jms.JmsComponent; import javax.jms.ConnectionFactory; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.camel.CamelClient; @@ -41,14 +41,17 @@ public class CamelJmsToFileSample{ public static void main(String args[]) throws Exception{ + // START SNIPPET: e1 CamelContext context=new DefaultCamelContext(); - - //Set up the ActiveMQ JMS Components + // END SNIPPET: e1 + // Set up the ActiveMQ JMS Components + // START SNIPPET: e2 ConnectionFactory connectionFactory=new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false"); - //note we can explicity name the component - context.addComponent("test-jms",jmsComponentAutoAcknowledge(connectionFactory)); - - //Add some configuration by hand ... + // note we can explicity name the component + context.addComponent("test-jms",JmsComponent.jmsComponentAutoAcknowledge(connectionFactory)); + // END SNIPPET: e2 + // Add some configuration by hand ... + // START SNIPPET: e3 context.addRoutes(new RouteBuilder(){ public void configure(){ @@ -62,23 +65,24 @@ }); } }); + // END SNIPPET: e3 // Camel client - a handy class for kicking off exchanges + // START SNIPPET: e4 CamelClient client=new CamelClient(context); - - //Now everything is set up - lets start the context + // END SNIPPET: e4 + // Now everything is set up - lets start the context context.start(); - - //now send some test text to a component - for this case a JMS Queue - //The text get converted to JMS messages - and sent to the Queue test.queue - //The file component is listening for messages from the Queue test.queue, consumes - //them and stores them to disk. The content of each file will be the test test we sent here. - //The listener on the file component gets notfied when new files are found ... - //that's it! - + // now send some test text to a component - for this case a JMS Queue + // The text get converted to JMS messages - and sent to the Queue test.queue + // The file component is listening for messages from the Queue test.queue, consumes + // them and stores them to disk. The content of each file will be the test test we sent here. + // The listener on the file component gets notfied when new files are found ... + // that's it! + // START SNIPPET: e5 for(int i=0;i<10;i++){ client.sendBody("test-jms:queue:test.queue","Test Message: "+i); } - + // END SNIPPET: e5 Thread.sleep(1000); context.stop(); }