Return-Path: Delivered-To: apmail-activemq-camel-user-archive@locus.apache.org Received: (qmail 89915 invoked from network); 16 Dec 2008 04:08:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Dec 2008 04:08:53 -0000 Received: (qmail 50415 invoked by uid 500); 16 Dec 2008 04:09:06 -0000 Delivered-To: apmail-activemq-camel-user-archive@activemq.apache.org Received: (qmail 50278 invoked by uid 500); 16 Dec 2008 04:09:05 -0000 Mailing-List: contact camel-user-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-user@activemq.apache.org Delivered-To: mailing list camel-user@activemq.apache.org Received: (qmail 50267 invoked by uid 99); 16 Dec 2008 04:09:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Dec 2008 20:09:05 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Dec 2008 04:08:44 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1LCREN-0001bd-DI for camel-user@activemq.apache.org; Mon, 15 Dec 2008 20:08:23 -0800 Message-ID: <21026931.post@talk.nabble.com> Date: Mon, 15 Dec 2008 20:08:23 -0800 (PST) From: iapilgrim To: camel-user@activemq.apache.org Subject: Re: Schedule JMS consumer In-Reply-To: <5380c69c0812150301m303b0c9atf6eb764819ff34a2@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: iapilgrim@gmail.com References: <21011689.post@talk.nabble.com> <5380c69c0812150301m303b0c9atf6eb764819ff34a2@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi Claus, Thanks for your quick reply. I tried your hint and I got these messages org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: class org.apache.camel.component.jms.JmsMessage to the required type: org.pyco.core.linkmanagement.event.Event with value JmsMessage: ActiveMQTextMessage {commandId = 5, responseRequired = true, messageId = ID:pr-vanle-58918-1229398784102-2:11:1:1:1, originalDestination = null, originalTransactionId = null, producerId = ID:pr-vanle-58918-1229398784102-2:11:1:1, destination = queue://events, transactionId = null, expiration = 0, timestamp = 1229398844786, arrival = 0, brokerInTime = 1229398844787, brokerOutTime = 1229398844787, correlationId = null, replyTo = null, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = null, marshalledProperties = null, dataStructure = null, redeliveryCounter = 0, size = 1024, properties = {fireTime=Tue Dec 16 10:40:44 ICT 2008, jobRunTime=-1, triggerGroup=myGroup, scheduledFireTime=Tue Dec 16 10:40:44 ICT 2008, previousFireTime=Tue Dec 16 10:40:38 ICT 2008, refireCount=0, triggerName=myTimerName}, readOnlyProperties = true, readOnlyBody = true, droppable = false, text = Hello} Here my comments: + I don't know this error much. I guess I need a converter but what I need to do to make a converter. I mean a converter to convert hello message is no use here. + I don't know why we have this kind of statement. from("quartz://myGroup/myTimerName?trigger.repeatInterval=6000&trigger.repeatCount=10").transform(constant("Hello")).to("jms:queue:events"); I have had events in my queue also ( created by producer). If I add new data to jms queue, only for trigger scheduler. It's weird. + Timer component have similar uri to quartz from("timer://foo?fixedRate=true&period=6000").to("jms:queue:events"); but it behaves as I expect. I don't know why ( i'm not clear) And... + How can I use jms converter with camel or camel-spring? I used jms with spring before then I have a little confused. + When can I use Camel 2.0? I have just glance over Camel 2.0 Jira, and found there are many issues have been fixed. So can I use camel source in the trunk? If yes, how can I implement schedule by using quartz and jms component? Many thanks, Van Claus Ibsen-2 wrote: > > Hi > > Ah we have some tickets in JIRA to improve the quartz component for Camel > 2.0. > > As you just want to use quartz to trigger the even by sending a > "dummy" message to a JMS queue, then you can send some sort of > constant body that can be serialized and send to the JMS queue > > from("quartz://myGroup/myTimerName?trigger.repeatInterval=6000&trigger.repeatCount=10").transform(constant("Hello")). > to("jms:queue:events"); > > > > On Mon, Dec 15, 2008 at 11:49 AM, iapilgrim wrote: >> >> Hi, >> I'm very new to Camel. >> My situation is making scheduler for some listeners on JMS queue. >> For example, when I configure this way, the dummyListener will check >> event >> in jms queue for every 6s. >> >> from("timer://foo?fixedRate=true&period=6000").to("jms:queue:events"); >> from("jms:queue:events").to("dummyListener"); >> I want to improve the scheduler by replace timer with quartz >> from("quartz://myGroup/myTimerName?trigger.repeatInterval=6000&trigger.repeatCount=10").to("jms:queue:events"); >> >> But when I run, I got the following error message >> >> [ERROR] processor.DeadLetterChannel Failed delivery for exchangeId: >> ID-pr-vanle/60407-1229325928115/0-2. On delivery attempt: 2 caught: >> java.lang.RuntimeException: >> org.apache.camel.component.quartz.QuartzEndpoint >> java.lang.RuntimeException: >> org.apache.camel.component.quartz.QuartzEndpoint >> at >> org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:104) >> at >> org.apache.activemq.command.ActiveMQObjectMessage.setObject(ActiveMQObjectMessage.java:155) >> at >> org.apache.activemq.ActiveMQSession.createObjectMessage(ActiveMQSession.java:317) >> at >> org.apache.camel.component.jms.JmsBinding.createJmsMessage(JmsBinding.java:273) >> at >> org.apache.camel.component.jms.JmsBinding.makeJmsMessage(JmsBinding.java:139) >> at >> org.apache.camel.component.jms.JmsProducer$2.createMessage(JmsProducer.java:229) >> at >> org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:570) >> at >> org.springframework.jms.core.JmsTemplate$4.doInJms(JmsTemplate.java:551) >> at >> org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:471) >> at >> org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:548) >> at >> org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:227) >> at >> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:43) >> at >> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:75) >> at >> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:57) >> at >> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:155) >> at >> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:91) >> at >> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:57) >> at >> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:39) >> at >> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41) >> at >> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66) >> at >> org.apache.camel.processor.loadbalancer.QueueLoadBalancer.process(QueueLoadBalancer.java:41) >> at >> org.apache.camel.component.quartz.QuartzEndpoint.onJobExecute(QuartzEndpoint.java:117) >> at >> org.apache.camel.component.quartz.CamelJob.execute(CamelJob.java:32) >> at org.quartz.core.JobRunShell.run(JobRunShell.java:203) >> at >> org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520) >> Caused by: java.io.NotSerializableException: >> org.apache.camel.component.quartz.QuartzEndpoint >> at >> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156) >> at >> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326) >> at java.util.HashMap.writeObject(HashMap.java:1001) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >> at java.lang.reflect.Method.invoke(Method.java:597) >> at >> java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) >> at >> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461) >> at >> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) >> at >> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) >> at >> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) >> at >> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) >> at >> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) >> at >> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) >> at >> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) >> at >> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) >> at >> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) >> at >> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) >> at >> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326) >> at >> org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:98) >> ... 24 more >> >> I'm maybe wrong in using quartz and jms. Could you give any example? >> I'd appreciate your help. >> Thanks and regards, >> Van >> -- >> View this message in context: >> http://www.nabble.com/Schedule-JMS-consumer-tp21011689s22882p21011689.html >> Sent from the Camel - Users mailing list archive at Nabble.com. >> >> > > > > -- > > /Claus Ibsen > Apache Camel Committer > Blog: http://davsclaus.blogspot.com/ > > -- View this message in context: http://www.nabble.com/Schedule-JMS-consumer-tp21011689s22882p21026931.html Sent from the Camel - Users mailing list archive at Nabble.com.