On Fri, Jan 29, 2010 at 12:30 PM, BenXS <bxsto...@yahoo.co.uk> wrote: > > Ok, thank you. > > So duplication is not possible with Camel at all? >
Its the JMS Broker which may or may not offer such a feature to duplicate/log whatever comes into it. If using AMQ then try looking and asking at AMQ user forum. Its just not a standard feature in JMS. Hence the different vendors may have a custom solution for that. If you use Camel to send the messages then you can of course let Camel log a message before its send. And spend some time googling what you want. It took me 5 sec to google and find this link: http://old.nabble.com/How-to-log-all-incoming-and-outgoing-JMS-msgs--td27307961.html > Or is this route command only the wrong way to achieve this? > > I need simply a way to log all incoming JMS msgs in a certain queue to > either > - another queue > or alternatively > - an own xml file > > The JMS msg should be (beside the logging) normally consumed by another > process. > > How should I setup such a <route> config command? > > Ben > > > Claus Ibsen-2 wrote: >> >> On Fri, Jan 29, 2010 at 11:32 AM, BenXS <bxsto...@yahoo.co.uk> wrote: >>> >>> Ok, so I leave the <bean> active and specified as camelContext in >>> camel.xml >>> in activemq config dir: >>> >>> <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> >>> <packageScan> >>> <packages>org.foo.bar</packages> >>> </packageScan> >>> <route> >>> <from uri="activemq:myqueue123" /> >>> <to uri="activemq:myqueue555" /> >>> </route> >>> </camelContext> >>> >>> In order to duplicate all incoming JMS msgs and put their clone into >>> another >>> queue myqueue555 on the same MessageBroker. >>> >>> Unfortunately when I sent now a message into myqueue123 then after a >>> couple >>> of seconds the following error messages appear in ActiveMQ window and the >>> messages were NOT duplicated as intended. >> >> You are not duplicating messages, you are routing them. That is the >> way JMS works. >> When you consume a message from a queue its being removed from that >> queue. JMS do not do copies per see. >> >> And about that exception. Its because your JMS message on the Queue >> have a JMSReplyTo set which makes Camel use request/reply over JMS. >> You can use option disableReplyTo=true when on the <to> endpoint to >> ignore JMSReplyTo. >> >> >>> >>> Why? >>> >>> INFO | ActiveMQ WebConsole initialized. >>> INFO | Initializing Spring FrameworkServlet 'dispatcher' >>> INFO | ActiveMQ Console at http://0.0.0.0:8161/admin >>> INFO | Initializing Spring root WebApplicationContext >>> INFO | Connector vm://localhost Started >>> INFO | Camel Console at http://0.0.0.0:8161/camel >>> INFO | ActiveMQ Web Demos at http://0.0.0.0:8161/demo >>> INFO | RESTful file access application at http://0.0.0.0:8161/fileserver >>> INFO | Started selectchannelconnec...@0.0.0.0:8161 >>> ERROR | org.apache.camel.ExchangeTimedOutException: The OUT message was >>> not >>> received >>> within: 20000 millis on the exchange: Exchange[JmsMessage: >>> ActiveMQTextMessage {commandId >>> = 5, responseRequired = true, messageId = >>> ID:ZZZZAAA0001-1778-1264697336417-0:7:1:1:1, >>> originalDestination = null, originalTransactionId = null, producerId = >>> ID:ZZZZAAA0001-1778-1264697336417-0:7:1:1, destination = >>> queue://myqueue123, >>> transactionId = null, expiration = 0, timestamp = 1264698126199, arrival >>> = >>> 0, brokerInTime >>> = 1264698126199, brokerOutTime = 1264698126292, correlationId = >>> 990020100128180206199, >>> replyTo = queue://myqueue555, persistent = true, type = Text, priority = >>> 4, >>> groupID = null, groupSequence = 0, targetConsumerId = null, compressed = >>> false, userID = >>> null, content = null, marshalledProperties = >>> org.apache.activemq.util.byteseque...@16c02df, dataStructure = null, >>> redeliveryCounter = >>> 0, size = 4076, properties = {msgselectr=000010}, readOnlyProperties = >>> true, >>> readOnlyBo >>> dy = true, droppable = false, text = <aaa:globaltestframe >>> si1:schem...frametype>}] >>> org.apache.camel.RuntimeCamelException: >>> org.apache.camel.ExchangeTimedOutException: The >>> OUT message was not received within: 20000 millis on the exchange: >>> Exchange[JmsMessage: >>> ActiveMQTextMessage {commandId = 5, responseRequired = true, messageId = >>> ID:ZZZZAAA0001-1778-1264697336417-0:7:1:1:1, originalDestination = null, >>> originalTransactionId = null, producerId = >>> ID:ZZZZAAA0001-1778-1264697336417-0:7:1:1, >>> destination = queue://myqueue123, transactionId = null, expiration = 0, >>> timestamp = 1264698126199, arrival = 0, brokerInTime = 1264698126199, >>> brokerOutTime = >>> 1264698126292, correlationId = 990020100128180206199, replyTo = >>> queue://myqueue555, persistent = true, type = Text, priority = 4, groupID >>> = >>> null, groupSequence = 0, targetConsumerId = null, compressed = false, >>> userID >>> = null, >>> content = null, marshalledProperties = >>> org.apache.activemq.util.byteseque...@16c02df, >>> dataStructure = null, redeliveryCounter = 0, size = 4076, properties = >>> {msgselectr=000010}, readO >>> nlyProperties = true, readOnlyBody = true, droppable = false, text = >>> <aaa:globaltestframe >>> si1:schem...frametype>}] >>> at >>> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1011) >>> at >>> org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.j >>> ava:103) >>> at >>> org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(Abstrac >>> tMessageListenerContainer.java:543) >>> at >>> -- >>> View this message in context: >>> http://old.nabble.com/How-does-Camel-work-with-ActiveMQ---tp27311853p27369931.html >>> Sent from the Camel - Users (activemq) mailing list archive at >>> Nabble.com. >>> >>> >> >> >> >> -- >> Claus Ibsen >> Apache Camel Committer >> >> Author of Camel in Action: http://www.manning.com/ibsen/ >> Open Source Integration: http://fusesource.com >> Blog: http://davsclaus.blogspot.com/ >> Twitter: http://twitter.com/davsclaus >> >> > > -- > View this message in context: > http://old.nabble.com/How-does-Camel-work-with-ActiveMQ---tp27311853p27370691.html > Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. > > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus