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 Mon, 25 Jan 2010 13:35:44 GMT

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

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

Thanks Preben for verifying that its the AOP thing that causes this problem in Camel.

I will change the ticket subject and work on a solution in Camel. I recon there CGLIB enhanced
class got some methods to get access to the original bean which Camel can use to scan so it
can bind the parameters. But it may be a little tough work to get it working.

This wont make it in 2.2 release, so I assigned it for the 2.3 timeframe

> 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