You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by "kishore.unnam" <ki...@nsn.com> on 2011/02/16 11:33:14 UTC

setting poperty in Interceptor and reading it in SE.

Hi all,

my requirement is to add the time(when it is received by cxf BC) to the
message and to read the same in SE, to do the same i have done like the
following .

public class LatencyCalcInterceptior extends AbstractSoapInterceptor {

	private static final Logger LOG = Logger
			.getLogger(LatencyCalcInterceptior.class.getName());

	public LatencyCalcInterceptior() {
		super(Phase.RECEIVE);
	}

	public void handleMessage(SoapMessage message) throws Fault {
	    message.put("cxfbcstarttime",System.currentTimeMillis());  // type 1
	    message.getExchange().put("cxfbcstarttime",System.currentTimeMillis()); 
//type 2
	    
	}

}

i tried different approaches to read the property in SE but it doesn't seem
to be coming to SE .please help me .


-- 
View this message in context: http://servicemix.396122.n5.nabble.com/setting-poperty-in-Interceptor-and-reading-it-in-SE-tp3387420p3387420.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: setting poperty in Interceptor and reading it in SE.

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Take a look at the discussion about same issue from [1],
Also here is my blog about how to read the property from cxf se  
endpoint with more cxf-friendly way, "How to get/set properties from/ 
to JBI NMR within cxf se endpoint"

[1]http://servicemix.396122.n5.nabble.com/Can-cxf-bc-and-cxf-se-interceptors-share-context-td417409.html
[2]http://freemanfang.blogspot.com

Freeman
On 2011-2-16, at 下午6:33, kishore.unnam wrote:

>
> Hi all,
>
> my requirement is to add the time(when it is received by cxf BC) to  
> the
> message and to read the same in SE, to do the same i have done like  
> the
> following .
>
> public class LatencyCalcInterceptior extends AbstractSoapInterceptor {
>
> 	private static final Logger LOG = Logger
> 			.getLogger(LatencyCalcInterceptior.class.getName());
>
> 	public LatencyCalcInterceptior() {
> 		super(Phase.RECEIVE);
> 	}
>
> 	public void handleMessage(SoapMessage message) throws Fault {
> 	    message.put("cxfbcstarttime",System.currentTimeMillis());  //  
> type 1
> 	     
> message 
> .getExchange().put("cxfbcstarttime",System.currentTimeMillis());
> //type 2
> 	
> 	}
>
> }
>
> i tried different approaches to read the property in SE but it  
> doesn't seem
> to be coming to SE .please help me .
>
>
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/setting-poperty-in-Interceptor-and-reading-it-in-SE-tp3387420p3387420.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------

FuseSource: http://fusesource.com
blog: http://freemanfang.blogspot.com
twitter: http://twitter.com/freemanfang
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org