|
Page Edited :
CXF20DOC :
WSRMConfiguration
WSRMConfiguration has been edited by Andrea Smyth (Aug 09, 2007). Content:Using WS-Reliable MessagingIn order for a client/server to communicate reliably with its target endpoint/its clients, the CXF WS-Reliable Messaging interceptors need to be in the interceptor chain for inbound and outbound messages and faults. Also, because WS-Reliable Messaging depends on WS-Addressing, the CXF WS-Addressing interceptors need to be on these interceptor chains also. It is important to note at this point that the presence of these interceptors alone will take care of exchanging the RM protocol messages when necessary. For example. upon processing the first application message on the outbound interceptor chain, the RM interceptors will ensure that a CreateSequence request is sent and not proceed with processing the original application message until the CreateSequenceResponse was received. Furthermore, the RM interceptors are responsible for adding the Sequence headers to the application messages and, on the destination side, extracting them from the message. Using the RMAssertion and the CXF WS-Policy FrameworkIf
For example, to enable the WS-Policy Framework on the server side, you configuration file could look like this: <jaxws:endpoint ...> <jaxws:features> <p:policies/> </jaxws:features>
For details about the element types used in this namespace please refer to the schemas for the http://cxf.apache.org/ws/rm/manager Example (feature applied at bus level): <cxf:bus> <cxf:features> <wsa:addressing/> <wsrm-mgr:reliableMessaging> <wsrm-policy:RMAssertion> <wsrm-policy:BaseRetransmissionInterval Milliseconds="4000"/> <wsrm-policy:AcknowledgementInterval Milliseconds="2000"/> </wsrm-policy:RMAssertion> <wsrm-mgr:sourcePolicy> <wsrm-mgr:sequenceTerminationPolicy maxLength="5"/> </wsrm-mgr:sourcePolicy> <wsrm-mgr:destinationPolicy acceptOffers="false"> <wsrm:store> <ref bean="myStore"/> </wsrm:store> </wsrm-mgr:reliableMessaging> </cxf:features> </cxf:bus> Configuring the Reliable Messaging StoreTo enable persistence, you must specify the object implementing the persistent store for RM. You can develop your own, or use the JDBC based store that comes with CXF (class org.apache.cxf.ws.rm.persistence.jdbc.RMTxStore). You can configure the latter using a custom jdbcStore bean (namespace http://cxf.apache.org/ws/rm/manager
Example: <wsrm-mgr:jdbStore id="myStore" driverClassName="org.apache.derby.jdbc.ClientDriver"/> url="" class="code-quote">"jdbc:derby://localhost:1527/rmdb;create=true"/> password="password"/> Adding the Reliable Messaging Interceptors ManuallyTo ensure that the Reliable Messaging interceptors are added to the appropriate interceptor chains, e.g. for all client and server endpoints: <bean id="rmLogicalOut" class="org.apache.cxf.ws.rm.RMOutInterceptor"> <property name="bus" ref="cxf"/> </bean> <bean id="rmLogicalIn" class="org.apache.cxf.ws.rm.RMInInterceptor"> <property name="bus" ref="cxf"/> </bean> <bean id="rmCodec" class="org.apache.cxf.ws.rm.soap.RMSoapInterceptor"/> <cxf:bus ...> <cxf:inInterceptors> <ref bean="rmLogicalIn"/> <ref bean="rmCodec"/> </cxf:inInterceptors> <cxf:inFaultInterceptors> <ref bean="rmLogicalIn"/> <ref bean="rmCodec"/> </cxf:inFaultInterceptors> <cxf:outInterceptors> <ref bean="rmLogicalOut"/> <ref bean="rmCodec"/> </cxf:outInterceptors> <cxf:outFaultInterceptors> <ref bean="rmLogicalOut"/> <ref bean="rmCodec"/> <cxf:outFaultInterceptors> </cxf:bus> The RetransmissionIntercepor will be added on the fly by the RMOutInterceptor so need not appear in your configuration file. Configuring the Reliable Messaging Manager ManuallyTo configure properties of the RM Manager, you can use the rmManager element from the http://cxf.apache.org/ws/rm/manager <wsrm-mgr:rmManager xmlns:wsrm-mgr="http://cxf.apache.org/ws/rm/manager"> |
Unsubscribe or edit your notifications preferences
