Grokbase Groups Camel users June 2011
FAQ
If I declare a route:

<from uri="activemq:topic:src"/>
<to uri="activemq:topic:dest"/>

when I restart tomcat, the activemq:topic:src is still there as it has persistent messages but the activemq:topic:dest topic disappears along with all messages waiting for durable subscribers in it.

Camel takes all the messages from dest and puts them in src, and they are all then lost as src is destroyed on restart. Somehow the messages are not marked as persistent in the dest topic.

I've tried transacted routing but it still doesn't work. I'm using ruby clients over STOMP to send and receive persistent messages via the route:

<broker brokerName="matrixBroker" id="matrixBrokerID" useJmx="true" persistent="true" xmlns="http://activemq.apache.org/schema/core">
<transportConnectors>
<transportConnector uri="tcp://localhost:61616" />
<transportConnector name="stomp" uri="stomp://localhost:61613"/>
</transportConnectors>
</broker>

<bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory" depends-on="matrixBrokerID">
<property name="brokerURL" value="vm://matrixBroker?create=false"/>
</bean>

<bean id="jmsTransactionManager" class="org.springframework.jms.connection.JmsTransactionManager">
<property name="connectionFactory" ref="jmsConnectionFactory"/>
</bean>

<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="connectionFactory" ref="jmsConnectionFactory"/>
<property name="transacted" value="true"/>
<property name="transactionManager" ref="jmsTransactionManager"/>
</bean>


can anyone help please?

thanks,

Alistair

--
mov eax,1
mov ebx,0
int 80h

