You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by bobsterix <jt...@gmail.com> on 2010/09/15 01:23:52 UTC

CXF Proxy and correlationID missing

Hello,

I have a simple setup:
* one service A - cxfse:endpoint exposed thru cxf-bc
* one service B - just a cxfse:endpoint

The A service calls B using the cxfse:proxy.

Am I wrong to assume that correlationID should be passed in the A<->B
exchange?
(I am finding out that it is set to null)

Thanks in advance:)
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/CXF-Proxy-and-correlationID-missing-tp2839921p2839921.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: CXF Proxy and correlationID missing

Posted by bobsterix <jt...@gmail.com>.
Hello again,

If attached a simple example illustrating the behavior I'm talking about.
Couple of services and a Interceptor
(org.apache.servicemix.nmr.api.event.ExchangeListener) to monitor
the flow and print out message id's and correlationID. I've tested and it
deploys on 4.3.0-fuse-00-00.

It can be triggered by contacting the http://localhost:9090/a3/?wsdl
service.

Here are parts of beans.xml that I think might be relevant:


        <bean id="a3" class="com.example.A3">
		<property name="bs">
			 <cxfse:proxy service="example:B" endpoint="1" type="com.example.B" />
		</property>
	</bean>

	<cxfse:endpoint service="example:A" endpoint="3">
		<cxfse:pojo>
			<ref bean="a3" />
		</cxfse:pojo>
	</cxfse:endpoint>
     
	<cxfse:endpoint service="example:B" endpoint="1">
		<cxfse:pojo>
			<ref bean="b1" />
		</cxfse:pojo>
	</cxfse:endpoint>

	<cxfbc:consumer wsdl="classpath:AService.wsdl" endpoint="APort3"
		targetService="example:A" targetEndpoint="3">
	</cxfbc:consumer>



	


I hopes this helps to demonstrate the issue I am having.

Regards


http://servicemix.396122.n5.nabble.com/file/n2842960/proxy-example.tgz
proxy-example.tgz 
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/CXF-Proxy-and-correlationID-missing-tp2839921p2842960.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: CXF Proxy and correlationID missing

Posted by bobsterix <jt...@gmail.com>.
Well the MessageExchange.getExchangeId() is there, but its different for each
message exchange. Like if I had a couple of services calling each other
BC<->A<->B<->C during one "request" from the client, the id for each of
those exchanges would be different right? I was using the correlationID to
"associate" them together, a simple use case for this would be to store/log
all messages exchanged for a particular "request" from the client. I hope
that I am being clear, or is this the wrong use of correlationID?

I will try to provide example code for the cxfse:proxy lacking correlationID
later on today.

Regards
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/CXF-Proxy-and-correlationID-missing-tp2839921p2841703.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: CXF Proxy and correlationID missing

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

It should be there.

Could you show me the code how you get NMR MessageExchange in proxy  
target cxf se endpoint?
Or could you try with using MessageExchange.getExchangeId(), it should  
be same value with property "org.apache.servicemix.correlationId"

Freeman
On 2010-9-15, at 下午4:07, bobsterix wrote:

>
> Hello,
>
> It's in the NMR, I've been able to retrieve it (for some exchanges)  
> from the
> org.apache.servicemix.nmr.api.Exchange as follows:
>
> (this code is inside a custom
> org.apache.servicemix.nmr.api.event.ExchangeListener)
>
> String correlationId = (String) exchange.getProperties().get(
> 				"org.apache.servicemix.correlationId");
>
> Regards
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/CXF-Proxy-and-correlationID-missing-tp2839921p2840248.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang

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


Re: CXF Proxy and correlationID missing

Posted by bobsterix <jt...@gmail.com>.
Hello,

It's in the NMR, I've been able to retrieve it (for some exchanges) from the
org.apache.servicemix.nmr.api.Exchange as follows:

(this code is inside a custom
org.apache.servicemix.nmr.api.event.ExchangeListener)

String correlationId = (String) exchange.getProperties().get(
				"org.apache.servicemix.correlationId");

Regards
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/CXF-Proxy-and-correlationID-missing-tp2839921p2840248.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: CXF Proxy and correlationID missing

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

What correlationID you mean here?
Is it NMR MessageExchange ID?

Freeman
On 2010-9-15, at 上午7:23, bobsterix wrote:

>
> Hello,
>
> I have a simple setup:
> * one service A - cxfse:endpoint exposed thru cxf-bc
> * one service B - just a cxfse:endpoint
>
> The A service calls B using the cxfse:proxy.
>
> Am I wrong to assume that correlationID should be passed in the A<->B
> exchange?
> (I am finding out that it is set to null)
>
> Thanks in advance:)
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/CXF-Proxy-and-correlationID-missing-tp2839921p2839921.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang

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