camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CAMEL-2384) Getting header value in pojo using @Header annotation
Date Sun, 24 Jan 2010 13:09:44 GMT

    [ https://issues.apache.org/activemq/browse/CAMEL-2384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=57082#action_57082
] 

Claus Ibsen commented on CAMEL-2384:
------------------------------------

Preben

You should really mention that you use Spring AOP this has a huge impact as it does all kind
of proxying classes.

Try without that to see if you can get the @Header and @Body to work then. Then we knows its
because of Spring AOP and can use that to see if there is something we can fix.

> Getting header value in pojo using @Header annotation 
> ------------------------------------------------------
>
>                 Key: CAMEL-2384
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2384
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.1.0
>         Environment: Windows xp, jdk 1.6
>            Reporter: preben
>         Attachments: headers.zip
>
>
> Header value (and body) is not bound in pojo method:
> Route definiton:
>                 camel:route trace="true" id="RapNotificationRoute">
>                         <camel:from  uri="oracleQueue:queue:FURTHERELEMENTS_TEST?jmsMessageType=Text"/>
>                         <camel:transacted ref="PROPAGATION_REQUIRED"/>
>                         <camel:wireTap uri="seda:audit"/>
>                         <camel:to uri="mock:result"/>
>                 </camel:route>
>                 <camel:route id="AuditRoute">
>                         <camel:from uri="seda:audit"/>
>                         <camel:bean ref="auditMessageDAO" method="audit"/>
>                 </camel:route>
> auditMessageDAO interface:
>       public void audit(@Body String body, @Header(value="JMSMessageID" String jmsMessageId)
> Trace from log when running: 
> [Camel thread 0: seda://audit] 20 jan. 2010 - 12:22:09,858 INFO org.apache.camel.processor.interceptor.Tracer
> [42a5443b-0a62-4477-885f-c6f6c40274b1 >>> (AuditRoute) from(seda://audit) -->
ref:auditMessageDAO method: audit <<< Pattern:InOnly, Headers:{JMSDestination=PLAYLISTE.FURTHERELEMENTS_TEST,
JMS_OracleDelay=0, JMSDeliveryMode=2, JMSRedelivered=true, JMS_OracleTimestamp=1263986526156,
JMSType=null, JMSCorrelationID=null, JMSXRecvTimestamp=1263986529858, JMSXState=0, JMSXDeliveryCount=2,
JMSMessageID=ID:7D97CBE346B7CAA2E040650A0A103AC2, JMSTimestamp=1263986526156, JMSPriority=1,
JMSXGroupID=null, JMS_OracleDeliveryMode=2, JMSXUserID=playliste, JMSExpiration=0, JMSReplyTo=null},
BodyType:byte[], Body:<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Publication>hidden</Publication>]
> The exchange gets send (Evenen when using Oracle AQ) ;-) to the seda:audit endpoint and
the auditMessageDAO gets called. Body is bound to correct payload but the header element JMSMessageID
is null. If i change the parameter to include @Headers Map the parameter is still null.
> Current workaround is to use the Message, or Exchange as parameter, but then my pojo
will have dependencies on Camel - ok for now.
> See thread : http://old.nabble.com/wiretap-getting-header-value-ts27238444.html for further
details.
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message