Search Discussions

  • Alistair Young at Jun 23, 2011 at 11:42 am
    forgot to add transacted to the route:

    <route>
    <from uri="activemq:topic:src"/>
    <transacted />
    <to uri="activemq:topic:dest"/>
    </route>

    but I just get the error:

    Invalid content was found starting with element 'transacted'. One of ... expected

    Alistair

    --
    mov eax,1
    mov ebx,0
    int 80h



    On 23 Jun 2011, at 12:00, Alistair Young wrote:

    If I declare a route:

    <from uri="activemq:topic:src"/>
    <to uri="activemq:topic:dest"/>

    when I restart tomcat, the activemq:topic:src is still there as it has persistent messages but the activemq:topic:dest topic disappears along with all messages waiting for durable subscribers in it.

    Camel takes all the messages from dest and puts them in src, and they are all then lost as src is destroyed on restart. Somehow the messages are not marked as persistent in the dest topic.

    I've tried transacted routing but it still doesn't work. I'm using ruby clients over STOMP to send and receive persistent messages via the route:

    <broker brokerName="matrixBroker" id="matrixBrokerID" useJmx="true" persistent="true" xmlns="http://activemq.apache.org/schema/core">
    <transportConnectors>
    <transportConnector uri="tcp://localhost:61616" />
    <transportConnector name="stomp" uri="stomp://localhost:61613"/>
    </transportConnectors>
    </broker>

    <bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory" depends-on="matrixBrokerID">
    <property name="brokerURL" value="vm://matrixBroker?create=false"/>
    </bean>

    <bean id="jmsTransactionManager" class="org.springframework.jms.connection.JmsTransactionManager">
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
    </bean>

    <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
    <property name="transacted" value="true"/>
    <property name="transactionManager" ref="jmsTransactionManager"/>
    </bean>


    can anyone help please?

    thanks,

    Alistair

    --
    mov eax,1
    mov ebx,0
    int 80h


  • Alistair Young at Jun 23, 2011 at 12:36 pm
    so I sorted that error but persistent messages are destroyed by camel routes. As soon as camel moves a persistent message from the src topic to the dest topic, it's no longer persistent and is discarded on restart. Even if the route is transacted. Of course, I'm prolly not understanding what transacted means in this case.

    I'm just trying to send a persistent message to a topic and have it routed as a persistent message to another topic. Is this possible without transaction specific code in the clients?

    Alistair

    --
    mov eax,1
    mov ebx,0
    int 80h



    On 23 Jun 2011, at 12:41, Alistair Young wrote:

    forgot to add transacted to the route:

    <route>
    <from uri="activemq:topic:src"/>
    <transacted />
    <to uri="activemq:topic:dest"/>
    </route>

    but I just get the error:

    Invalid content was found starting with element 'transacted'. One of .. expected

    Alistair

    --
    mov eax,1
    mov ebx,0
    int 80h



    On 23 Jun 2011, at 12:00, Alistair Young wrote:

    If I declare a route:

    <from uri="activemq:topic:src"/>
    <to uri="activemq:topic:dest"/>

    when I restart tomcat, the activemq:topic:src is still there as it has persistent messages but the activemq:topic:dest topic disappears along with all messages waiting for durable subscribers in it.

    Camel takes all the messages from dest and puts them in src, and they are all then lost as src is destroyed on restart. Somehow the messages are not marked as persistent in the dest topic.

    I've tried transacted routing but it still doesn't work. I'm using ruby clients over STOMP to send and receive persistent messages via the route:

    <broker brokerName="matrixBroker" id="matrixBrokerID" useJmx="true" persistent="true" xmlns="http://activemq.apache.org/schema/core">
    <transportConnectors>
    <transportConnector uri="tcp://localhost:61616" />
    <transportConnector name="stomp" uri="stomp://localhost:61613"/>
    </transportConnectors>
    </broker>

    <bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory" depends-on="matrixBrokerID">
    <property name="brokerURL" value="vm://matrixBroker?create=false"/>
    </bean>

    <bean id="jmsTransactionManager" class="org.springframework.jms.connection.JmsTransactionManager">
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
    </bean>

    <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
    <property name="transacted" value="true"/>
    <property name="transactionManager" ref="jmsTransactionManager"/>
    </bean>


    can anyone help please?

    thanks,

    Alistair

    --
    mov eax,1
    mov ebx,0
    int 80h


  • Ashwin Karpe at Jun 23, 2011 at 7:03 pm
    Hi,

    There are several things here

    a> Are the subscribers truly durable ?
    In order to set up a durable subscription on a JMS endpoint, you
    must specify a client ID, which identifies this particular connection, and a
    durable subscription name, which identifies the durable subscriber. For
    example, the following route sets up a durable subscription to the JMS
    topic, news, with a client ID of conn01 and a durable subscription name of
    John.Doe:

    from("activemq:topic:src).

    to(""activemq:topic:dest?clientId=conn01&durableSubscriptionName=John.Doe");

    Also check out this blog. It is pretty instructive

    http://stefanlearninglog.blogspot.com/2009/07/persistent-jms-topics-using-activemq.html
    http://stefanlearninglog.blogspot.com/2009/07/persistent-jms-topics-using-activemq.html

    b> Setting the persistent to "true" makes the broker a persistent broker
    however this is the default behavior of JMS per the JMS spec. The flag is
    interesting when set to "false". Hence you do not buy anything by explicitly
    setting this to true.

    c> Topics are only persistent if there are Durable subscribers, not
    otherwise... Messages are discarded in the absence of durable subscribers as
    there is no need to preserve them.

    Cheers,

    Ashwin...


    -----
    ---------------------------------------------------------
    Ashwin Karpe
    Apache Camel Committer & Sr Principal Consultant
    FUSESource (a Progress Software Corporation subsidiary)
    http://fusesource.com

    Blog: http://opensourceknowledge.blogspot.com
    CamelOne 2011: http://fusesource.com/camel2011
    ---------------------------------------------------------
    --
    View this message in context: http://camel.465427.n5.nabble.com/Disappearing-topics-in-routes-tp4517076p4518662.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • Alistair Young at Jun 24, 2011 at 8:08 am
    thanks Ashwin, all working now.

    cheers,

    Alistair

    --
    mov eax,1
    mov ebx,0
    int 80h



    On 23 Jun 2011, at 20:03, Ashwin Karpe wrote:

    Hi,

    There are several things here

    a> Are the subscribers truly durable ?
    In order to set up a durable subscription on a JMS endpoint, you
    must specify a client ID, which identifies this particular connection, and a
    durable subscription name, which identifies the durable subscriber. For
    example, the following route sets up a durable subscription to the JMS
    topic, news, with a client ID of conn01 and a durable subscription name of
    John.Doe:

    from("activemq:topic:src).

    to(""activemq:topic:dest?clientId=conn01&durableSubscriptionName=John.Doe");

    Also check out this blog. It is pretty instructive

    http://stefanlearninglog.blogspot.com/2009/07/persistent-jms-topics-using-activemq.html
    http://stefanlearninglog.blogspot.com/2009/07/persistent-jms-topics-using-activemq.html

    b> Setting the persistent to "true" makes the broker a persistent broker
    however this is the default behavior of JMS per the JMS spec. The flag is
    interesting when set to "false". Hence you do not buy anything by explicitly
    setting this to true.

    c> Topics are only persistent if there are Durable subscribers, not
    otherwise... Messages are discarded in the absence of durable subscribers as
    there is no need to preserve them.

    Cheers,

    Ashwin...


    -----
    ---------------------------------------------------------
    Ashwin Karpe
    Apache Camel Committer & Sr Principal Consultant
    FUSESource (a Progress Software Corporation subsidiary)
    http://fusesource.com

    Blog: http://opensourceknowledge.blogspot.com
    CamelOne 2011: http://fusesource.com/camel2011
    ---------------------------------------------------------
    --
    View this message in context: http://camel.465427.n5.nabble.com/Disappearing-topics-in-routes-tp4517076p4518662.html
    Sent from the Camel - Users mailing list archive at Nabble.com.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriescamel
postedJun 23, '11 at 11:01a
activeJun 24, '11 at 8:08a
posts5
users2
websitecamel.apache.org

2 users in discussion

Alistair Young: 4 posts Ashwin Karpe: 1 post

People

Translate

site design / logo © 2021 Grokbase