On Wed, Jan 20, 2010 at 2:04 PM, preben <p...@dr.dk> wrote:
>
> The auditmessageDAO is not defined in xml but using @Repository annotation
> and is picked up by Spring douring initializing of the applicationContext.
> Is there a issue regarding this ? should it be defined in XML instead (Camel
> + Spring dependencies)
> The funny thing is thoug that the body gets bound with fine xml payload but
> the header param is missing.
>

The first parameter will fallback to be the body so I suspect Camel
did not have a chance to leverage its post processor as well to bind
the annotations.

You are much welcome to put together a little zip file with a sample
of this issue. Then create a ticket in JIRA. Then we can take a look
if there is something we can do/improve/fix etc. to get that situation
working as well.

Try defining the bean using <bean/> or the
<context-annotation:driven/> (or what that spring tag is called).

And you are also welcome to try with 2.2-SNAPSOHT whether that should
help. However I dont think we have changed much in that area.

>
>
> Claus Ibsen-2 wrote:
>>
>> On Wed, Jan 20, 2010 at 1:46 PM, preben <p...@dr.dk> wrote:
>>>
>>> Actually I was looking for JMSMessageID like this
>>> @Header(value="JMSMessageID") String jmsMessageId, but when that didn't
>>> work
>>> i changed it to @Headers Map to see if I get any values.
>>> The parameter get's bound as null !!
>>
>> And how is auditMessageDAO defined in the XML file?
>>
>> Those annotations only work if the Spring bean post processor does it
>> job and let Camel have a chance later.
>> There used to be some more weird combos where Spring failed to do so.
>>
>> It will log a INFO/WARN about bean XXX is illegible for bean post
>> processing or something like that.
>>
>> You can always use Exchange or Message as the type and get the data,
>> but I understand if you want to use a clean POJO without using Camel
>> API in the method signature.
>>
>> You can try a simpler example to get the POJO stuff working without
>> the JMS etc. Then you know that Spring + Camel works as expected.
>>
>>
>>
>>>
>>>
>>> Claus Ibsen-2 wrote:
>>>>
>>>> Hi
>>>>
>>>> So which headers are you looking for to be in the audit bean?
>>>> You do not have any custom JMS properties, only the regular JMS headers.
>>>>
>>>> And you are saying that Map instance is empty? or is it null?
>>>>
>>>>
>>>>
>>>> On Wed, Jan 20, 2010 at 12:26 PM, preben <p...@dr.dk> wrote:
>>>>>
>>>>> Im using camel v. 2.1.0 Sure the 2nd route says:
>>>>> [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><sourceURL>whatson/133258748813</sourceURL><Element><dataProvider>M</dataProvider><relStartTime>0</relStartTime><duration>1340</duration><title>Unittest
>>>>> record
>>>>> title</title><countryOrigin>31</countryOrigin><countryConnection>0</countryConnection><musaNo>123609030081111</musaNo><side>1</side><cut>1</cut><partcut>-1</partcut><musaComplete>J</musaComplete><drProduction>J</drProduction><recordingDate>2009-08-20</recordingDate><recordLabel>Unittest
>>>>> record title</recordLabel><recordTitle>Unittest record
>>>>> title</recordTitle><Names><Name><name>DR
>>>>> SymfoniOrkestret</name><country>7</country><role>Gruppe/Solist</role><salesArtist>N</salesArtist></Name><Name><name>Thomas
>>>>> Dausgaard</name><country>7</country><role>Gruppe/Solist</role><salesArtist>J</salesArtist></Name><Name><name>César
>>>>> Franck</name><country>10</country><role>Komponist</role><salesArtist>N</salesArtist></Name></Names></Element></Publication>]
>>>>>
>>>>>
>>>>> Claus Ibsen-2 wrote:
>>>>>>
>>>>>> What does the tracer say in the 2nd route?
>>>>>>
>>>>>> camel:route id="AuditRoute">
>>>>>>                        <camel:from uri="seda:audit"/>
>>>>>>                        <camel:bean ref="auditMessageDAO"
>>>>>> method="audit"/>
>>>>>>
>>>>>> eg from seda:audit -> auditMessageDAO
>>>>>> this is the interesting part
>>>>>>
>>>>>> BTW which version of Camel are you using?
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Wed, Jan 20, 2010 at 11:49 AM, preben <p...@dr.dk> wrote:
>>>>>>>
>>>>>>> Hi Claus
>>>>>>>
>>>>>>> Seems that the headers are present even on the wiretap endpoint.
>>>>>>> :
>>>>>>> [DefaultMessageListenerContainer-1] 20 jan. 2010 - 11:44:01,614 INFO
>>>>>>> org.apache.camel.processor.interceptor.Tracer
>>>>>>> [ID:7D97437F084F8E83E040650A0A1027E5 >>> (RapNotificationRoute)
>>>>>>> from(oracleQueue://queue:FURTHERELEMENTS_TEST?jmsMessageType=Text)
>>>>>>> -->
>>>>>>> transacted[ref:PROPAGATION_REQUIRED] <<< Pattern:InOnly,
>>>>>>> Headers:{JMSXGroupID=null, JMSReplyTo=null,
>>>>>>> JMSMessageID=ID:7D97437F084F8E83E040650A0A1027E5, JMSPriority=1,
>>>>>>> JMSCorrelationID=null, JMSXRecvTimestamp=1263984241614,
>>>>>>> JMSRedelivered=true,
>>>>>>> JMSXState=0, JMSType=null, JMSExpiration=0,
>>>>>>> JMSTimestamp=1263984237832,
>>>>>>> JMSXUserID=playliste, JMSDestination=PLAYLISTE.FURTHERELEMENTS_TEST,
>>>>>>> JMS_OracleTimestamp=1263984237832, JMSDeliveryMode=2,
>>>>>>> JMS_OracleDeliveryMode=2, JMS_OracleDelay=0, JMSXDeliveryCount=2},
>>>>>>> BodyType:byte[], Body:<?xml version="1.0" encoding="UTF-8"
>>>>>>> standalone="yes"?><Publication><sourceURL>whatson/133258748813</sourceURL><Element><dataProvider>M</dataProvider><relStartTime>0</relStartTime><duration>1340</duration><title>Unittest
>>>>>>> record
>>>>>>> title</title><countryOrigin>31</countryOrigin><countryConnection>0</countryConnection><musaNo>123609030081111</musaNo><side>1</side><cut>1</cut><partcut>-1</partcut><musaComplete>J</musaComplete><drProduction>J</drProduction><recordingDate>2009-08-20</recordingDate><recordLabel>Unittest
>>>>>>> record title</recordLabel><recordTitle>Unittest record
>>>>>>> title</recordTitle><Names><Name><name>DR
>>>>>>> SymfoniOrkestret</name><country>7</country><role>Gruppe/Solist</role><salesArtist>N</salesArtist></Name><Name><name>Thomas
>>>>>>> Dausgaard</name><country>7</country><role>Gruppe/Solist</role><salesArtist>J</salesArtist></Name><Name><name>César
>>>>>>> Franck</name><country>10</country><role>Komponist</role><salesArtist>N</salesArtist></Name></Names></Element></Publication>]
>>>>>>>
>>>>>>> [DefaultMessageListenerContainer-1] 20 jan. 2010 - 11:44:01,614 INFO
>>>>>>> org.apache.camel.processor.interceptor.Tracer
>>>>>>> [ID:7D97437F084F8E83E040650A0A1027E5 >>> (RapNotificationRoute)
>>>>>>> transacted[ref:PROPAGATION_REQUIRED] --> wireTap(seda://audit) <<<
>>>>>>> Pattern:InOnly, Headers:{JMSXGroupID=null, JMSReplyTo=null,
>>>>>>> JMSMessageID=ID:7D97437F084F8E83E040650A0A1027E5, JMSPriority=1,
>>>>>>> JMSCorrelationID=null, JMSXRecvTimestamp=1263984241614,
>>>>>>> JMSRedelivered=true,
>>>>>>> JMSXState=0, JMSType=null, JMSExpiration=0,
>>>>>>> JMSTimestamp=1263984237832,
>>>>>>> JMSXUserID=playliste, JMSDestination=PLAYLISTE.FURTHERELEMENTS_TEST,
>>>>>>> JMS_OracleTimestamp=1263984237832, JMSDeliveryMode=2,
>>>>>>> JMS_OracleDeliveryMode=2, JMS_OracleDelay=0, JMSXDeliveryCount=2},
>>>>>>> BodyType:byte[], Body:<?xml version="1.0" encoding="UTF-8"
>>>>>>> standalone="yes"?><Publication><sourceURL>whatson/133258748813</sourceURL><Element><dataProvider>M</dataProvider><relStartTime>0</relStartTime><duration>1340</duration><title>Unittest
>>>>>>> record
>>>>>>> title</title><countryOrigin>31</countryOrigin><countryConnection>0</countryConnection><musaNo>123609030081111</musaNo><side>1</side><cut>1</cut><partcut>-1</partcut><musaComplete>J</musaComplete><drProduction>J</drProduction><recordingDate>2009-08-20</recordingDate><recordLabel>Unittest
>>>>>>> record title</recordLabel><recordTitle>Unittest record
>>>>>>> title</recordTitle><Names><Name><name>DR
>>>>>>> SymfoniOrkestret</name><country>7</country><role>Gruppe/Solist</role><salesArtist>N</salesArtist></Name><Name><name>Thomas
>>>>>>> Dausgaard</name><country>7</country><role>Gruppe/Solist</role><salesArtist>J</salesArtist></Name><Name><name>César
>>>>>>> Franck</name><country>10</country><role>Komponist</role><salesArtist>N</salesArtist></Name></Names></Element></Publication>]
>>>>>>>
>>>>>>>
>>>>>>> Claus Ibsen-2 wrote:
>>>>>>>>
>>>>>>>> On Wed, Jan 20, 2010 at 9:52 AM, preben <p...@dr.dk> wrote:
>>>>>>>>>
>>>>>>>>> Hi
>>>>>>>>>
>>>>>>>>> I'm trying to create a auditservice using a wiretap.
>>>>>>>>>
>>>>>>>>> eg.
>>>>>>>>>        <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>
>>>>>>>>>
>>>>>>>>> The auditMessageDAO takes 2 parameters
>>>>>>>>>
>>>>>>>>> public void audit(@Body String body, @Headers Map headers)
>>>>>>>>>
>>>>>>>>> The body gets bound, but the headers parameter doesn't ??
>>>>>>>>> Any idear how this is done best ???
>>>>>>>>>
>>>>>>>>
>>>>>>>> Use the tracer to see if the headers are avail when you consume from
>>>>>>>> the Oracle MQ queue. It may play tricks on you :)
>>>>>>>> http://camel.apache.org/tracer
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>> Preben
>>>>>>>>> --
>>>>>>>>> View this message in context:
>>>>>>>>> http://old.nabble.com/wiretap-getting-header-value-tp27238444p27238444.html
>>>>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Claus Ibsen
>>>>>>>> Apache Camel Committer
>>>>>>>>
>>>>>>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>>>>>> Open Source Integration: http://fusesource.com
>>>>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>>>> Twitter: http://twitter.com/davsclaus
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://old.nabble.com/wiretap-getting-header-value-tp27238444p27239795.html
>>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Claus Ibsen
>>>>>> Apache Camel Committer
>>>>>>
>>>>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>>>> Open Source Integration: http://fusesource.com
>>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>> Twitter: http://twitter.com/davsclaus
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://old.nabble.com/wiretap-getting-header-value-tp27238444p27240209.html
>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Claus Ibsen
>>>> Apache Camel Committer
>>>>
>>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>> Open Source Integration: http://fusesource.com
>>>> Blog: http://davsclaus.blogspot.com/
>>>> Twitter: http://twitter.com/davsclaus
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://old.nabble.com/wiretap-getting-header-value-tp27238444p27241149.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>>
>
> --
> View this message in context: 
> http://old.nabble.com/wiretap-getting-header-value-tp27238444p27241380.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to