On 01/02/2008, EJLeVin1 <[EMAIL PROTECTED]> wrote:
>
> Hello,
> We are using Camel to manage our endpoint injection through spring for
> activemq. We currently are very happy with it except for one issue that has
> fallen in my lap that I can't quite seem to find the answer to. Essentially
> what happens is once our app is up and running for a while everything is
> working great; however, RIGHT when the app starts up, there are ~ 250-500
> msgs that "get sent to amq" through an injected camel endpoint (using an
> annotation), for some reason these messages never make it to amq (the queue
> sizes don't change) and no errors etc occur. If anyone knows a good
> direction to head in I would greatly appreciate it. Below are the sections
> of my config that are surrounding this. By the way -- we are using Camel
> 1.3-SNAPSHOT right now. Also, I know that I could have the activemq
> endpoint directly injected into my java class, but the reason I am using the
> direct: uri is to allow additional route configuration without changing the
> source. Thanks so much for your help!
>
> ------- JAVA CLASS THAT IS PRODUCER ------
> public class BatchUpdateQueueProducer implements IMessageProducer
> {
> @org.apache.camel.EndpointInject(uri="direct:BatchUpdateQueue")
> ProducerTemplate producer;
>
> public void sendMessage(Object message)
> {
> if(message != null)
> {
> producer.sendBody(convertToMessage(message));
> }
> }
> .....
> }
>
> ------- SPRING CONFIGURATION ------
>
> <beans ... >
> <camelContext id="camel"
> xmlns="http://activemq.apache.org/camel/schema/spring">
> <package>com.mydomain.camel</package>
> <route>
> <from uri="direct:BatchUpdateQueue"/>
> <to uri="activemq:queue:BatchUpdateQueue"/>
> </route>
> </camelContext>
> ...
> <bean id="activemq"
> class="org.apache.camel.component.jms.JmsComponent">
> <property name="connectionFactory">
> <bean class="org.apache.activemq.ActiveMQConnectionFactory">
> <property name="brokerURL"
> value="${jms.providerUrl}?wireFormat.maxInactivityDuration=10000"/>
> <property name="redeliveryPolicy">
> <bean
> class="org.apache.activemq.RedeliveryPolicy">
> <property
> name="initialRedeliveryDelay" value="2000"/>
> <property name="maximumRedeliveries"
> value="15"/>
> <property
> name="useCollisionAvoidance" value="true"/>
> </bean>
> </property>
> </bean>
> </property>
> </bean>
> ...
> <bean id="camelBatchUpdateQueueProducer"
> class="com.mydomain.camel.BatchUpdateQueueProducer" />
> <beans>
I wonder if your start up code thats sending the messages is in a
transaction that doesn't commit?
Maybe wrapping your code inside a Spring TransationTemplate might help?
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://open.iona.com