activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slimrednano <steven...@rednano.sg>
Subject Re: Active MQ Message Persistence
Date Thu, 18 Sep 2008 04:04:58 GMT

Hi

Thanks for the prompt reply.

I have set the message to be persistence=true in the spring.xml
(applicationContext)

I am not sure whether the way how I configure the bean is correct?

Here I attached all my configurations for the camel and active mq components

Camel Component Configuration

<camel:camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/spring">
        <package>sg.sphsearch.adserver.messaging</package>      
        <endpoint id="adserver" uri="direct:unmarshalled"/>
</camel:camelContext>


ActiveMQ Component Configuration

<bean id="activemqOut" class="org.apache.camel.component.jms.JmsComponent">
        <property name="connectionFactory">
            <bean class="org.apache.activemq.ActiveMQConnectionFactory">
                <property name="brokerURL" value="${mq.broker.url}"/>
            </bean>
        </property>
        <property name="deliveryPersistent" value="true"/>
        <property name="subscriptionDurable" value="true"/>
        <property name="explicitQosEnabled" value="true"/>
</bean>    


The java class for camel routing
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.converter.jaxb.JaxbDataFormat;
import org.apache.camel.spi.DataFormat;

public class MessageRoutes extends RouteBuilder 
{

    DataFormat jaxb = new JaxbDataFormat("xx.xx.xx.messaging.model");

    @Override
    public void configure() throws Exception 
    {
        // Incoming routes
        from("activemq:topic:BTMSADSERVER").
                unmarshal(jaxb).
                to("bean:messageService?methodName=onConsume");
        
        // Outgoing routes
        from("adserver").
                marshal(jaxb).convertBodyTo(String.class).
                to("bean:messageService?methodName=logMessage").
                to("activemqOut:topic:ADSERVER");        
    }
}

Btw the message producer that I used is message producer from Camel

@EndpointInject(name = "adserver")
private ProducerTemplate producer;

Or should I use the message producer from jms.MessageProducer?

Anybody encounter this problems previously.

Thanks.


-- 
View this message in context: http://www.nabble.com/Active-MQ-Message-Persistence-tp19531361p19545533.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Mime
View raw message