camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "preben (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CAMEL-2384) Getting header value in pojo using @Header annotation
Date Thu, 21 Jan 2010 07:45:47 GMT

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

preben commented on CAMEL-2384:
-------------------------------

I run it from i unittest.
I will attatch the the source unittest and log trace for you to inspect. 
I wonder if it has something to do whith spring proxy'ing my auditMessageDAO ?

I have made 2 methods in my pojo :
1. taking the Exchange - works i'm able to get header etc.
2. taking 2 @body + @Header param. - doesnt work.

>From where do i get method.getParameterAnnotations() in my java pojo ?

> 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
>
> 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