|
Page Edited :
CXF20DOC :
WSRMConfiguration
WSRMConfiguration has been edited by Daniel Kulp (Oct 22, 2008). Content:Using WS-Reliable MessagingTo make a message exchange between two endpoints reliable, you need to ensure that the RM interceptors and (as WS-Reliable messaging has a dependency on WS-Addressing) the addressing interceptors are added to the interceptor chains. This can be achieved in one of the following ways: Using the RMAssertion and the CXF WS-Policy FrameworkIf
the RM interceptors will be automatically added to their respective interceptor chains by the policy framework. The assertion attributes control the behavior of the source/destination. 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> </jaxws:endpoint>
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:jdbcStore 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"> <wsrm-mgr:sourcePolicy> <wsrm-mgr:sequenceTerminationPolicy maxLength="5"/> </wsrm-mgr:sourcePolicy> </wsrm-mgr:rmManager> |
Unsubscribe or edit your notifications preferences
