File tree 3 files changed +13
-2
lines changed
src/main/java/org/springframework/integration/aws/outbound
3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,8 @@ public abstract class AbstractAwsMessageHandler<H> extends AbstractMessageProduc
61
61
62
62
private HeaderMapper <H > headerMapper ;
63
63
64
+ private boolean headerMapperSet ;
65
+
64
66
public void setSendTimeout (long sendTimeout ) {
65
67
setSendTimeoutExpression (new ValueExpression <>(sendTimeout ));
66
68
}
@@ -84,6 +86,11 @@ protected Expression getSendTimeoutExpression() {
84
86
*/
85
87
public void setHeaderMapper (HeaderMapper <H > headerMapper ) {
86
88
this .headerMapper = headerMapper ;
89
+ this .headerMapperSet = true ;
90
+ }
91
+
92
+ protected boolean isHeaderMapperSet () {
93
+ return this .headerMapperSet ;
87
94
}
88
95
89
96
/**
Original file line number Diff line number Diff line change @@ -187,7 +187,9 @@ public void setBodyExpression(Expression bodyExpression) {
187
187
@ Override
188
188
protected void onInit () {
189
189
super .onInit ();
190
- setHeaderMapper (new SnsHeaderMapper ());
190
+ if (!isHeaderMapperSet ()) {
191
+ setHeaderMapper (new SnsHeaderMapper ());
192
+ }
191
193
TypeLocator typeLocator = getEvaluationContext ().getTypeLocator ();
192
194
if (typeLocator instanceof StandardTypeLocator standardTypeLocator ) {
193
195
/*
Original file line number Diff line number Diff line change @@ -148,7 +148,9 @@ public void setMessageConverter(MessageConverter messageConverter) {
148
148
@ Override
149
149
protected void onInit () {
150
150
super .onInit ();
151
- setHeaderMapper (new SqsHeaderMapper ());
151
+ if (!isHeaderMapperSet ()) {
152
+ setHeaderMapper (new SqsHeaderMapper ());
153
+ }
152
154
if (this .messageConverter == null ) {
153
155
this .messageConverter = new GenericMessageConverter (getConversionService ());
154
156
}
You can’t perform that action at this time.
0 commit comments