Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.4.3
  • Fix Version/s: 2.2.1
  • Component/s: Core: API
  • Labels:
    None
  • Environment:

    1.4.3, Java 1.5

  • User impact:
    Low
  • Similar Issues:
    None

Description

The current implementation of AbstractResponseRouter does not let the user configure how to correlate the request and the response. The default implementation uses messageid to correlationid pattern.

// AbstractResponseRouter.java

protected Object getCallResponseAggregateIdentifier(UMOMessage message)

{ return correlationExtractor.getProperty(MuleProperties.MULE_MESSAGE_ID_PROPERTY, message); }

protected Object getReplyAggregateIdentifier(UMOMessage message)

{ return correlationExtractor.getProperty(MuleProperties.MULE_CORRELATION_ID_PROPERTY, message); }

Can it be modified to support other patterns as well.

For e.g.
<response-router timeout="60000">
<global-endpoint name="endpointname"/>
<router className="com.test.routing.response.CustomCorrelationResponseRouter">
<properties>
<property name="replyAggregateID" value="MULE_CORRELATION_ID"/>
<property name="responseAggregateID" value="MULE_CORRELATION_ID"/>
</properties>
</router>
</response-router>

protected Object getReplyAggregateIdentifier(UMOMessage message)
{
if(this.replyAggregateID == null)

{ return super.getReplyAggregateIdentifier(message); }

return correlationExtractor.getProperty(this.replyAggregateID, message);
}

protected Object getCallResponseAggregateIdentifier(UMOMessage message)
{
if(this.responseAggregateID == null)

{ return super.getCallResponseAggregateIdentifier(message); }

return correlationExtractor.getProperty(this.responseAggregateID, message);
}

Regards

Ragu

Activity

Hide
Dirk Olmes added a comment -

... and the question is?

Show
Dirk Olmes added a comment - ... and the question is?
Hide
Ragu Srinivasan added a comment -

Dirk,
My bad. The question was buried deep in the description. Anyways, the question is

Can AbstractResponseRouter be modified to support other values for AggregateIDs?

More precisely, instead of always defaulting getCallResponseAggregateIdentifier and getReplyAggregateIdentifier to return MULE_MESSAGE_ID_PROPERTY, MULE_CORRELATION_ID_PROPERTY respectively,

can the functions be modfied to support other properties. for eg. returning MULE_CORRELATION_ID_PROPERTY as Reply and Response Aggregate ID.

Ragu

Show
Ragu Srinivasan added a comment - Dirk, My bad. The question was buried deep in the description. Anyways, the question is Can AbstractResponseRouter be modified to support other values for AggregateIDs? More precisely, instead of always defaulting getCallResponseAggregateIdentifier and getReplyAggregateIdentifier to return MULE_MESSAGE_ID_PROPERTY, MULE_CORRELATION_ID_PROPERTY respectively, can the functions be modfied to support other properties. for eg. returning MULE_CORRELATION_ID_PROPERTY as Reply and Response Aggregate ID. Ragu
Hide
Andrew Perepelytsya added a comment -

This is now possible through expression-message-info-mapping:

<single-async-reply-router>
                    <expression-message-info-mapping messageIdExpression="#[header:customCorrelation]" correlationIdExpression="#[mule:message.correlationId]"/>
                </single-async-reply-router>
Show
Andrew Perepelytsya added a comment - This is now possible through expression-message-info-mapping:
<single-async-reply-router>
                    <expression-message-info-mapping messageIdExpression="#[header:customCorrelation]" correlationIdExpression="#[mule:message.correlationId]"/>
                </single-async-reply-router>

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: