You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Ben Pezzei <be...@gmail.com> on 2012/03/16 13:22:31 UTC

Synchronous RM: lastMessage & offer

Hi

We are using CXF 2.4.4. for RM of one special operation. Due to
technical issues (firewalling, loadbalancer, etc) we
decided to use the synchronous approach.

Unfortunately, we have several problems with sync. RM:

Client must(!)  send an offer, if we do not send one, the server
generates a Fault in the second response:
 It is not possible to send a create sequence request to the anonymous address

This offered id is ignored by the Destination, instead the response
for createSourceSequence includes
a new/other id (Although this looks ok, the source still keeps the
offered Sequence... since in some
cases the source wants a final SeqAck for this Sequence, startind with
req/res Id 4).

The other Problem is marking the lastMessage, When we use:
SequenceTerminationPolicyType stp = new SequenceTerminationPolicyType();
stp.setTerminateOnShutdown(true);
stp.setMaxLength(1);

The server/destination tries to send the TerminateSequence (ID:5) to
www.w3.org, which
results in a java.net.UnknownHostException:

The req/res pair is as follows

ID: 1 Req: createSequence with Offer 123
ID: 1 Res: CreateSequenceResponse with generated SeqID 456
ID: 2 Req: Sequence with 456 and content
ID: 2 Res: SequenceAcknowledgement for 456and content
ID: 3 Req: TerminateSequence for 456
ID: 3 Res: looks like an ACK (occurance of <RelatesTo
xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://www.w3.org/2005/08/addressing/unspecified</RelatesTo>)
ID: 4 Req: SequenceAcknowledgement for 456
ID: 5 Req: Server tries to send a TerminateSequence to
http://www.w3.org/2005/08/addressing/anonymous

If we skip the mastMessage (setMaxLength=0) there is no error in
communication but there is also
no terminateSequence.

Hence the question if it is possible to use RM with cxf 2.4.4. in sync
mode (and without offer and with markation of lastMessage)?

Our config is straigh forward (server):
            <wsrm-mgr:reliableMessaging>
                <wsrm-policy:RMAssertion>
                    <wsrm-policy:BaseRetransmissionInterval
Milliseconds="40000"/>
                    <wsrm-policy:AcknowledgementInterval Milliseconds="0"/>
                </wsrm-policy:RMAssertion>
                <wsrm-mgr:sourcePolicy>
                <!--
                    <wsrm-mgr:sequenceTerminationPolicy maxLength="1"/>
                     -->
                </wsrm-mgr:sourcePolicy>
                <wsrm-mgr:destinationPolicy >
                    <wsrm-mgr:acksPolicy intraMessageThreshold="10" />
                </wsrm-mgr:destinationPolicy>
            </wsrm-mgr:reliableMessaging>

We generate the client RM Bus programmatically (initially by spring)
with those features:
		<property name="features">
			<list>
				<bean class="org.apache.cxf.ws.addressing.WSAddressingFeature"/>
				<bean class="org.apache.cxf.feature.LoggingFeature"/>
				<bean class="org.apache.cxf.ws.rm.feature.RMFeature">
			</list>
		</property>

public class RMBusFactory extends SpringBusFactory {
...
ExtensionManagerBus originBus = (ExtensionManagerBus) super.createBus();
....
for (AbstractFeature feature : features) {
	feature.initialize(originBus);
}
originBus.setFeatures(features);

any ideas?

tnx & greetings
Ben

Fwd: Synchronous RM: lastMessage & offer

Posted by Ben Pezzei <be...@gmail.com>.
Hi Aki,

tnx for your reply,

2012/3/16 Aki Yoshida <el...@googlemail.com>:
> I suppose you meant by "synchronous approach" a WS-RM scenario where
> each ack message must be returned to the caller in its http response
> synchronously. And do you have a request-response service, as you are
> talking about the offer option?

Yeah, but actually I meant, that the client does not make any use of a
decoupled endpoint. Basically the setup is like described in:
https://issues.apache.org/jira/browse/CXF-3777

> Regarding the issue about CXF trying to send a message to www.w3.org,
> there was a similar issue CXF-3777 which was fixed in 2.4.3. I'll
> check how your case relates to this.

I guess that in our situation we have to use an offerId (else the communication
breaks earlier).

The other thing which probably escapes my understanding is an example like:
http://rajikak.blogspot.com/2011/05/short-tutorial-on-ws-rm.html

Why does the client send an SequenceAcknowledge for an Id (code
5,offered id) which
was initially discarded by the server(Destination)?

Which again leads me to another Question: The code in
org.apache.cxf.ws.rm.Servant
(line 156 in cxf 2.4.4) appears to be not working (on first sight).

tnx & regards
Ben

Re: Synchronous RM: lastMessage & offer

Posted by Daniel Kulp <dk...@apache.org>.
On Thursday, March 22, 2012 03:12:52 PM Ben Pezzei wrote:
> Hi
> 
> https://issues.apache.org/jira/browse/CXF-4191
> 
> Any chances to get that fixed in 2.4.7?
> 
> We had some lib-cleanUps Troubles yesterday, so I don't know about the
> reliable results regarding 2.5.3-SNAPSHOT. Since it is based on Spring 3 (
> and won't work with spring 2.5) we can not upgrade to a potential fix in
> CXF 2.5.3

If you don't mind my asking....  what doesn't work with Spring 2.5?   We 
haven't been testing with spring 2.5 for a while, but we've also been trying 
to avoid the new things and trying to find ways to keep 2.5 working.   I'd 
like to know what is failing.   Might be fixable.

Dan



> - perhaps some time later ;-)
> 
> tnx & regards
> Ben
> 
> 2012/3/21 Aki Yoshida <el...@googlemail.com>:
> > Hi Ben,
> > Sorry, I didn't look at the last response message from the server. I
> > also see the server not sending back the terminate sequence to the
> > client to close its sequence. Strangely, I was not seeing any
> > exception and assumed it was all okay. But there is something that
> > goes wrong during the ack handling at the server and I suppose this
> > has something to do with the anonymous endpoint handling. This bug
> > keeps the destination sequences at the client open and that is bad.
> > So, it needs to be fixed.
> > 
> > Could you create a JIRA ticket?
> > 
> > Thanks. aki
> > 
> > 2012/3/21 Ben Pezzei <be...@gmail.com>:
> >> Hi Again.
> >> 
> >> Well, after two days of testing various versions (including
> >> 2.5.3-SNAPSHOT) the results stay the same.
> >> 
> >> The client sends a final SequenceAck (for the offerSeq) to the server
> >> after the initial conversation
> >> has ended. The Server in turn sends a terminateSequence to w3c.org
> >> 
> >> It would be very helpfull to have an example of a working config for
> >> WS 1.0 oneway/sync
> >> communication. On the other hand we tried to activate WS RM 1.1 but
> >> unfortunately there
> >> is not much documentation around on how to activate this feature (I
> >> guess changing the namespaces
> >> in the spring config)?
> >> 
> >> Any help/ideas is greatly appreciated
> >> 
> >> tnx & greetings
> >> Ben
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: Synchronous RM: lastMessage & offer

Posted by Aki Yoshida <el...@googlemail.com>.
Hi Ben,
I have a feeling that the fix itself might not be so simple, as the
way how the termination message is sent needs to be changed in this
case. But I hope we can fix it before the next 2.4.x and 2.5.x
releases. I need to look into this in more details.

regards, aki

2012/3/22 Ben Pezzei <be...@gmail.com>:
> Hi
>
> https://issues.apache.org/jira/browse/CXF-4191
>
> Any chances to get that fixed in 2.4.7?
>
> We had some lib-cleanUps Troubles yesterday, so I don't know about the
> reliable results regarding 2.5.3-SNAPSHOT. Since it is based on Spring 3 (
> and won't work with spring 2.5) we can not upgrade to a potential fix
> in CXF 2.5.3
> - perhaps some time later ;-)
>
> tnx & regards
> Ben
>
> 2012/3/21 Aki Yoshida <el...@googlemail.com>:
>> Hi Ben,
>> Sorry, I didn't look at the last response message from the server. I
>> also see the server not sending back the terminate sequence to the
>> client to close its sequence. Strangely, I was not seeing any
>> exception and assumed it was all okay. But there is something that
>> goes wrong during the ack handling at the server and I suppose this
>> has something to do with the anonymous endpoint handling. This bug
>> keeps the destination sequences at the client open and that is bad.
>> So, it needs to be fixed.
>>
>> Could you create a JIRA ticket?
>>
>> Thanks. aki
>>
>> 2012/3/21 Ben Pezzei <be...@gmail.com>:
>>> Hi Again.
>>>
>>> Well, after two days of testing various versions (including 2.5.3-SNAPSHOT)
>>> the results stay the same.
>>>
>>> The client sends a final SequenceAck (for the offerSeq) to the server
>>> after the initial conversation
>>> has ended. The Server in turn sends a terminateSequence to w3c.org
>>>
>>> It would be very helpfull to have an example of a working config for
>>> WS 1.0 oneway/sync
>>> communication. On the other hand we tried to activate WS RM 1.1 but
>>> unfortunately there
>>> is not much documentation around on how to activate this feature (I
>>> guess changing the namespaces
>>> in the spring config)?
>>>
>>> Any help/ideas is greatly appreciated
>>>
>>> tnx & greetings
>>> Ben

Re: Synchronous RM: lastMessage & offer

Posted by Ben Pezzei <be...@gmail.com>.
Hi

https://issues.apache.org/jira/browse/CXF-4191

Any chances to get that fixed in 2.4.7?

We had some lib-cleanUps Troubles yesterday, so I don't know about the
reliable results regarding 2.5.3-SNAPSHOT. Since it is based on Spring 3 (
and won't work with spring 2.5) we can not upgrade to a potential fix
in CXF 2.5.3
- perhaps some time later ;-)

tnx & regards
Ben

2012/3/21 Aki Yoshida <el...@googlemail.com>:
> Hi Ben,
> Sorry, I didn't look at the last response message from the server. I
> also see the server not sending back the terminate sequence to the
> client to close its sequence. Strangely, I was not seeing any
> exception and assumed it was all okay. But there is something that
> goes wrong during the ack handling at the server and I suppose this
> has something to do with the anonymous endpoint handling. This bug
> keeps the destination sequences at the client open and that is bad.
> So, it needs to be fixed.
>
> Could you create a JIRA ticket?
>
> Thanks. aki
>
> 2012/3/21 Ben Pezzei <be...@gmail.com>:
>> Hi Again.
>>
>> Well, after two days of testing various versions (including 2.5.3-SNAPSHOT)
>> the results stay the same.
>>
>> The client sends a final SequenceAck (for the offerSeq) to the server
>> after the initial conversation
>> has ended. The Server in turn sends a terminateSequence to w3c.org
>>
>> It would be very helpfull to have an example of a working config for
>> WS 1.0 oneway/sync
>> communication. On the other hand we tried to activate WS RM 1.1 but
>> unfortunately there
>> is not much documentation around on how to activate this feature (I
>> guess changing the namespaces
>> in the spring config)?
>>
>> Any help/ideas is greatly appreciated
>>
>> tnx & greetings
>> Ben

Re: Synchronous RM: lastMessage & offer

Posted by Aki Yoshida <el...@googlemail.com>.
Hi Ben,
Sorry, I didn't look at the last response message from the server. I
also see the server not sending back the terminate sequence to the
client to close its sequence. Strangely, I was not seeing any
exception and assumed it was all okay. But there is something that
goes wrong during the ack handling at the server and I suppose this
has something to do with the anonymous endpoint handling. This bug
keeps the destination sequences at the client open and that is bad.
So, it needs to be fixed.

Could you create a JIRA ticket?

Thanks. aki

2012/3/21 Ben Pezzei <be...@gmail.com>:
> Hi Again.
>
> Well, after two days of testing various versions (including 2.5.3-SNAPSHOT)
> the results stay the same.
>
> The client sends a final SequenceAck (for the offerSeq) to the server
> after the initial conversation
> has ended. The Server in turn sends a terminateSequence to w3c.org
>
> It would be very helpfull to have an example of a working config for
> WS 1.0 oneway/sync
> communication. On the other hand we tried to activate WS RM 1.1 but
> unfortunately there
> is not much documentation around on how to activate this feature (I
> guess changing the namespaces
> in the spring config)?
>
> Any help/ideas is greatly appreciated
>
> tnx & greetings
> Ben

Re: Synchronous RM: lastMessage & offer

Posted by Aki Yoshida <el...@googlemail.com>.
Hi Ben,
I integrated this fix into trunk (2.6.1-SNAPSHOT) and 2.5.x
(2.5.4-SNAPSHOT) some days ago.

Regarding the spring 2.x/3.x incompatibility of the add method that
you mentioned, Dan has already fixed it for 2.5.3.
So, I think you could go to CXF 2.5.x.

Regards, aki

2012/3/22 Ben Pezzei <be...@gmail.com>:
> Hi
>
> @Dan: The 2.5.3 setup was already deleted... so if I remember correctly:
> The SpringBus-class was invoking an add-Method on a spring-class
> during initialization.
> something like beanDefinitionParser.add (the suitable method in 2.5
> may be addProperty).
>
> @Dennis: We found an example in the systest-package: By adding 2 Constants in
> the RequestContext of the client, communication used ws-rm 1.1
> Features/Namespaces.
> The request/response pairs looked ok, afair (But we didnt run the
> whole test-suite due to
> the spring 3 support).
>
> tnx & greetings
> Ben
>
> 2012/3/23 Dennis Sosnoski <dm...@sosnoski.com>:
>> On 03/22/2012 03:37 AM, Ben Pezzei wrote:
>>>
>>> ...
>>>
>>>
>>> It would be very helpfull to have an example of a working config for
>>> WS 1.0 oneway/sync
>>> communication. On the other hand we tried to activate WS RM 1.1 but
>>> unfortunately there
>>> is not much documentation around on how to activate this feature (I
>>> guess changing the namespaces
>>> in the spring config)?
>>
>>
>> Currently you can activate it in the Spring config on the client (the
>> provider automatically adapts to whichever version the client uses). I'm
>> adding the code now to support WS-RM policy configuration instead. I don't
>> think changing to WS RM 1.1 will help with your issues, though.
>>
>>  - Dennis
>>

Re: Synchronous RM: lastMessage & offer

Posted by Ben Pezzei <be...@gmail.com>.
Hi

@Dan: The 2.5.3 setup was already deleted... so if I remember correctly:
The SpringBus-class was invoking an add-Method on a spring-class
during initialization.
something like beanDefinitionParser.add (the suitable method in 2.5
may be addProperty).

@Dennis: We found an example in the systest-package: By adding 2 Constants in
the RequestContext of the client, communication used ws-rm 1.1
Features/Namespaces.
The request/response pairs looked ok, afair (But we didnt run the
whole test-suite due to
the spring 3 support).

tnx & greetings
Ben

2012/3/23 Dennis Sosnoski <dm...@sosnoski.com>:
> On 03/22/2012 03:37 AM, Ben Pezzei wrote:
>>
>> ...
>>
>>
>> It would be very helpfull to have an example of a working config for
>> WS 1.0 oneway/sync
>> communication. On the other hand we tried to activate WS RM 1.1 but
>> unfortunately there
>> is not much documentation around on how to activate this feature (I
>> guess changing the namespaces
>> in the spring config)?
>
>
> Currently you can activate it in the Spring config on the client (the
> provider automatically adapts to whichever version the client uses). I'm
> adding the code now to support WS-RM policy configuration instead. I don't
> think changing to WS RM 1.1 will help with your issues, though.
>
>  - Dennis
>

Re: Synchronous RM: lastMessage & offer

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
On 03/22/2012 03:37 AM, Ben Pezzei wrote:
> ...
>
> It would be very helpfull to have an example of a working config for
> WS 1.0 oneway/sync
> communication. On the other hand we tried to activate WS RM 1.1 but
> unfortunately there
> is not much documentation around on how to activate this feature (I
> guess changing the namespaces
> in the spring config)?

Currently you can activate it in the Spring config on the client (the 
provider automatically adapts to whichever version the client uses). I'm 
adding the code now to support WS-RM policy configuration instead. I 
don't think changing to WS RM 1.1 will help with your issues, though.

   - Dennis


Re: Synchronous RM: lastMessage & offer

Posted by Ben Pezzei <be...@gmail.com>.
Hi Again.

Well, after two days of testing various versions (including 2.5.3-SNAPSHOT)
the results stay the same.

The client sends a final SequenceAck (for the offerSeq) to the server
after the initial conversation
has ended. The Server in turn sends a terminateSequence to w3c.org

It would be very helpfull to have an example of a working config for
WS 1.0 oneway/sync
communication. On the other hand we tried to activate WS RM 1.1 but
unfortunately there
is not much documentation around on how to activate this feature (I
guess changing the namespaces
in the spring config)?

Any help/ideas is greatly appreciated

tnx & greetings
Ben

Re: Synchronous RM: lastMessage & offer

Posted by Aki Yoshida <el...@googlemail.com>.
Hi Ben,
it's strange that the offered sequence is not used by the server.
(I assume you are not explicitly setting the destination policy to
reject the offers.)

I just tried out a similar test case using 2.6.0-snapshot and saw the
offered sequence used by the server.

Maybe, can you run your test with 2.5.3-snapshot or 2.6.0-snapshot to
see if the problem exists there as well? I am short of time today and
I can look into it again next week.

regards, aki

2012/3/16 Ben Pezzei <be...@gmail.com>:
> Hi Aki,
>
> tnx for your reply,
>
> 2012/3/16 Aki Yoshida <el...@googlemail.com>:
>> I suppose you meant by "synchronous approach" a WS-RM scenario where
>> each ack message must be returned to the caller in its http response
>> synchronously. And do you have a request-response service, as you are
>> talking about the offer option?
>
> Yeah, but actually I meant, that the client does not make any use of a
> decoupled endpoint. Basically the setup is like described in:
> https://issues.apache.org/jira/browse/CXF-3777
>
>> Regarding the issue about CXF trying to send a message to www.w3.org,
>> there was a similar issue CXF-3777 which was fixed in 2.4.3. I'll
>> check how your case relates to this.
>
> I guess that in our situation we have to use an offerId (else the communication
> breaks earlier).
>
> The other thing which probably escapes my understanding is an example like:
> http://rajikak.blogspot.com/2011/05/short-tutorial-on-ws-rm.html
>
> Why does the client send an SequenceAcknowledge for an Id (code
> 5,offered id) which
> was initially discarded by the server(Destination)?
>
> Which again leads me to another Question: The code in
> org.apache.cxf.ws.rm.Servant
> (line 156 in cxf 2.4.4) appears to be not working (on first sight).
>
> tnx & regards
> Ben

Re: Synchronous RM: lastMessage & offer

Posted by Aki Yoshida <el...@googlemail.com>.
Hi Ben,
I have a few questions to your scenario.

I suppose you meant by "synchronous approach" a WS-RM scenario where
each ack message must be returned to the caller in its http response
synchronously. And do you have a request-response service, as you are
talking about the offer option?

Regarding the issue about CXF trying to send a message to www.w3.org,
there was a similar issue CXF-3777 which was fixed in 2.4.3. I'll
check how your case relates to this.

regards, aki


2012/3/16 Ben Pezzei <be...@gmail.com>:
> Hi
>
> We are using CXF 2.4.4. for RM of one special operation. Due to
> technical issues (firewalling, loadbalancer, etc) we
> decided to use the synchronous approach.
>
> Unfortunately, we have several problems with sync. RM:
>
> Client must(!)  send an offer, if we do not send one, the server
> generates a Fault in the second response:
>  It is not possible to send a create sequence request to the anonymous address
>
> This offered id is ignored by the Destination, instead the response
> for createSourceSequence includes
> a new/other id (Although this looks ok, the source still keeps the
> offered Sequence... since in some
> cases the source wants a final SeqAck for this Sequence, startind with
> req/res Id 4).
>
> The other Problem is marking the lastMessage, When we use:
> SequenceTerminationPolicyType stp = new SequenceTerminationPolicyType();
> stp.setTerminateOnShutdown(true);
> stp.setMaxLength(1);
>
> The server/destination tries to send the TerminateSequence (ID:5) to
> www.w3.org, which
> results in a java.net.UnknownHostException:
>
> The req/res pair is as follows
>
> ID: 1 Req: createSequence with Offer 123
> ID: 1 Res: CreateSequenceResponse with generated SeqID 456
> ID: 2 Req: Sequence with 456 and content
> ID: 2 Res: SequenceAcknowledgement for 456and content
> ID: 3 Req: TerminateSequence for 456
> ID: 3 Res: looks like an ACK (occurance of <RelatesTo
> xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://www.w3.org/2005/08/addressing/unspecified</RelatesTo>)
> ID: 4 Req: SequenceAcknowledgement for 456
> ID: 5 Req: Server tries to send a TerminateSequence to
> http://www.w3.org/2005/08/addressing/anonymous
>
> If we skip the mastMessage (setMaxLength=0) there is no error in
> communication but there is also
> no terminateSequence.
>
> Hence the question if it is possible to use RM with cxf 2.4.4. in sync
> mode (and without offer and with markation of lastMessage)?
>
> Our config is straigh forward (server):
>            <wsrm-mgr:reliableMessaging>
>                <wsrm-policy:RMAssertion>
>                    <wsrm-policy:BaseRetransmissionInterval
> Milliseconds="40000"/>
>                    <wsrm-policy:AcknowledgementInterval Milliseconds="0"/>
>                </wsrm-policy:RMAssertion>
>                <wsrm-mgr:sourcePolicy>
>                <!--
>                    <wsrm-mgr:sequenceTerminationPolicy maxLength="1"/>
>                     -->
>                </wsrm-mgr:sourcePolicy>
>                <wsrm-mgr:destinationPolicy >
>                    <wsrm-mgr:acksPolicy intraMessageThreshold="10" />
>                </wsrm-mgr:destinationPolicy>
>            </wsrm-mgr:reliableMessaging>
>
> We generate the client RM Bus programmatically (initially by spring)
> with those features:
>                <property name="features">
>                        <list>
>                                <bean class="org.apache.cxf.ws.addressing.WSAddressingFeature"/>
>                                <bean class="org.apache.cxf.feature.LoggingFeature"/>
>                                <bean class="org.apache.cxf.ws.rm.feature.RMFeature">
>                        </list>
>                </property>
>
> public class RMBusFactory extends SpringBusFactory {
> ...
> ExtensionManagerBus originBus = (ExtensionManagerBus) super.createBus();
> ....
> for (AbstractFeature feature : features) {
>        feature.initialize(originBus);
> }
> originBus.setFeatures(features);
>
> any ideas?
>
> tnx & greetings
> Ben