You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Eamonn Dwyer <ea...@hotmail.com> on 2009/09/10 17:44:45 UTC

Capturing Jms headers data

Hi 
I would like to write an interceptor to capture all the JMS header data.  Would the following work?

for an inbound interceptor at the server side 
...
String buffer = new StringBuffer();
JMSMessageHeadersType jmsMessageHeadersType = 
                        (JMSMessageHeadersType)message.get("org.apache.cxf.jms.server.request.headers");
buffer.append("JMSCorrelationID" + "=" + jmsMessageHeadersType.getJMSCorrelationID()+ " ");
buffer.append("JMSMessageID" + "=" + jmsMessageHeadersType.getJMSMessageID()+ " ");
and so on for all the attributes in JMSMessageHeadersType.


For the outbound interceptor at the server side the type would be got from 
JMSMessageHeadersType jmsMessageHeadersType = 

                        (JMSMessageHeadersType)message.get("org.apache.cxf.jms.server.reply.headers");

and then on the client side use "org.apache.cxf.jms.client.repsonse.headers" and "org.apache.cxf.jms.client.reply.headers"


Thanks for any help/suggestions,

Eamonn

_________________________________________________________________
Get 30 Free Emoticons for your Windows Live Messenger
http://www.livemessenger-emoticons.com/funfamily/en-ie/

Re: Capturing Jms headers data

Posted by liucong <li...@gmail.com>.
Hi Eamonn,

Eamonn Dwyer wrote:
> Hi Liu
> thanks for that. So can you tell what I would be able to use to capture the JMS headers when the server is replying to the client if I shouldn't use "org.apache.cxf.jms.server.reply.headers"?
>
> Actually when is "org.apache.cxf.jms.server.reply.headers" used?
>
>   
Sorry, I think there is not a way to capture the JMS headers when the 
server is replying to the client. The only way is that the client get 
the replying message's headers.

"org.apache.cxf.jms.server.reply.headers" is used in the implementation.

> Also is my assumption for the client side : "then on the client side use "org.apache.cxf.jms.client.repsonse.headers" and "org.apache.cxf.jms.client.reply.headers"" correct?
>
>   
In the client,   "org.apache.cxf.jms.client.request.headers" and 
"org.apache.cxf.jms.client.repsonse.headers" are used.
After the client has sent the JMS message, you can check the 
"org.apache.cxf.jms.client.request.headers" to get the JMS headers.
 You can use an interceptor to check the 
"org.apache.cxf.jms.client.repsonse.headers" to get the reply JMS 
message headers.
> Thanks for the help 
> Eamonn
>
>   
>> Date: Fri, 11 Sep 2009 09:13:32 +0800
>> From: liucong07@gmail.com
>> To: dev@cxf.apache.org
>> Subject: Re: Capturing Jms headers data
>>
>> Hi,
>>
>>
>> Eamonn Dwyer wrote:
>>     
>>> Hi 
>>> I would like to write an interceptor to capture all the JMS header data.  Would the following work?
>>>
>>> for an inbound interceptor at the server side 
>>> ...
>>> String buffer = new StringBuffer();
>>> JMSMessageHeadersType jmsMessageHeadersType = 
>>>                         (JMSMessageHeadersType)message.get("org.apache.cxf.jms.server.request.headers");
>>> buffer.append("JMSCorrelationID" + "=" + jmsMessageHeadersType.getJMSCorrelationID()+ " ");
>>> buffer.append("JMSMessageID" + "=" + jmsMessageHeadersType.getJMSMessageID()+ " ");
>>> and so on for all the attributes in JMSMessageHeadersType.
>>>
>>>   
>>>       
>> It is OK for the inbound interceptor. The JMS transport first get the 
>> values of JMS header data and store them in the "
>>
>> org.apache.cxf.jms.server.request.headers". So the interceptor can get these data.
>>
>>     
>>> For the outbound interceptor at the server side the type would be got from 
>>> JMSMessageHeadersType jmsMessageHeadersType = 
>>>
>>>                         (JMSMessageHeadersType)message.get("org.apache.cxf.jms.server.reply.headers");
>>>
>>>   
>>>       
>> It is not right for the outbound interceptor. Because when the 
>> interceptor uses the value of "org.apache.cxf.jms.server.reply.headers" 
>> before the implementation generates it.
>>     
>>> and then on the client side use "org.apache.cxf.jms.client.repsonse.headers" and "org.apache.cxf.jms.client.reply.headers"
>>>
>>>
>>> Thanks for any help/suggestions,
>>>
>>> Eamonn
>>>
>>> _________________________________________________________________
>>> Get 30 Free Emoticons for your Windows Live Messenger
>>> http://www.livemessenger-emoticons.com/funfamily/en-ie/
>>>   
>>>       
>
> _________________________________________________________________
> With Windows Live, you can organize, edit, and share your photos.
> http://www.microsoft.com/ireland/windows/windowslive/products/photo-gallery-edit.aspx
>   


