-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange sequence of messages with WS-ReliableMessaging when some are dropped #627
Comments
Hi @ppalaga , The difference comes from that in your testcase the ws-rm client doesn't open a decoupled the endpoint(embeded http server) to receive the out-of-band RM protocol message, such as 202 partial response, SequenceAcknowledgement, etc. In your log you can find
Which means the server is waiting for client to resend request and for the next response the server will return in-band SequenceAcknowledgement along with the sayHelloResponse to the client like
So you can see in this response it also carries the in-band SequenceAcknowledgement this time. To be exact the same behaviour as the test in CSB, you should do change like
Freeman |
That's very helpful, thanks a lot, @ffang! So adding a decoupled endpoint should solve the issue. No problem, let's add it. |
Hi @ppalaga , This is a good question.
Yes, the decoupled endpoint(actually a cxf server created on the fly before create ws-rm sequence) control the ws-rm work flow, such as create sequence, Acknowledge sequence, trigger retransmission if necessary.
No, the related logic isn't in the cxf http transport, it's from cxf ws-rm/ws-addressing module.
As the decoupled endpoint controls ws-rm workflow, so it can't be dummy http endpoint. But to use the platform servlet container is doable. Please see my commit here apache/camel-spring-boot@808a046 It use relative address for decoupledEndpoint
which means cxf http-servlet transport will kick in and use the platform/container provided servlet container(in SpringBoot it's spring-boot-starter-web) And we also need a property to let CXF know the absolute http address(platform|container servlet port and context + relative address for decoupledEndpoint) which can be used during ws-rm conversation
This works in SpringBoot, but I believe this could be very similar in Quarkus with vert.x HTTP stack as servlet implementation. Freeman |
Perfect, thanks for the explanation, @ffang! |
…ssing/ws-rm client) with VertxDestination
…rtFactory while also implmenting WSDLEndpointFactory
client) with VertxDestination fix quarkiverse#627 Original author: @ffang quarkiverse#835
@ffang I squashed and cherry-picked your commits from #835 into #626 ( 3b26150 ). Some warnings are gone and my original test is passing. There are still some things unclear to me. Could you please help?
Does it point at something we need to fix? And the same for
and also for
I wonder if there is a way to programmaticaly ensure that the re-delivery is happening? If there is no API we could spy on, then we could make the assertions against the log file (I did it something like that elsewhere).
|
Hi @ppalaga , Sorry for the late reply, was on PTO and need more time to catch up. I just sent a PR(ppalaga#1) against your 221202-ws-rm branch to refactor ws-rm test which aligns with the same idea from CXF to simulate message loss. And for your questions
This is OK.
These two warn messages are from the testcase itself, more relavant to the extended RMStoreFeature, I don't see why we should use it in our test. We can just use the same way how CXF itself tests the message loss, please get details from the revised WsReliableMessagingTest.
Yes, in the revised WsReliableMessagingTest we add extra in and out interceptors on the ws-rm client side to verify message loss and resend.
No idea either here, we can just use the way in revised WsReliableMessagingTest to verify the communicating messages.
Yes, decoupled endpoint is created and it's working now. The decoupled endpoint is created on the ws-rm client side and plays the role as a destination to receive ws-rm messages returned from the ws-rm server. the ws-rm exchange is created firstly on the ws-rm client side, you can see in the log the first message sent by the ws-rm client is the wsrm:CreateSequence message. Something like this
And in the revised WsReliableMessagingTest, please see the comment, for the ws-rm client, the expected outbound message is like
and the expected inbound message is like
WS-RM is surely tricky and complicated, I'm happy we can make it works in the quarkus. Please let me know if you have further questions. Best Regards |
…nt) with VertxDestination fix quarkiverse#627
Hi @ffang, thanks for the improvements and sorry for the delay! I can confirm the test works well with your changes. I had to adapt it a bit (in 9da33a4) due to changes that happened in between. Then I simplified your code a bit in 11ca287 which still worked. Finally, I wanted to move the client from the test to the application under test in so that we can be sure that it also works in native mode. But when I moved it, it stopped working. The sequence of in messages is different:
I am not able to figure out why. I believe I moved the whole setup correctly:
@ffang could you please have a look, what makes the flow different? |
I have added two more things in to better mimic the original test setup: add WSAddressingFeature to the client, have separate RMFeature instances for client and service. I believe both are needed, but they are still not enough to let the tests pass. The inRecorder still gets two more responses. |
To make the original test with all bus setup and client fail in the same way, it is enough to let the test use the same Bus as the application: ppalaga@1604701 I am far from understanding why this causes the inRecorder to capture more messages. It is set directly on the client https://github.com/ppalaga/quarkus-cxf/blob/i627-default-bus/integration-tests/ws-rm/src/test/java/io/quarkiverse/cxf/it/ws/rm/server/WsReliableMessagingTest.java#L72-L73 and should have nothing to do with the bus. @ffang could you please help me to understand what is going on here? Does perhaps the adressing feature behave differently when the client and service are in the same bus? |
Hi @ppalaga , Thanks for the update and detailed info! Another very good question! The difference you observed comes from the shared bus between client and server for sure, which won't happen in the real scenario! And in CXF tests it's common that we are very careful about the shared bus between the client and server, normally we need to use different buses or even fork process(in JVM or another JVM) for the server for the test purpose for complex scenarios. There is an extension concept in CXF bus, and the extension is distinguished by class type
So it can't be multiple instances of a certain type. So if the client and server share the same bus, which means the extensions set on client and server separately can conflict with each other and this can mess up the behaviour. Back to this testcase, IIRC, we actually use different RMFeature for the client(new RMFeature instance in the test code directly) and server(from CDI produce) side, and the fine-tuned AcknowledgementInterval and BaseRetransmissionInterval are different on server and client side, and they determine the complex message flows between client and server. That's why we need different buses for client and server. Best Regards |
…nt) with VertxDestination fix quarkiverse#627
Thanks a lot @ffang, another super-helpful answer!
Yeah, this explains a lot. Looking into RMFeature, I see that a lot of stuff is set on the RMManager obtained from the bus. Even if we have two separate features for the client and server, they clearly clash, because all happens on the same bus. I wonder how much limiting it is that Quarkus CXF currently supports just a single bus? Based on your advice, I was able to refactor the test into two separate apps (server and client) that communicate with each other. It works both in JVM and native mode! - see #1139 I have filed some followups: |
The modification of the older WS-RM test in #626 produces the attached log.
In
WsReliableMessagingTest
, we call proxy.sayHello() twice and output some log messages in between:proxy.sayHello("Joe")
goes as expected, the response is received and the assertions are satisfiedReceived Joe, about to send Tom
is loggedTom
MessageLossSimulator makes an even message 2 to get lost
is logged as expectedJoe
request is sent once again and its response is received.I find this unexpected. Only the second request with
Tom
should be resent.Could please somebody check the attached log output and/or my changes in the test and figure out what's wrong with the test? There is a bunch of warnings there that I do not understand.
wsrm.log
The text was updated successfully, but these errors were encountered: