FAQ
Hi all,

I am new to Camel and I'm writing to ask for help.
With Jboss Fuse 6.2 I implemented pattern Splitter+Process+Aggregator for my
scenario.
I noticed that from route with id FileToIncomingTickets to route
ProcessMessageData and ReportingOnImport *header is not propagated* (When i
log value is empty for key eg. MessageCorrelationId or CamelSplitIndex)

This is my simple configuration

<camelContext id="ActiveMQContext"
xmlns="http://camel.apache.org/schema/spring">
   <route id="FileToIncomingTickets">
    <from uri="file:${sourcePath}" />
    <split parallelProcessing="true" streaming="false" >
     <tokenize token="\n" />
     <setHeader headerName="MessageCorrelationId" customId="true">
      <simple>Msg-CorrelationId-${file:onlyname}</simple>
     </setHeader>
     <log message="Put in CustomerIncomingTickets
($simple{in.header.MessageCorrelationId}): ${body}" />
     <to uri="activemq:queue:CustomerIncomingTickets"/>
    </split>
   </route>
   <route id="ProcessMessageData" >
    <from uri="activemq:queue:CustomerIncomingTickets" />
    <log message="Process Message:
$simple{in.header.CamelSplitIndex}/$simple{in.header.CamelSplitSize} -
$simple{in.header.MessageCorrelationId}" />
    <transacted />
    <process ref="msgTransform" />
    <log message="MessageTransformer result: ${body} -
$simple{in.header.MessageCorrelationId}" />
    <to uri="activemq:queue:CustomerOutcomingTickets"/>
   </route>
   <route id="ReportingOnImport">
    <from uri="activemq:queue:CustomerOutcomingTickets" />
    <log message="Reading msg processed for reporting by key
$simple{in.header.CorrelationKey}" />
             <aggregate strategyRef="groupedExchangeAggregator"
completionSize="2" ignoreInvalidCorrelationKeys="false"
completionFromBatchConsumer="true">
                 <correlationExpression>
                     <simple>header.MessageCorrelationId</simple>
                 </correlationExpression>
                 <log message="MessageAggregator result: ${body}" />
                 <to uri="mock:result" />
             </aggregate>
   </route>

  </camelContext>

  <bean id="groupedExchangeAggregator"

class="org.apache.camel.processor.aggregate.GroupedExchangeAggregationStrategy"
/>

  <bean id="msgTransform" class="com.fincons.crt.demo.mq.MessageTransformer"
/>




  <bean id="jmsConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
   <property name="brokerURL" value="tcp://localhost:61616" />
   <property name="userName" value="admin" />
   <property name="password" value="admin" />
  </bean>

  <bean id="pooledConnectionFactory"
class="org.apache.activemq.pool.PooledConnectionFactory"
   init-method="start" destroy-method="stop">
   <property name="maxConnections" value="8" />
   <property name="connectionFactory" ref="jmsConnectionFactory" />
  </bean>

  <bean id="jmsConfig"
class="org.apache.camel.component.jms.JmsConfiguration">
   <property name="connectionFactory" ref="pooledConnectionFactory" />
   <property name="concurrentConsumers" value="10" />
   <property name="transacted" value="true" />
   <property name="transactionManager" ref="jmsTransactionManager" />
  </bean>


  <bean id="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
   <property name="configuration" ref="jmsConfig" />
  </bean>

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

  <bean id="PROPAGATION_REQUIRED"
class="org.apache.camel.spring.spi.SpringTransactionPolicy">
      <property name="transactionManager" ref="jmsTransactionManager"/>
      <property name="propagationBehaviorName" value="PROPAGATION_REQUIRED"/>
  </bean>

Where i wrong?

Thanks in advance.




