pass transformers to executeRequest
@@ -118,12 +118,12 @@ func (d *MessageDispatcherImpl) DispatchMessageWithRetries(ctx context.Context,
// Try to send to destination
messagesToFinish = append(messagesToFinish, message)
- ctx, responseMessage, responseAdditionalHeaders, dispatchExecutionInfo, err = d.executeRequest(ctx, destination, message, additionalHeaders, retriesConfig)
+ ctx, responseMessage, responseAdditionalHeaders, dispatchExecutionInfo, err = d.executeRequest(ctx, destination, message, additionalHeaders, retriesConfig, transformers...)
if err != nil {
// If DeadLetter is configured, then send original message with knative error extensions
if deadLetter != nil {
- transformers := d.dispatchExecutionInfoTransformers(dispatchExecutionInfo)
- _, deadLetterResponse, _, dispatchExecutionInfo, deadLetterErr := d.executeRequest(ctx, deadLetter, message, additionalHeaders, retriesConfig, transformers...)
+ dispatchTransformers := d.dispatchExecutionInfoTransformers(dispatchExecutionInfo)
+ _, deadLetterResponse, _, dispatchExecutionInfo, deadLetterErr := d.executeRequest(ctx, deadLetter, message, additionalHeaders, retriesConfig, append(transformers, dispatchTransformers)...)
if deadLetterErr != nil {
return dispatchExecutionInfo, fmt.Errorf("unable to complete request to either %s (%v) or %s (%v)", destination, err, deadLetter, deadLetterErr)
}
@@ -158,8 +158,8 @@ func (d *MessageDispatcherImpl) DispatchMessageWithRetries(ctx context.Context,
if err != nil {
// If DeadLetter is configured, then send original message with knative error extensions
if deadLetter != nil {
- transformers := d.dispatchExecutionInfoTransformers(dispatchExecutionInfo)
- _, deadLetterResponse, _, dispatchExecutionInfo, deadLetterErr := d.executeRequest(ctx, deadLetter, message, responseAdditionalHeaders, retriesConfig, transformers...)
+ dispatchTransformers := d.dispatchExecutionInfoTransformers(dispatchExecutionInfo)
+ _, deadLetterResponse, _, dispatchExecutionInfo, deadLetterErr := d.executeRequest(ctx, deadLetter, message, responseAdditionalHeaders, retriesConfig, append(transformers, dispatchTransformers)...)
if deadLetterErr != nil {
return dispatchExecutionInfo, fmt.Errorf("failed to forward reply to %s (%v) and failed to send it to the dead letter sink %s (%v)", reply, err, deadLetter, deadLetterErr)
}
