INT-4448, INT-4449: Fix Gateway for no-arg method #2420
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
JIRA: https://jira.spring.io/browse/INT-4448
JIRA: https://jira.spring.io/browse/INT-4449
When we are not interested in the
payload
to send, we use a gatewaymethod without any args, but in this case for send operation (or
send-and-receive) we should specify a default
payloadExpression
The
MessagingGatewayRegistrar
fails withNPE
if we don't have aany global headers and have
defaultPayloadExpression
Also in this case the
GatewayProxyFactoryBean
fails to sendand fallbacks to receive with the meaning "no args, not payloadExpression"
MessagingGatewayRegistrar
to checkhasDefaultHeaders
beforeprocessing them
GatewayProxyFactoryBean
to consultthis.globalMethodMetadata
if there is no
payloadExpression
for the method specific metadataCherry-pick to 5.0.x and 4.3.x