RE: Capturing Jms headers data

Posted by Eamonn Dwyer <ea...@hotmail.com>.
Hi Liu
thanks for that. So can you tell what I would be able to use to capture the JMS headers when the server is replying to the client if I shouldn't use "org.apache.cxf.jms.server.reply.headers"?

Actually when is "org.apache.cxf.jms.server.reply.headers" used?

Also is my assumption for the client side : "then on the client side use "org.apache.cxf.jms.client.repsonse.headers" and "org.apache.cxf.jms.client.reply.headers"" correct?

Thanks for the help 
Eamonn

> Date: Fri, 11 Sep 2009 09:13:32 +0800
> From: liucong07@gmail.com
> To: dev@cxf.apache.org
> Subject: Re: Capturing Jms headers data
> 
> Hi,
> 
> 
> Eamonn Dwyer wrote:
> > Hi 
> > I would like to write an interceptor to capture all the JMS header data.  Would the following work?
> >
> > for an inbound interceptor at the server side 
> > ...
> > String buffer = new StringBuffer();
> > JMSMessageHeadersType jmsMessageHeadersType = 
> >                         (JMSMessageHeadersType)message.get("org.apache.cxf.jms.server.request.headers");
> > buffer.append("JMSCorrelationID" + "=" + jmsMessageHeadersType.getJMSCorrelationID()+ " ");
> > buffer.append("JMSMessageID" + "=" + jmsMessageHeadersType.getJMSMessageID()+ " ");
> > and so on for all the attributes in JMSMessageHeadersType.
> >
> >   
> It is OK for the inbound interceptor. The JMS transport first get the 
> values of JMS header data and store them in the "
> 
> org.apache.cxf.jms.server.request.headers". So the interceptor can get these data.
> 
> > For the outbound interceptor at the server side the type would be got from 
> > JMSMessageHeadersType jmsMessageHeadersType = 
> >
> >                         (JMSMessageHeadersType)message.get("org.apache.cxf.jms.server.reply.headers");
> >
> >   
> It is not right for the outbound interceptor. Because when the 
> interceptor uses the value of "org.apache.cxf.jms.server.reply.headers" 
> before the implementation generates it.
> > and then on the client side use "org.apache.cxf.jms.client.repsonse.headers" and "org.apache.cxf.jms.client.reply.headers"
> >
> >
> > Thanks for any help/suggestions,
> >
> > Eamonn
> >
> > _________________________________________________________________
> > Get 30 Free Emoticons for your Windows Live Messenger
> > http://www.livemessenger-emoticons.com/funfamily/en-ie/
> >   
> 

_________________________________________________________________
With Windows Live, you can organize, edit, and share your photos.
http://www.microsoft.com/ireland/windows/windowslive/products/photo-gallery-edit.aspx

Re: Capturing Jms headers data

Posted by liucong <li...@gmail.com>.
Hi,


Eamonn Dwyer wrote:
> Hi 
> I would like to write an interceptor to capture all the JMS header data.  Would the following work?
>
> for an inbound interceptor at the server side 
> ...
> String buffer = new StringBuffer();
> JMSMessageHeadersType jmsMessageHeadersType = 
>                         (JMSMessageHeadersType)message.get("org.apache.cxf.jms.server.request.headers");
> buffer.append("JMSCorrelationID" + "=" + jmsMessageHeadersType.getJMSCorrelationID()+ " ");
> buffer.append("JMSMessageID" + "=" + jmsMessageHeadersType.getJMSMessageID()+ " ");
> and so on for all the attributes in JMSMessageHeadersType.
>
>   
It is OK for the inbound interceptor. The JMS transport first get the 
values of JMS header data and store them in the "

org.apache.cxf.jms.server.request.headers". So the interceptor can get these data.

> For the outbound interceptor at the server side the type would be got from 
> JMSMessageHeadersType jmsMessageHeadersType = 
>
>                         (JMSMessageHeadersType)message.get("org.apache.cxf.jms.server.reply.headers");
>
>   
It is not right for the outbound interceptor. Because when the 
interceptor uses the value of "org.apache.cxf.jms.server.reply.headers" 
before the implementation generates it.
> and then on the client side use "org.apache.cxf.jms.client.repsonse.headers" and "org.apache.cxf.jms.client.reply.headers"
>
>
> Thanks for any help/suggestions,
>
> Eamonn
>
> _________________________________________________________________
> Get 30 Free Emoticons for your Windows Live Messenger
> http://www.livemessenger-emoticons.com/funfamily/en-ie/
>