--
View this message in context: http://camel.465427.n5.nabble.com/Message-Header-is-not-propagated-tp5773401.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Search Discussions

  • Michele at Nov 6, 2015 at 7:36 am
    Hi,

    i resolved it following links reported below:

    http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html
    http://camel.apache.org/jms.html (transferExchange enabled)

    Sorry ;)!

    Thanks
    Regards
    Michele



    --
    View this message in context: http://camel.465427.n5.nabble.com/Message-Header-is-not-propagated-tp5773401p5773402.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • Vanshul.Chawla at Nov 9, 2015 at 6:07 am
    Message headers doesn't get passed on from one route to other.
    Its scope is within route only.

    -----Original Message-----
    From: Michele
    Sent: Thursday, November 05, 2015 10:26 PM
    To: users@camel.apache.org
    Subject: Message Header is not propagated!

    Hi all,

    I am new to Camel and I'm writing to ask for help.
    With Jboss Fuse 6.2 I implemented pattern Splitter+Process+Aggregator for my scenario.
    I noticed that from route with id FileToIncomingTickets to route ProcessMessageData and ReportingOnImport *header is not propagated* (When i log value is empty for key eg. MessageCorrelationId or CamelSplitIndex)

    This is my simple configuration

    <camelContext id="ActiveMQContext"
    xmlns="http://camel.apache.org/schema/spring">
       <route id="FileToIncomingTickets">
        <from uri="file:${sourcePath}" />
        <split parallelProcessing="true" streaming="false" >
         <tokenize token="\n" />
         <setHeader headerName="MessageCorrelationId" customId="true">
          <simple>Msg-CorrelationId-${file:onlyname}</simple>
         </setHeader>
         <log message="Put in CustomerIncomingTickets
    ($simple{in.header.MessageCorrelationId}): ${body}" />
         <to uri="activemq:queue:CustomerIncomingTickets"/>
        </split>
       </route>
       <route id="ProcessMessageData" >
        <from uri="activemq:queue:CustomerIncomingTickets" />
        <log message="Process Message:
    $simple{in.header.CamelSplitIndex}/$simple{in.header.CamelSplitSize} - $simple{in.header.MessageCorrelationId}" />
        <transacted />
        <process ref="msgTransform" />
        <log message="MessageTransformer result: ${body} - $simple{in.header.MessageCorrelationId}" />
        <to uri="activemq:queue:CustomerOutcomingTickets"/>
       </route>
       <route id="ReportingOnImport">
        <from uri="activemq:queue:CustomerOutcomingTickets" />
        <log message="Reading msg processed for reporting by key $simple{in.header.CorrelationKey}" />
                 <aggregate strategyRef="groupedExchangeAggregator"
    completionSize="2" ignoreInvalidCorrelationKeys="false"
    completionFromBatchConsumer="true">
                     <correlationExpression>
                         <simple>header.MessageCorrelationId</simple>
                     </correlationExpression>
                     <log message="MessageAggregator result: ${body}" />
                     <to uri="mock:result" />
                 </aggregate>
       </route>

      </camelContext>

      <bean id="groupedExchangeAggregator"

    class="org.apache.camel.processor.aggregate.GroupedExchangeAggregationStrategy"
    />

      <bean id="msgTransform" class="com.fincons.crt.demo.mq.MessageTransformer"
    />




      <bean id="jmsConnectionFactory"
    class="org.apache.activemq.ActiveMQConnectionFactory">
       <property name="brokerURL" value="tcp://localhost:61616" />
       <property name="userName" value="admin" />
       <property name="password" value="admin" />
      </bean>

      <bean id="pooledConnectionFactory"
    class="org.apache.activemq.pool.PooledConnectionFactory"
       init-method="start" destroy-method="stop">
       <property name="maxConnections" value="8" />
       <property name="connectionFactory" ref="jmsConnectionFactory" />
      </bean>

      <bean id="jmsConfig"
    class="org.apache.camel.component.jms.JmsConfiguration">
       <property name="connectionFactory" ref="pooledConnectionFactory" />
       <property name="concurrentConsumers" value="10" />
       <property name="transacted" value="true" />
       <property name="transactionManager" ref="jmsTransactionManager" />
      </bean>


      <bean id="activemq"
    class="org.apache.activemq.camel.component.ActiveMQComponent">
       <property name="configuration" ref="jmsConfig" />
      </bean>

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

      <bean id="PROPAGATION_REQUIRED"
    class="org.apache.camel.spring.spi.SpringTransactionPolicy">
          <property name="transactionManager" ref="jmsTransactionManager"/>
          <property name="propagationBehaviorName" value="PROPAGATION_REQUIRED"/>
      </bean>

    Where i wrong?

    Thanks in advance.




    --
    View this message in context: http://camel.465427.n5.nabble.com/Message-Header-is-not-propagated-tp5773401.html
    Sent from the Camel - Users mailing list archive at Nabble.com.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriescamel
postedNov 6, '15 at 7:36a
activeNov 9, '15 at 6:07a
posts3
users2
websitecamel.apache.org

2 users in discussion

Michele: 2 posts Vanshul.Chawla: 1 post

People

Translate

site design / logo © 2021 Grokbase