camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From preben <p...@dr.dk>
Subject Re: wiretap getting header value
Date Wed, 20 Jan 2010 12:46:37 GMT

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


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 <pras@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 <pras@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 <pras@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.


Mime
View raw message