public String getCorrelationId() { return message.getCorrelationId(); }
public String getCorrelationId(MuleMessage message) { String id = message.getCorrelationId(); if (id == null) { id = message.getUniqueId(); } return id; } }
public String getCorrelationId(MuleMessage message) { String id= message.getCorrelationId(); if (id == null) { id = getMessageId(message); } return id; }
private void copyCorrelationIdProperties(HttpResponse response, MuleMessage message) { if(message.getCorrelationId() != null) { response.setHeader(new Header(HttpConstants.CUSTOM_HEADER_PREFIX + MuleProperties.MULE_CORRELATION_ID_PROPERTY, message.getCorrelationId())); response.setHeader(new Header(HttpConstants.CUSTOM_HEADER_PREFIX + MuleProperties.MULE_CORRELATION_GROUP_SIZE_PROPERTY, String.valueOf(message.getCorrelationGroupSize()))); response.setHeader(new Header(HttpConstants.CUSTOM_HEADER_PREFIX + MuleProperties.MULE_CORRELATION_SEQUENCE_PROPERTY, String.valueOf(message.getCorrelationSequence()))); } }
boolean correlationSet = message.getCorrelationId() != null; if (correlationSet && (enableCorrelation == CorrelationMode.IF_NOT_SET)) logger.debug("CorrelationId is already set to '" + message.getCorrelationId() + "' , not setting it again"); logger.debug("CorrelationId is already set to '" + message.getCorrelationId() + "', but router is configured to overwrite it");
return message.getCorrelationId();
@Override public Object transformMessage(MuleMessage message, String outputEncoding) throws TransformerException { ExceptionPayload ep = message.getExceptionPayload(); Throwable e = ep.getException(); Throwable re = ep.getRootException(); String cid = message.getCorrelationId(); log.warn("CorrId: {}, Error: {}, {}", new Object[] {cid, e, re}); String errorText = e.getMessage(); if (re != null) { errorText += ", " + re.getMessage(); } LastUnsuccessfulSynchErrorType error = new LastUnsuccessfulSynchErrorType(); error.setCausingAgent(CausingAgentEnum.VIRTUALIZATION_PLATFORM); error.setCode(Integer.toString(ep.getCode())); error.setText(errorText); String logicalAddress = message.getInvocationProperty("logical-address"); message.setExceptionPayload(null); message.setPayload(new Object[] {logicalAddress, error}); return message; } }
/** * Extracts header properties from a Mule event * * @param event */ public MuleSoapHeaders(MuleEvent event) { setCorrelationId(event.getMessage().getCorrelationId()); setCorrelationGroup(String.valueOf(event.getMessage().getCorrelationGroupSize())); setCorrelationSequence(String.valueOf(event.getMessage().getCorrelationSequence())); // only propogate the reply to header if it's in the outbound scope Object replyTo = event.getMessage().getProperty(MuleProperties.MULE_REPLY_TO_PROPERTY, PropertyScope.OUTBOUND); if (replyTo != null) { setReplyTo(replyTo.toString()); } }
/** * Extracts header properties from a Mule event * * @param event */ public MuleSoapHeaders(MuleEvent event) { setCorrelationId(event.getMessage().getCorrelationId()); setCorrelationGroup(String.valueOf(event.getMessage().getCorrelationGroupSize())); setCorrelationSequence(String.valueOf(event.getMessage().getCorrelationSequence())); setReplyTo((String)event.getMessage().getReplyTo()); }
protected String getAsyncReplyCorrelationId(MuleEvent event) { // TODO add logic to use also seqNo when present so it works with split // messages String correlationId = ""; if (event.getMessage() instanceof MuleMessageCollection) { correlationId = event.getMessage().getCorrelationId(); } else { correlationId = event.getFlowConstruct().getMessageInfoMapping().getCorrelationId(event.getMessage()); } return correlationId; }
boolean correlationSet = message.getCorrelationId() != null; if (correlationSet && (enableCorrelation == CorrelationMode.IF_NOT_SET))
boolean correlationSet = message.getCorrelationId() != null; if (correlationSet && (enableCorrelation == CorrelationMode.IF_NOT_SET))
/** * Logs a fatal error message to the logging system. This should be used mostly * if an error occurs in the exception listener itself. This implementation logs * the the message itself to the logs if it is not null * * @param event The MuleEvent currently being processed * @param t the fatal exception to log */ protected void logFatal(MuleEvent event, Throwable t) { FlowConstructStatistics statistics = event.getFlowConstruct().getStatistics(); if (statistics != null && statistics.isEnabled()) { statistics.incFatalError(); } MuleMessage logMessage = event.getMessage(); String logUniqueId = StringUtils.defaultString(logMessage.getUniqueId(), NOT_SET); String correlationId = StringUtils.defaultString(logMessage.getCorrelationId(), NOT_SET); int correlationGroupSize = logMessage.getCorrelationGroupSize(); int correlationGroupSeq = logMessage.getCorrelationSequence(); String printableLogMessage = MessageFormat.format("Message identification summary here: " + "id={0} correlationId={1}, correlationGroup={2}, correlationSeq={3}", logUniqueId, correlationId, correlationGroupSize, correlationGroupSeq); logger.fatal( "Failed to dispatch message to error queue after it failed to process. This may cause message loss. " + (event.getMessage() == null ? "" : printableLogMessage), t); }
/** * Process intermediary result of invocation. The method will be invoked * <strong>only</strong> if both local and intermediary results are available * (not null). * <p/> * Overriding methods must call <code>super(localResult, intermediaryResult)</code>, * unless they are modifying the correlation workflow (if you know what that means, * you know what you are doing and when to do it). * <p/> * Default implementation propagates * the following properties: * <ul> * <li>correlationId * <li>correlationSequence * <li>correlationGroupSize * <li>replyTo * </ul> * @param localResult result of the last endpoint invocation * @param intermediaryResult the message travelling across the targets */ protected void processIntermediaryResult(MuleMessage localResult, MuleMessage intermediaryResult) { localResult.setCorrelationId(intermediaryResult.getCorrelationId()); localResult.setCorrelationSequence(intermediaryResult.getCorrelationSequence()); localResult.setCorrelationGroupSize(intermediaryResult.getCorrelationGroupSize()); localResult.setReplyTo(intermediaryResult.getReplyTo()); } }
if (msg.getCorrelationId() != null) msg.getCorrelationId())); response.setHeader(new Header(HttpConstants.CUSTOM_HEADER_PREFIX + MuleProperties.MULE_CORRELATION_GROUP_SIZE_PROPERTY,
boolean correlationSet = message.getCorrelationId() != null; if ((!correlationSet && (enableCorrelation == CorrelationMode.IF_NOT_SET)) || (enableCorrelation == CorrelationMode.ALWAYS))
boolean correlationSet = message.getCorrelationId() != null; if (!correlationSet && (enableCorrelation == CorrelationMode.IF_NOT_SET))