Repository: cxf Updated Branches: refs/heads/3.1.x-fixes aa3751e44 -> c11ceb41b
[CXF-7415] RM messages would not have anything asserted at this point, just results in bogus logs # Conflicts: # rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/3aa082f6 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/3aa082f6 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/3aa082f6 Branch: refs/heads/3.1.x-fixes Commit: 3aa082f6ae201dba8e49ab2e60374d30364e18c7 Parents: aa3751e Author: Daniel Kulp <[email protected]> Authored: Tue Jun 20 13:21:43 2017 -0400 Committer: Daniel Kulp <[email protected]> Committed: Tue Jun 20 14:30:00 2017 -0400 ---------------------------------------------------------------------- .../apache/cxf/ws/rm/DestinationSequence.java | 48 +++++++------------- .../org/apache/cxf/ws/rm/RMInInterceptor.java | 7 ++- 2 files changed, 19 insertions(+), 36 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/3aa082f6/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java ---------------------------------------------------------------------- diff --git a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java index a11eb67..51b2970 100644 --- a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java +++ b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java @@ -41,7 +41,6 @@ import org.apache.cxf.io.CachedOutputStream; import org.apache.cxf.message.Message; import org.apache.cxf.message.MessageUtils; import org.apache.cxf.ws.addressing.EndpointReferenceType; -import org.apache.cxf.ws.policy.PolicyVerificationInInterceptor; import org.apache.cxf.ws.rm.RMConfiguration.DeliveryAssurance; import org.apache.cxf.ws.rm.manager.AcksPolicyType; import org.apache.cxf.ws.rm.persistence.PersistenceUtils; @@ -184,39 +183,24 @@ public class DestinationSequence extends AbstractSequence { if (updated) { RMStore store = destination.getManager().getStore(); - if (null != store) { - // only save message, when policy verification is successful - // otherwise msgs will be stored and redelivered which do not pass initial verification - // as interceptor is called in a later phase than the capturing - PolicyVerificationInInterceptor intercep = new PolicyVerificationInInterceptor(); - boolean policiesVerified = false; + if (null != store && !MessageUtils.isTrue(message.getContextualProperty(Message.ROBUST_ONEWAY))) { try { - intercep.handleMessage(message); - policiesVerified = true; - } catch (Fault e) { - // Ignore - } - RMMessage msg = null; - if (policiesVerified - && !MessageUtils.isTrue(message.getContextualProperty(Message.ROBUST_ONEWAY))) { - try { - msg = new RMMessage(); - CachedOutputStream cos = (CachedOutputStream)message - .get(RMMessageConstants.SAVED_CONTENT); - msg.setMessageNumber(st.getMessageNumber()); - msg.setCreatedTime(rmps.getCreatedTime()); - // in case no attachments are available, cos can be saved directly - if (message.getAttachments() == null) { - msg.setContent(cos); - msg.setContentType((String)message.get(Message.CONTENT_TYPE)); - } else { - InputStream is = cos.getInputStream(); - PersistenceUtils.encodeRMContent(msg, message, is); - } - store.persistIncoming(this, msg); - } catch (IOException e) { - throw new Fault(e); + RMMessage msg = new RMMessage(); + CachedOutputStream cos = (CachedOutputStream)message + .get(RMMessageConstants.SAVED_CONTENT); + msg.setMessageNumber(st.getMessageNumber()); + msg.setCreatedTime(rmps.getCreatedTime()); + // in case no attachments are available, cos can be saved directly + if (message.getAttachments() == null) { + msg.setContent(cos); + msg.setContentType((String)message.get(Message.CONTENT_TYPE)); + } else { + InputStream is = cos.getInputStream(); + PersistenceUtils.encodeRMContent(msg, message, is); } + store.persistIncoming(this, msg); + } catch (IOException e) { + throw new Fault(e); } } } http://git-wip-us.apache.org/repos/asf/cxf/blob/3aa082f6/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java ---------------------------------------------------------------------- diff --git a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java index c82412b..a70075a 100644 --- a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java +++ b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java @@ -187,8 +187,9 @@ public class RMInInterceptor extends AbstractRMInterceptor<Message> { RMEndpoint rme = getManager().getReliableEndpoint(message); Destination destination = getManager().getDestination(message); - - if (isApplicationMessage) { + + assertReliability(message); + if (isApplicationMessage) { if (null != rmps) { processAcknowledgments(rme, rmps, protocol); processAcknowledgmentRequests(destination, message); @@ -225,8 +226,6 @@ public class RMInInterceptor extends AbstractRMInterceptor<Message> { return; } } - - assertReliability(message); } void processAcknowledgments(RMEndpoint rme, RMProperties rmps, ProtocolVariation protocol)
